RelationshipDiscoveryConvention 类

定义

一种约定,该约定基于导航属性配置实体类型之间的关系,前提是该实体类型是相应的反向导航。

public class RelationshipDiscoveryConvention : Microsoft.EntityFrameworkCore.Metadata.Conventions.IEntityTypeAddedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IEntityTypeBaseTypeChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IEntityTypeIgnoredConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IEntityTypeMemberIgnoredConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IForeignKeyOwnershipChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.INavigationAddedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.INavigationRemovedConvention
public class RelationshipDiscoveryConvention : Microsoft.EntityFrameworkCore.Metadata.Conventions.IEntityTypeAddedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IEntityTypeBaseTypeChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IEntityTypeIgnoredConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IEntityTypeMemberIgnoredConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IForeignKeyNullNavigationSetConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IForeignKeyOwnershipChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IForeignKeyRemovedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.INavigationAddedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.INavigationRemovedConvention
public class RelationshipDiscoveryConvention : Microsoft.EntityFrameworkCore.Metadata.Conventions.IEntityTypeAddedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IEntityTypeBaseTypeChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IEntityTypeMemberIgnoredConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IForeignKeyNullNavigationSetConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IForeignKeyOwnershipChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IForeignKeyRemovedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.INavigationAddedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.INavigationRemovedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.ITypeIgnoredConvention
type RelationshipDiscoveryConvention = class
    interface IEntityTypeAddedConvention
    interface IConvention
    interface IEntityTypeIgnoredConvention
    interface IEntityTypeBaseTypeChangedConvention
    interface INavigationRemovedConvention
    interface IEntityTypeMemberIgnoredConvention
    interface INavigationAddedConvention
    interface IForeignKeyOwnershipChangedConvention
type RelationshipDiscoveryConvention = class
    interface IEntityTypeAddedConvention
    interface IConvention
    interface IEntityTypeIgnoredConvention
    interface IEntityTypeBaseTypeChangedConvention
    interface IEntityTypeMemberIgnoredConvention
    interface INavigationRemovedConvention
    interface INavigationAddedConvention
    interface IForeignKeyOwnershipChangedConvention
type RelationshipDiscoveryConvention = class
    interface IEntityTypeAddedConvention
    interface IConvention
    interface IEntityTypeIgnoredConvention
    interface IEntityTypeBaseTypeChangedConvention
    interface IEntityTypeMemberIgnoredConvention
    interface INavigationRemovedConvention
    interface INavigationAddedConvention
    interface IForeignKeyOwnershipChangedConvention
    interface IForeignKeyNullNavigationSetConvention
    interface IForeignKeyRemovedConvention
type RelationshipDiscoveryConvention = class
    interface ITypeIgnoredConvention
    interface IConvention
    interface IEntityTypeAddedConvention
    interface IEntityTypeBaseTypeChangedConvention
    interface IEntityTypeMemberIgnoredConvention
    interface INavigationRemovedConvention
    interface INavigationAddedConvention
    interface IForeignKeyOwnershipChangedConvention
    interface IForeignKeyNullNavigationSetConvention
    interface IForeignKeyRemovedConvention
Public Class RelationshipDiscoveryConvention
Implements IEntityTypeAddedConvention, IEntityTypeBaseTypeChangedConvention, IEntityTypeIgnoredConvention, IEntityTypeMemberIgnoredConvention, IForeignKeyOwnershipChangedConvention, INavigationAddedConvention, INavigationRemovedConvention
Public Class RelationshipDiscoveryConvention
Implements IEntityTypeAddedConvention, IEntityTypeBaseTypeChangedConvention, IEntityTypeIgnoredConvention, IEntityTypeMemberIgnoredConvention, IForeignKeyNullNavigationSetConvention, IForeignKeyOwnershipChangedConvention, IForeignKeyRemovedConvention, INavigationAddedConvention, INavigationRemovedConvention
Public Class RelationshipDiscoveryConvention
Implements IEntityTypeAddedConvention, IEntityTypeBaseTypeChangedConvention, IEntityTypeMemberIgnoredConvention, IForeignKeyNullNavigationSetConvention, IForeignKeyOwnershipChangedConvention, IForeignKeyRemovedConvention, INavigationAddedConvention, INavigationRemovedConvention, ITypeIgnoredConvention
继承
RelationshipDiscoveryConvention
派生
实现

注解

有关详细信息和示例,请参阅 模型生成约定

构造函数

RelationshipDiscoveryConvention(ProviderConventionSetBuilderDependencies)

创建 RelationshipDiscoveryConvention 的新实例。

属性

Dependencies

此服务的依赖项。

方法

ProcessEntityTypeAdded(IConventionEntityTypeBuilder, IConventionContext<IConventionEntityTypeBuilder>)

在实体类型添加到模型后调用。

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

在实体类型的基类型更改后调用。

ProcessEntityTypeIgnored(IConventionModelBuilder, String, Type, IConventionContext<String>)

在忽略实体类型后调用。

ProcessEntityTypeMemberIgnored(IConventionEntityTypeBuilder, String, IConventionContext<String>)

在忽略实体类型成员之后调用。

ProcessForeignKeyNullNavigationSet(IConventionForeignKeyBuilder, Boolean, IConventionContext<IConventionNavigation>)

在外键上的导航设置为 null 后调用。

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

在更改外键的所有权值后调用。

ProcessForeignKeyOwnershipChanged(IConventionRelationshipBuilder, IConventionContext<IConventionRelationshipBuilder>)

在更改外键的所有权值后调用。

ProcessForeignKeyRemoved(IConventionEntityTypeBuilder, IConventionForeignKey, IConventionContext<IConventionForeignKey>)

在删除外键后调用。

ProcessNavigationAdded(IConventionNavigationBuilder, IConventionContext<IConventionNavigationBuilder>)

在将导航添加到实体类型后调用。

ProcessNavigationAdded(IConventionRelationshipBuilder, IConventionNavigation, IConventionContext<IConventionNavigation>)

在将导航添加到实体类型后调用。

ProcessNavigationRemoved(IConventionEntityTypeBuilder, IConventionEntityTypeBuilder, String, MemberInfo, IConventionContext<String>)

从实体类型中删除导航后调用。

ProcessTypeIgnored(IConventionModelBuilder, String, Type, IConventionContext<String>)

在忽略实体类型后调用。

ShouldBeOwned(Type, IConventionModel)

返回一个值,该值指示如果给定的实体类型当前不在模型中,则是否应将其添加为拥有实体类型。

TryGetTargetEntityTypeBuilder(IConventionEntityTypeBuilder, Type, MemberInfo, Nullable<Boolean>, Boolean)

查找或尝试为给定导航成员创建实体类型目标。

适用于