Partager via


CosmosJsonIdConvention Class

Definition

A convention that configures mapping the PK and/or discriminator properties to the JSON 'id' property.

public class CosmosJsonIdConvention : Microsoft.EntityFrameworkCore.Metadata.Conventions.IDiscriminatorPropertySetConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IEntityTypeAddedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IEntityTypeAnnotationChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IEntityTypeBaseTypeChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IForeignKeyOwnershipChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IKeyAddedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IKeyRemovedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IModelAnnotationChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IPropertyAddedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IPropertyAnnotationChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IPropertyRemovedConvention
type CosmosJsonIdConvention = class
    interface IEntityTypeAddedConvention
    interface IConvention
    interface IEntityTypeBaseTypeChangedConvention
    interface IEntityTypeAnnotationChangedConvention
    interface IForeignKeyOwnershipChangedConvention
    interface IKeyAddedConvention
    interface IKeyRemovedConvention
    interface IPropertyAddedConvention
    interface IPropertyRemovedConvention
    interface IPropertyAnnotationChangedConvention
    interface IModelAnnotationChangedConvention
    interface IDiscriminatorPropertySetConvention
Public Class CosmosJsonIdConvention
Implements IDiscriminatorPropertySetConvention, IEntityTypeAddedConvention, IEntityTypeAnnotationChangedConvention, IEntityTypeBaseTypeChangedConvention, IForeignKeyOwnershipChangedConvention, IKeyAddedConvention, IKeyRemovedConvention, IModelAnnotationChangedConvention, IPropertyAddedConvention, IPropertyAnnotationChangedConvention, IPropertyRemovedConvention
Inheritance
CosmosJsonIdConvention
Implements

Remarks

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

Constructors

CosmosJsonIdConvention(ProviderConventionSetBuilderDependencies, IJsonIdDefinitionFactory)

Creates a new instance of CosmosJsonIdConvention.

Fields

DefaultIdPropertyName

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.

IdPropertyJsonName

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

DefinitionFactory

The factory to create a Microsoft.EntityFrameworkCore.Cosmos.Metadata.Internal.IJsonIdDefinition for each entity type.

Dependencies

Dependencies for this service.

Methods

ProcessDiscriminatorPropertySet(IConventionEntityTypeBuilder, String, IConventionContext<String>)

Called after a discriminator property is set.

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.

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

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

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.

ProcessModelAnnotationChanged(IConventionModelBuilder, String, IConventionAnnotation, IConventionAnnotation, IConventionContext<IConventionAnnotation>)

Called after an annotation is changed on an model.

ProcessPropertyAdded(IConventionPropertyBuilder, IConventionContext<IConventionPropertyBuilder>)

Called after a property is added to the entity type.

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

Called after an annotation is changed on a property.

ProcessPropertyRemoved(IConventionTypeBaseBuilder, IConventionProperty, IConventionContext<IConventionProperty>)

Called after a property is removed from the entity type.

Applies to