ForeignKeyAttributeConvention Class

Definition

A convention that configures the foreign key properties associated with a navigation property based on the ForeignKeyAttribute specified on the properties or the navigation properties.

public class ForeignKeyAttributeConvention : Microsoft.EntityFrameworkCore.Metadata.Conventions.IForeignKeyAddedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IModelFinalizedConvention
public class ForeignKeyAttributeConvention : Microsoft.EntityFrameworkCore.Metadata.Conventions.IForeignKeyAddedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IModelFinalizingConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.INavigationAddedConvention
public class ForeignKeyAttributeConvention : Microsoft.EntityFrameworkCore.Metadata.Conventions.IEntityTypeAddedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IForeignKeyAddedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IModelFinalizingConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.INavigationAddedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.ISkipNavigationForeignKeyChangedConvention
public class ForeignKeyAttributeConvention : Microsoft.EntityFrameworkCore.Metadata.Conventions.IComplexPropertyAddedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IEntityTypeAddedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IForeignKeyAddedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IModelFinalizingConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.INavigationAddedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IPropertyAddedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.ISkipNavigationForeignKeyChangedConvention
type ForeignKeyAttributeConvention = class
    interface IForeignKeyAddedConvention
    interface IConvention
    interface IModelFinalizedConvention
type ForeignKeyAttributeConvention = class
    interface IForeignKeyAddedConvention
    interface IConvention
    interface INavigationAddedConvention
    interface IModelFinalizingConvention
type ForeignKeyAttributeConvention = class
    interface IEntityTypeAddedConvention
    interface IConvention
    interface IForeignKeyAddedConvention
    interface INavigationAddedConvention
    interface ISkipNavigationForeignKeyChangedConvention
    interface IModelFinalizingConvention
type ForeignKeyAttributeConvention = class
    interface IEntityTypeAddedConvention
    interface IConvention
    interface IForeignKeyAddedConvention
    interface INavigationAddedConvention
    interface ISkipNavigationForeignKeyChangedConvention
    interface IPropertyAddedConvention
    interface IComplexPropertyAddedConvention
    interface IModelFinalizingConvention
Public Class ForeignKeyAttributeConvention
Implements IForeignKeyAddedConvention, IModelFinalizedConvention
Public Class ForeignKeyAttributeConvention
Implements IForeignKeyAddedConvention, IModelFinalizingConvention, INavigationAddedConvention
Public Class ForeignKeyAttributeConvention
Implements IEntityTypeAddedConvention, IForeignKeyAddedConvention, IModelFinalizingConvention, INavigationAddedConvention, ISkipNavigationForeignKeyChangedConvention
Public Class ForeignKeyAttributeConvention
Implements IComplexPropertyAddedConvention, IEntityTypeAddedConvention, IForeignKeyAddedConvention, IModelFinalizingConvention, INavigationAddedConvention, IPropertyAddedConvention, ISkipNavigationForeignKeyChangedConvention
Inheritance
ForeignKeyAttributeConvention
Implements

Remarks

For one-to-one relationships the attribute has to be specified on the navigation property pointing to the principal.

See Model building conventions for more information and examples.

Constructors

ForeignKeyAttributeConvention(ProviderConventionSetBuilderDependencies)

Creates a new instance of ForeignKeyAttributeConvention.

Properties

Dependencies

Dependencies for this service.

Methods

ProcessComplexPropertyAdded(IConventionComplexPropertyBuilder, IConventionContext<IConventionComplexPropertyBuilder>)

Called after a complex property is added to a type-like object.

ProcessEntityTypeAdded(IConventionEntityTypeBuilder, IConventionContext<IConventionEntityTypeBuilder>)

Called after an entity type is added to the model.

ProcessForeignKeyAdded(IConventionForeignKeyBuilder, IConventionContext<IConventionForeignKeyBuilder>)

Called after a foreign key is added to the entity type.

ProcessForeignKeyAdded(IConventionRelationshipBuilder, IConventionContext<IConventionRelationshipBuilder>)

Called after a foreign key is added to the entity type.

ProcessModelFinalized(IConventionModelBuilder, IConventionContext<IConventionModelBuilder>)

Called after a model is finalized.

ProcessModelFinalizing(IConventionModelBuilder, IConventionContext<IConventionModelBuilder>)

Called when a model is being finalized.

ProcessNavigationAdded(IConventionNavigationBuilder, IConventionContext<IConventionNavigationBuilder>)

Called after a navigation is added to the entity type.

ProcessPropertyAdded(IConventionPropertyBuilder, IConventionContext<IConventionPropertyBuilder>)

Called after a property is added to the entity type.

ProcessSkipNavigationForeignKeyChanged(IConventionSkipNavigationBuilder, IConventionForeignKey, IConventionForeignKey, IConventionContext<IConventionForeignKey>)

Called after a skip navigation inverse is changed.

Applies to