Udostępnij za pośrednictwem


CosmosModelBuilderExtensions Class

Definition

Cosmos-specific extension methods for ModelBuilder.

public static class CosmosModelBuilderExtensions
type CosmosModelBuilderExtensions = class
Public Module CosmosModelBuilderExtensions
Inheritance
CosmosModelBuilderExtensions

Remarks

See Modeling entity types and relationships, and Accessing Azure Cosmos DB with EF Core for more information and examples.

Methods

CanSetDefaultContainer(IConventionModelBuilder, String, Boolean)

Returns a value indicating whether the given container name can be set as default.

CanSetThroughput(IConventionModelBuilder, Nullable<Int32>, Boolean, Boolean)

Returns a value indicating whether the given throughput can be set.

HasAutoscaleThroughput(ModelBuilder, Nullable<Int32>)

Configures the autoscale provisioned throughput offering.

HasDefaultContainer(IConventionModelBuilder, String, Boolean)

Configures the default container name that will be used if no name is explicitly configured for an entity type.

HasDefaultContainer(ModelBuilder, String)

Configures the default container name that will be used if no name is explicitly configured for an entity type.

HasDiscriminatorInJsonIds(ModelBuilder, Nullable<Boolean>)

Includes the discriminator value of the entity type in the JSON "id" value. This was the default behavior before EF Core 9.

HasManualThroughput(ModelBuilder, Nullable<Int32>)

Configures the manual provisioned throughput offering.

HasRootDiscriminatorInJsonId(ModelBuilder, Nullable<Boolean>)

Includes the discriminator value of the root entity type in the JSON "id" value. This allows types with the same primary key to be saved in the same container, while still allowing "ReadItem" to be used for lookups of an unknown type.

HasShadowIds(ModelBuilder, Nullable<Boolean>)

Forces model building to always create a "__id" shadow property mapped to the JSON "id". This was the default behavior before EF Core 9.0.

HasThroughput(IConventionModelBuilder, Nullable<Int32>, Boolean, Boolean)

Configures the provisioned throughput.

Applies to