共用方式為


CosmosPartitionKeyInPrimaryKeyConvention Class

Definition

A convention that adds partition key properties to the EF primary key and adds the '__jObject' containing the JSON object returned by the store.

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
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
Inheritance
CosmosPartitionKeyInPrimaryKeyConvention
Implements

Remarks

See Model building conventions, and Accessing Azure Cosmos DB with EF Core for more information and examples.

Constructors

CosmosPartitionKeyInPrimaryKeyConvention(ProviderConventionSetBuilderDependencies)

Creates a new instance of CosmosPartitionKeyInPrimaryKeyConvention.

Fields

JObjectPropertyName

This is an internal API that supports the Entity Framework Core infrastructure and not subject to the same compatibility standards as public APIs. It may be changed or removed without notice in any release. You should only use it directly in your code with extreme caution and knowing that doing so can result in application failures when updating to a new Entity Framework Core release.

Properties

Dependencies

Dependencies for this service.

Methods

ProcessEntityTypeAdded(IConventionEntityTypeBuilder, IConventionContext<IConventionEntityTypeBuilder>)

Called after an entity type is added to the model.

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

Called after an annotation is changed on an entity type.

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

Called after the base type of an entity type changes.

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

Called after the primary key for an entity type is changed.

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

Called after the ownership value for a foreign key is changed.

ProcessForeignKeyRemoved(IConventionEntityTypeBuilder, IConventionForeignKey, IConventionContext<IConventionForeignKey>)

Called after a foreign key is removed.

ProcessKeyAdded(IConventionKeyBuilder, IConventionContext<IConventionKeyBuilder>)

Called after a key is added to the entity type.

ProcessKeyRemoved(IConventionEntityTypeBuilder, IConventionKey, IConventionContext<IConventionKey>)

Called after a key is removed.

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

Called after an annotation is changed on a property.

Applies to