CosmosEntityTypeBuilderExtensions.ToContainer Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
ToContainer(EntityTypeBuilder, String) |
Configures the container that the entity type maps to when targeting Azure Cosmos. |
ToContainer(IConventionEntityTypeBuilder, String, Boolean) |
Configures the container that the entity type maps to when targeting Azure Cosmos. |
ToContainer<TEntity>(EntityTypeBuilder<TEntity>, String) |
Configures the container that the entity type maps to when targeting Azure Cosmos. |
ToContainer(EntityTypeBuilder, String)
Configures the container that the entity type maps to when targeting Azure Cosmos.
public static Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder ToContainer (this Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder entityTypeBuilder, string name);
public static Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder ToContainer (this Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder entityTypeBuilder, string? name);
static member ToContainer : Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder * string -> Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder
<Extension()>
Public Function ToContainer (entityTypeBuilder As EntityTypeBuilder, name As String) As EntityTypeBuilder
Parameters
- entityTypeBuilder
- EntityTypeBuilder
The builder for the entity type being configured.
- name
- String
The name of the container.
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
ToContainer(IConventionEntityTypeBuilder, String, Boolean)
Configures the container that the entity type maps to when targeting Azure Cosmos.
public static Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionEntityTypeBuilder ToContainer (this Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionEntityTypeBuilder entityTypeBuilder, string name, bool fromDataAnnotation = false);
public static Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionEntityTypeBuilder? ToContainer (this Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionEntityTypeBuilder entityTypeBuilder, string? name, bool fromDataAnnotation = false);
static member ToContainer : Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionEntityTypeBuilder * string * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionEntityTypeBuilder
<Extension()>
Public Function ToContainer (entityTypeBuilder As IConventionEntityTypeBuilder, name As String, Optional fromDataAnnotation As Boolean = false) As IConventionEntityTypeBuilder
Parameters
- entityTypeBuilder
- IConventionEntityTypeBuilder
The builder for the entity type being configured.
- name
- String
The name of the container.
- 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
ToContainer<TEntity>(EntityTypeBuilder<TEntity>, String)
Configures the container that the entity type maps to when targeting Azure Cosmos.
public static Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder<TEntity> ToContainer<TEntity> (this Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder<TEntity> entityTypeBuilder, string name) where TEntity : class;
public static Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder<TEntity> ToContainer<TEntity> (this Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder<TEntity> entityTypeBuilder, string? name) where TEntity : class;
static member ToContainer : Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder<'Entity (requires 'Entity : null)> * string -> Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder<'Entity (requires 'Entity : null)> (requires 'Entity : null)
<Extension()>
Public Function ToContainer(Of TEntity As Class) (entityTypeBuilder As EntityTypeBuilder(Of TEntity), name As String) As EntityTypeBuilder(Of TEntity)
Type Parameters
- TEntity
The entity type being configured.
Parameters
- entityTypeBuilder
- EntityTypeBuilder<TEntity>
The builder for the entity type being configured.
- name
- String
The name of the container.
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
Entity Framework