语言

NonNullableNavigationConvention 类

定义

一种约定,用于根据需要将不可为 null 的导航配置为主体实体类型。

public class NonNullableNavigationConvention : Microsoft.EntityFrameworkCore.Metadata.Conventions.NonNullableConventionBase, Microsoft.EntityFrameworkCore.Metadata.Conventions.IForeignKeyPrincipalEndChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.INavigationAddedConvention
public class NonNullableNavigationConvention : Microsoft.EntityFrameworkCore.Metadata.Conventions.NonNullableConventionBase, Microsoft.EntityFrameworkCore.Metadata.Conventions.INavigationAddedConvention
type NonNullableNavigationConvention = class
    inherit NonNullableConventionBase
    interface INavigationAddedConvention
    interface IConvention
    interface IForeignKeyPrincipalEndChangedConvention
type NonNullableNavigationConvention = class
    inherit NonNullableConventionBase
    interface INavigationAddedConvention
    interface IConvention
Public Class NonNullableNavigationConvention
Inherits NonNullableConventionBase
Implements IForeignKeyPrincipalEndChangedConvention, INavigationAddedConvention
Public Class NonNullableNavigationConvention
Inherits NonNullableConventionBase
Implements INavigationAddedConvention
继承
NonNullableNavigationConvention
实现

注解

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

构造函数

名称 说明
NonNullableNavigationConvention(ProviderConventionSetBuilderDependencies)

一种约定,用于根据需要将不可为 null 的导航配置为主体实体类型。

属性

名称 说明
Dependencies

此服务的依赖项。

(继承自 NonNullableConventionBase)

方法

名称 说明
IsNonNullableReferenceType(IConventionModelBuilder, MemberInfo)

返回一个值,该值指示成员类型是否为不可为 null 的引用类型。

(继承自 NonNullableConventionBase)
ProcessForeignKeyPrincipalEndChanged(IConventionForeignKeyBuilder, IConventionContext<IConventionForeignKeyBuilder>)

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

ProcessModelFinalized(IConventionModelBuilder, IConventionContext<IConventionModelBuilder>)

在完成模型后调用。 删除此约定使用的缓存状态批注。

(继承自 NonNullableConventionBase)
ProcessModelFinalizing(IConventionModelBuilder, IConventionContext<IConventionModelBuilder>)

在完成模型时调用。

(继承自 NonNullableConventionBase)
ProcessNavigationAdded(IConventionNavigationBuilder, IConventionContext<IConventionNavigationBuilder>)

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

ProcessNavigationAdded(IConventionRelationshipBuilder, IConventionNavigation, IConventionContext<IConventionNavigation>)

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

TryGetNullabilityInfo(IConventionModelBuilder, MemberInfo, NullabilityInfo)

返回一个值,该值指示成员类型是否为不可为 null 的引用类型。

(继承自 NonNullableConventionBase)

适用于