Język

CosmosPartitionKeyInPrimaryKeyConvention Klasa

Definicja

Konwencja, która dodaje właściwości klucza partycji do klucza podstawowego ef.

[System.Runtime.CompilerServices.Nullable(0)]
public class CosmosPartitionKeyInPrimaryKeyConvention : Microsoft.EntityFrameworkCore.Metadata.Conventions.IEntityTypeAddedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IEntityTypeAnnotationChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IEntityTypeBaseTypeChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IEntityTypePrimaryKeyChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IForeignKeyOwnershipChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IForeignKeyRemovedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IKeyAddedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IKeyRemovedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IPropertyAnnotationChangedConvention
[<System.Runtime.CompilerServices.Nullable(0)>]
type CosmosPartitionKeyInPrimaryKeyConvention = class
    interface IEntityTypeAddedConvention
    interface IConvention
    interface IPropertyAnnotationChangedConvention
    interface IForeignKeyOwnershipChangedConvention
    interface IForeignKeyRemovedConvention
    interface IKeyAddedConvention
    interface IKeyRemovedConvention
    interface IEntityTypePrimaryKeyChangedConvention
    interface IEntityTypeAnnotationChangedConvention
    interface IEntityTypeBaseTypeChangedConvention
Public Class CosmosPartitionKeyInPrimaryKeyConvention
Implements IEntityTypeAddedConvention, IEntityTypeAnnotationChangedConvention, IEntityTypeBaseTypeChangedConvention, IEntityTypePrimaryKeyChangedConvention, IForeignKeyOwnershipChangedConvention, IForeignKeyRemovedConvention, IKeyAddedConvention, IKeyRemovedConvention, IPropertyAnnotationChangedConvention
Dziedziczenie
CosmosPartitionKeyInPrimaryKeyConvention
Atrybuty
Implementuje

Uwagi

Aby uzyskać więcej informacji i przykłady, zobacz Konwencje tworzenia modeli i Uzyskiwanie dostępu do Azure Cosmos DB za pomocą programu EF Core.

Konstruktory

Nazwisko Opis
CosmosPartitionKeyInPrimaryKeyConvention(ProviderConventionSetBuilderDependencies)

Tworzy nowe wystąpienie klasy CosmosPartitionKeyInPrimaryKeyConvention.

Pola

Nazwisko Opis
JObjectPropertyName

Jest to wewnętrzny interfejs API, który obsługuje infrastrukturę Entity Framework Core i nie podlega tym samym standardom zgodności co publiczne interfejsy API. Można go zmienić lub usunąć bez powiadomienia w jakiejkolwiek wersji. Należy używać go bezpośrednio w kodzie z wyjątkową ostrożnością i wiedząc, że może to spowodować błędy aplikacji podczas aktualizowania do nowej wersji Entity Framework Core.

Właściwości

Nazwisko Opis
Dependencies

Zależności dla tej usługi.

Metody

Nazwisko Opis
ProcessEntityTypeAdded(IConventionEntityTypeBuilder, IConventionContext<IConventionEntityTypeBuilder>)

Wywoływana po dodaniu typu jednostki do modelu.

ProcessEntityTypeAnnotationChanged(IConventionEntityTypeBuilder, String, IConventionAnnotation, IConventionAnnotation, IConventionContext<IConventionAnnotation>)

Wywoływana po zmianie adnotacji w typie jednostki.

ProcessEntityTypeBaseTypeChanged(IConventionEntityTypeBuilder, IConventionEntityType, IConventionEntityType, IConventionContext<IConventionEntityType>)

Wywoływana po zmianie typu podstawowego typu jednostki.

ProcessEntityTypePrimaryKeyChanged(IConventionEntityTypeBuilder, IConventionKey, IConventionKey, IConventionContext<IConventionKey>)

Wywoływana po zmianie klucza podstawowego dla typu jednostki.

ProcessForeignKeyOwnershipChanged(IConventionForeignKeyBuilder, IConventionContext<Nullable<Boolean>>)

Wywoływana po zmianie wartości własności klucza obcego.

ProcessForeignKeyRemoved(IConventionEntityTypeBuilder, IConventionForeignKey, IConventionContext<IConventionForeignKey>)

Wywoływana po usunięciu klucza obcego.

ProcessKeyAdded(IConventionKeyBuilder, IConventionContext<IConventionKeyBuilder>)

Wywoływana po dodaniu klucza do typu jednostki.

ProcessKeyRemoved(IConventionEntityTypeBuilder, IConventionKey, IConventionContext<IConventionKey>)

Wywoływana po usunięciu klucza.

ProcessPropertyAnnotationChanged(IConventionPropertyBuilder, String, IConventionAnnotation, IConventionAnnotation, IConventionContext<IConventionAnnotation>)

Wywoływana po zmianie adnotacji we właściwości.

Dotyczy