语言

RequiredNavigationAttributeConvention 类

定义

如果将关系主体端应用于主体实体类型,则会将关系的主体端配置为必需 RequiredAttribute 。

[System.Runtime.CompilerServices.Nullable(new System.Byte[] { 0, 1 })]
public class RequiredNavigationAttributeConvention : Microsoft.EntityFrameworkCore.Metadata.Conventions.NavigationAttributeConventionBase<System.ComponentModel.DataAnnotations.RequiredAttribute>, Microsoft.EntityFrameworkCore.Metadata.Conventions.IForeignKeyPrincipalEndChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.INavigationAddedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.ISkipNavigationAddedConvention
public class RequiredNavigationAttributeConvention : Microsoft.EntityFrameworkCore.Metadata.Conventions.NavigationAttributeConventionBase<System.ComponentModel.DataAnnotations.RequiredAttribute>
public class RequiredNavigationAttributeConvention : Microsoft.EntityFrameworkCore.Metadata.Conventions.NavigationAttributeConventionBase<System.ComponentModel.DataAnnotations.RequiredAttribute>, Microsoft.EntityFrameworkCore.Metadata.Conventions.IForeignKeyPrincipalEndChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.INavigationAddedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.ISkipNavigationAddedConvention
[<System.Runtime.CompilerServices.Nullable(new System.Byte[] { 0, 1 })>]
type RequiredNavigationAttributeConvention = class
    inherit NavigationAttributeConventionBase<RequiredAttribute>
    interface INavigationAddedConvention
    interface IConvention
    interface ISkipNavigationAddedConvention
    interface IForeignKeyPrincipalEndChangedConvention
type RequiredNavigationAttributeConvention = class
    inherit NavigationAttributeConventionBase<RequiredAttribute>
type RequiredNavigationAttributeConvention = class
    inherit NavigationAttributeConventionBase<RequiredAttribute>
    interface INavigationAddedConvention
    interface IConvention
    interface ISkipNavigationAddedConvention
    interface IForeignKeyPrincipalEndChangedConvention
Public Class RequiredNavigationAttributeConvention
Inherits NavigationAttributeConventionBase(Of RequiredAttribute)
Implements IForeignKeyPrincipalEndChangedConvention, INavigationAddedConvention, ISkipNavigationAddedConvention
Public Class RequiredNavigationAttributeConvention
Inherits NavigationAttributeConventionBase(Of RequiredAttribute)
继承
RequiredNavigationAttributeConvention
特性
实现

注解

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

构造函数

名称 说明
RequiredNavigationAttributeConvention(ProviderConventionSetBuilderDependencies)

创建 RequiredNavigationAttributeConvention的新实例。

属性

名称 说明
Dependencies

此服务的依赖项。

(继承自 NavigationAttributeConventionBase<TAttribute>)

方法

名称 说明
ProcessEntityTypeAdded(IConventionEntityTypeBuilder, IConventionContext<IConventionEntityTypeBuilder>)

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

(继承自 NavigationAttributeConventionBase<TAttribute>)
ProcessEntityTypeAdded(IConventionEntityTypeBuilder, MemberInfo, Type, TAttribute, IConventionContext<IConventionEntityTypeBuilder>)

为每个在实体类型添加到模型后具有属性的导航属性调用。

(继承自 NavigationAttributeConventionBase<TAttribute>)
ProcessEntityTypeBaseTypeChanged(IConventionEntityTypeBuilder, IConventionEntityType, IConventionEntityType, IConventionContext<IConventionEntityType>)

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

(继承自 NavigationAttributeConventionBase<TAttribute>)
ProcessEntityTypeBaseTypeChanged(IConventionEntityTypeBuilder, IConventionEntityType, IConventionEntityType, MemberInfo, Type, TAttribute, IConventionContext<IConventionEntityType>)

针对更改实体类型的基类型后具有属性的每个导航属性调用。

(继承自 NavigationAttributeConventionBase<TAttribute>)
ProcessEntityTypeIgnored(IConventionModelBuilder, String, Type, IConventionContext<String>)

在忽略实体类型后调用。

(继承自 NavigationAttributeConventionBase<TAttribute>)
ProcessEntityTypeIgnored(IConventionModelBuilder, Type, MemberInfo, Type, TAttribute, IConventionContext<String>)

对于在忽略实体类型后具有属性的每个导航属性调用。

(继承自 NavigationAttributeConventionBase<TAttribute>)
ProcessEntityTypeMemberIgnored(IConventionEntityTypeBuilder, MemberInfo, Type, TAttribute, IConventionContext<String>)

在忽略具有属性的导航属性之后调用。

(继承自 NavigationAttributeConventionBase<TAttribute>)
ProcessEntityTypeMemberIgnored(IConventionEntityTypeBuilder, String, IConventionContext<String>)

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

(继承自 NavigationAttributeConventionBase<TAttribute>)
ProcessEntityTypeRemoved(IConventionModelBuilder, IConventionEntityType, IConventionContext<IConventionEntityType>)

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

(继承自 NavigationAttributeConventionBase<TAttribute>)
ProcessEntityTypeRemoved(IConventionModelBuilder, IConventionEntityType, MemberInfo, Type, TAttribute, IConventionContext<IConventionEntityType>)

为删除实体类型后具有属性的每个导航属性调用。

(继承自 NavigationAttributeConventionBase<TAttribute>)
ProcessEntityTypeRemoved(IConventionModelBuilder, Type, MemberInfo, Type, TAttribute, IConventionContext<IConventionEntityType>)

为删除实体类型后具有属性的每个导航属性调用。

(继承自 NavigationAttributeConventionBase<TAttribute>)
ProcessForeignKeyPrincipalEndChanged(IConventionForeignKeyBuilder, IConventionContext<IConventionForeignKeyBuilder>)

在外键的主体结束更改后调用。

(继承自 NavigationAttributeConventionBase<TAttribute>)
ProcessForeignKeyPrincipalEndChanged(IConventionForeignKeyBuilder, IEnumerable<RequiredAttribute>, IEnumerable<RequiredAttribute>, IConventionContext<IConventionForeignKeyBuilder>)

在外键的主体结束更改后调用。

ProcessForeignKeyPrincipalEndChanged(IConventionForeignKeyBuilder, IEnumerable<TAttribute>, IEnumerable<TAttribute>, IConventionContext<IConventionForeignKeyBuilder>)

在外键的主体结束更改后调用。

(继承自 NavigationAttributeConventionBase<TAttribute>)
ProcessNavigationAdded(IConventionNavigationBuilder, IConventionContext<IConventionNavigationBuilder>)

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

(继承自 NavigationAttributeConventionBase<TAttribute>)
ProcessNavigationAdded(IConventionNavigationBuilder, RequiredAttribute, IConventionContext<IConventionNavigationBuilder>)

在将具有属性的导航属性添加到实体类型后调用。

ProcessNavigationAdded(IConventionNavigationBuilder, TAttribute, IConventionContext<IConventionNavigationBuilder>)

在将具有属性的导航属性添加到实体类型后调用。

(继承自 NavigationAttributeConventionBase<TAttribute>)
ProcessNavigationAdded(IConventionRelationshipBuilder, IConventionNavigation, IConventionContext<IConventionNavigation>)

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

(继承自 NavigationAttributeConventionBase<TAttribute>)
ProcessNavigationAdded(IConventionRelationshipBuilder, IConventionNavigation, RequiredAttribute, IConventionContext<IConventionNavigation>)

在将具有属性的导航属性添加到实体类型后调用。

ProcessNavigationAdded(IConventionRelationshipBuilder, IConventionNavigation, TAttribute, IConventionContext<IConventionNavigation>)

在将具有属性的导航属性添加到实体类型后调用。

(继承自 NavigationAttributeConventionBase<TAttribute>)
ProcessSkipNavigationAdded(IConventionSkipNavigationBuilder, IConventionContext<IConventionSkipNavigationBuilder>)

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

(继承自 NavigationAttributeConventionBase<TAttribute>)
ProcessSkipNavigationAdded(IConventionSkipNavigationBuilder, RequiredAttribute, IConventionContext<IConventionSkipNavigationBuilder>)

在将具有属性的跳过导航属性添加到实体类型后调用。

ProcessSkipNavigationAdded(IConventionSkipNavigationBuilder, TAttribute, IConventionContext<IConventionSkipNavigationBuilder>)

在将具有属性的跳过导航属性添加到实体类型后调用。

(继承自 NavigationAttributeConventionBase<TAttribute>)
ProcessTypeIgnored(IConventionModelBuilder, String, Type, IConventionContext<String>)

在忽略实体类型后调用。

(继承自 NavigationAttributeConventionBase<TAttribute>)
ProcessTypeIgnored(IConventionModelBuilder, Type, MemberInfo, Type, TAttribute, IConventionContext<String>)

对于在忽略实体类型后具有属性的每个导航属性调用。

(继承自 NavigationAttributeConventionBase<TAttribute>)

适用于