CosmosEntityTypeBuilderExtensions.HasPartitionKey Metoda
Definice
Důležité
Některé informace platí pro předběžně vydaný produkt, který se může zásadně změnit, než ho výrobce nebo autor vydá. Microsoft neposkytuje žádné záruky, výslovné ani předpokládané, týkající se zde uváděných informací.
Přetížení
HasPartitionKey(EntityTypeBuilder, String) |
Nakonfiguruje vlastnost, která se používá k uložení klíče oddílu. |
HasPartitionKey(IConventionEntityTypeBuilder, String, Boolean) |
Nakonfiguruje vlastnost, která se používá k uložení klíče oddílu. |
HasPartitionKey<TEntity,TProperty>(EntityTypeBuilder<TEntity>, Expression<Func<TEntity,TProperty>>) |
Nakonfiguruje vlastnost, která se používá k uložení klíče oddílu. |
HasPartitionKey<TEntity>(EntityTypeBuilder<TEntity>, String) |
Nakonfiguruje vlastnost, která se používá k uložení klíče oddílu. |
HasPartitionKey(EntityTypeBuilder, String)
Nakonfiguruje vlastnost, která se používá k uložení klíče oddílu.
public static Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder HasPartitionKey (this Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder entityTypeBuilder, string name);
public static Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder HasPartitionKey (this Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder entityTypeBuilder, string? name);
static member HasPartitionKey : Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder * string -> Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder
<Extension()>
Public Function HasPartitionKey (entityTypeBuilder As EntityTypeBuilder, name As String) As EntityTypeBuilder
Parametry
- entityTypeBuilder
- EntityTypeBuilder
Tvůrce pro konfigurovaný typ entity.
- name
- String
Název vlastnosti klíče oddílu.
Návraty
Stejná instance tvůrce, aby bylo možné zřetězených více volání.
Poznámky
Další informace a příklady najdete v tématech Modelování typů entit a relací a Přístup ke službě Azure Cosmos DB pomocí EF Core .
Platí pro
HasPartitionKey(IConventionEntityTypeBuilder, String, Boolean)
Nakonfiguruje vlastnost, která se používá k uložení klíče oddílu.
public static Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionEntityTypeBuilder HasPartitionKey (this Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionEntityTypeBuilder entityTypeBuilder, string name, bool fromDataAnnotation = false);
public static Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionEntityTypeBuilder? HasPartitionKey (this Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionEntityTypeBuilder entityTypeBuilder, string? name, bool fromDataAnnotation = false);
static member HasPartitionKey : Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionEntityTypeBuilder * string * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionEntityTypeBuilder
<Extension()>
Public Function HasPartitionKey (entityTypeBuilder As IConventionEntityTypeBuilder, name As String, Optional fromDataAnnotation As Boolean = false) As IConventionEntityTypeBuilder
Parametry
- entityTypeBuilder
- IConventionEntityTypeBuilder
Tvůrce pro konfigurovaný typ entity.
- name
- String
Název vlastnosti klíče oddílu.
- fromDataAnnotation
- Boolean
Určuje, zda byla konfigurace zadána pomocí datové poznámky.
Návraty
Stejná instance tvůrce, pokud byla použita konfigurace, null
v opačném případě.
Poznámky
Další informace a příklady najdete v tématech Modelování typů entit a relací a Přístup ke službě Azure Cosmos DB pomocí EF Core .
Platí pro
HasPartitionKey<TEntity,TProperty>(EntityTypeBuilder<TEntity>, Expression<Func<TEntity,TProperty>>)
Nakonfiguruje vlastnost, která se používá k uložení klíče oddílu.
public static Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder<TEntity> HasPartitionKey<TEntity,TProperty> (this Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder<TEntity> entityTypeBuilder, System.Linq.Expressions.Expression<Func<TEntity,TProperty>> propertyExpression) where TEntity : class;
static member HasPartitionKey : Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder<'Entity (requires 'Entity : null)> * System.Linq.Expressions.Expression<Func<'Entity, 'Property>> -> Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder<'Entity (requires 'Entity : null)> (requires 'Entity : null)
<Extension()>
Public Function HasPartitionKey(Of TEntity As Class, TProperty As Class) (entityTypeBuilder As EntityTypeBuilder(Of TEntity), propertyExpression As Expression(Of Func(Of TEntity, TProperty))) As EntityTypeBuilder(Of TEntity)
Parametry typu
- TEntity
- TProperty
Parametry
- entityTypeBuilder
- EntityTypeBuilder<TEntity>
Tvůrce pro konfigurovaný typ entity.
- propertyExpression
- Expression<Func<TEntity,TProperty>>
Vlastnost klíče oddílu
Návraty
Stejná instance tvůrce, aby bylo možné zřetězených více volání.
Poznámky
Další informace a příklady najdete v tématech Modelování typů entit a relací a Přístup ke službě Azure Cosmos DB pomocí EF Core .
Platí pro
HasPartitionKey<TEntity>(EntityTypeBuilder<TEntity>, String)
Nakonfiguruje vlastnost, která se používá k uložení klíče oddílu.
public static Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder<TEntity> HasPartitionKey<TEntity> (this Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder<TEntity> entityTypeBuilder, string name) where TEntity : class;
public static Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder<TEntity> HasPartitionKey<TEntity> (this Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder<TEntity> entityTypeBuilder, string? name) where TEntity : class;
static member HasPartitionKey : 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 HasPartitionKey(Of TEntity As Class) (entityTypeBuilder As EntityTypeBuilder(Of TEntity), name As String) As EntityTypeBuilder(Of TEntity)
Parametry typu
- TEntity
Parametry
- entityTypeBuilder
- EntityTypeBuilder<TEntity>
Tvůrce pro konfigurovaný typ entity.
- name
- String
Název vlastnosti klíče oddílu.
Návraty
Stejná instance tvůrce, aby bylo možné zřetězených více volání.
Poznámky
Další informace a příklady najdete v tématech Modelování typů entit a relací a Přístup ke službě Azure Cosmos DB pomocí EF Core .
Platí pro
Entity Framework
Váš názor
https://aka.ms/ContentUserFeedback.
Připravujeme: V průběhu roku 2024 budeme postupně vyřazovat problémy z GitHub coby mechanismus zpětné vazby pro obsah a nahrazovat ho novým systémem zpětné vazby. Další informace naleznete v tématu:Odeslat a zobrazit názory pro