Partager via


CosmosModelBuilderExtensions.HasDiscriminatorInJsonIds Method

Definition

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.

includeDiscriminator
Nullable<Boolean>

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