語言

KeyComplexPropertyConvention Class

Definition

A convention that marks every complex property in the path to a property used by a key as required, since the value of such a property must be available in order to compute the key value.

[System.Runtime.CompilerServices.Nullable(0)]
public class KeyComplexPropertyConvention : Microsoft.EntityFrameworkCore.Metadata.Conventions.IKeyAddedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IKeyRemovedConvention
[<System.Runtime.CompilerServices.Nullable(0)>]
type KeyComplexPropertyConvention = class
    interface IKeyAddedConvention
    interface IConvention
    interface IKeyRemovedConvention
Public Class KeyComplexPropertyConvention
Implements IKeyAddedConvention, IKeyRemovedConvention
Inheritance
KeyComplexPropertyConvention
Attributes
Implements

Remarks

When the last referencing key is removed, the implicit non-nullable configuration applied here is reverted as long as no other key keeps the chain in use and no explicit configuration was applied by the user.

See Model building conventions for more information and examples.

Constructors

Name Description
KeyComplexPropertyConvention(ProviderConventionSetBuilderDependencies)

A convention that marks every complex property in the path to a property used by a key as required, since the value of such a property must be available in order to compute the key value.

Properties

Name Description
Dependencies

Dependencies for this service.

Methods

Name Description
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.

Applies to