CosmosModelBuilderExtensions.HasDiscriminatorInJsonIds Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Includes the discriminator value of the entity type in the JSON "id" value. This was the default behavior before EF Core 9.
public static Microsoft.EntityFrameworkCore.ModelBuilder HasDiscriminatorInJsonIds (this Microsoft.EntityFrameworkCore.ModelBuilder modelBuilder, bool? includeDiscriminator = True);
static member HasDiscriminatorInJsonIds : Microsoft.EntityFrameworkCore.ModelBuilder * Nullable<bool> -> Microsoft.EntityFrameworkCore.ModelBuilder
<Extension()>
Public Function HasDiscriminatorInJsonIds (modelBuilder As ModelBuilder, Optional includeDiscriminator As Nullable(Of Boolean) = True) As ModelBuilder
Parameters
- modelBuilder
- ModelBuilder
The model builder.
true
to include the discriminator, false
to not include the discriminator,
null
to revert to the default setting.
Returns
The same builder instance so that multiple calls can be chained.
Remarks
See Modeling entity types and relationships, and Accessing Azure Cosmos DB with EF Core for more information and examples.
Applies to
Entity Framework