CosmosModelBuilderExtensions.HasDefaultContainer 方法

定义

重载

HasDefaultContainer(ModelBuilder, String)

配置未显式为实体类型配置名称时将使用的默认容器名称。

HasDefaultContainer(IConventionModelBuilder, String, Boolean)

配置未显式为实体类型配置名称时将使用的默认容器名称。

HasDefaultContainer(ModelBuilder, String)

Source:
CosmosModelBuilderExtensions.cs
Source:
CosmosModelBuilderExtensions.cs
Source:
CosmosModelBuilderExtensions.cs
Source:
CosmosModelBuilderExtensions.cs
Source:
CosmosModelBuilderExtensions.cs
Source:
CosmosModelBuilderExtensions.cs
Source:
CosmosModelBuilderExtensions.cs

配置未显式为实体类型配置名称时将使用的默认容器名称。

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

参数

modelBuilder
ModelBuilder

模型生成器。

name
String

默认容器名称。

返回

同一生成器实例,以便可以链接多个调用。

注解

有关详细信息和示例,请参阅为实体类型和关系建模和使用 EF Core 访问 Azure Cosmos DB

适用于

HasDefaultContainer(IConventionModelBuilder, String, Boolean)

Source:
CosmosModelBuilderExtensions.cs
Source:
CosmosModelBuilderExtensions.cs
Source:
CosmosModelBuilderExtensions.cs
Source:
CosmosModelBuilderExtensions.cs
Source:
CosmosModelBuilderExtensions.cs
Source:
CosmosModelBuilderExtensions.cs
Source:
CosmosModelBuilderExtensions.cs

配置未显式为实体类型配置名称时将使用的默认容器名称。

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

参数

modelBuilder
IConventionModelBuilder

模型生成器。

name
String

默认容器名称。

fromDataAnnotation
Boolean

指示是否使用数据注释指定配置。

返回

如果应用了配置,则为同一生成器实例, null 否则为 。

注解

有关详细信息和示例,请参阅为实体类型和关系建模和使用 EF Core 访问 Azure Cosmos DB

适用于