Share via


CosmosModelBuilderExtensions.HasDefaultContainer Method

Definition

Overloads

HasDefaultContainer(ModelBuilder, String)

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

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.

public static Microsoft.EntityFrameworkCore.ModelBuilder HasDefaultContainer (this Microsoft.EntityFrameworkCore.ModelBuilder modelBuilder, string name);
public static Microsoft.EntityFrameworkCore.ModelBuilder HasDefaultContainer (this Microsoft.EntityFrameworkCore.ModelBuilder modelBuilder, string? name);
static member HasDefaultContainer : Microsoft.EntityFrameworkCore.ModelBuilder * string -> Microsoft.EntityFrameworkCore.ModelBuilder
<Extension()>
Public Function HasDefaultContainer (modelBuilder As ModelBuilder, name As String) As ModelBuilder

Parameters

modelBuilder
ModelBuilder

The model builder.

name
String

The default container name.

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

HasDefaultContainer(IConventionModelBuilder, String, Boolean)

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

public static Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionModelBuilder HasDefaultContainer (this Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionModelBuilder modelBuilder, string name, bool fromDataAnnotation = false);
public static Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionModelBuilder? HasDefaultContainer (this Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionModelBuilder modelBuilder, string? name, bool fromDataAnnotation = false);
static member HasDefaultContainer : Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionModelBuilder * string * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionModelBuilder
<Extension()>
Public Function HasDefaultContainer (modelBuilder As IConventionModelBuilder, name As String, Optional fromDataAnnotation As Boolean = false) As IConventionModelBuilder

Parameters

modelBuilder
IConventionModelBuilder

The model builder.

name
String

The default container name.

fromDataAnnotation
Boolean

Indicates whether the configuration was specified using a data annotation.

Returns

The same builder instance if the configuration was applied, null otherwise.

Remarks

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

Applies to