Share via


CosmosModelBuilderExtensions.CanSetDefaultContainer Method

Definition

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

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

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

true if the given container name can be set as default.

Remarks

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

Applies to