NonNullableReferencePropertyConvention 类

定义

根据需要配置不可为空类型的属性的约定。

public class NonNullableReferencePropertyConvention : Microsoft.EntityFrameworkCore.Metadata.Conventions.NonNullableConventionBase, Microsoft.EntityFrameworkCore.Metadata.Conventions.IPropertyAddedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IPropertyFieldChangedConvention
public class NonNullableReferencePropertyConvention : Microsoft.EntityFrameworkCore.Metadata.Conventions.NonNullableConventionBase, Microsoft.EntityFrameworkCore.Metadata.Conventions.IComplexPropertyAddedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IComplexPropertyFieldChangedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IPropertyAddedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IPropertyFieldChangedConvention
type NonNullableReferencePropertyConvention = class
    inherit NonNullableConventionBase
    interface IPropertyAddedConvention
    interface IConvention
    interface IPropertyFieldChangedConvention
type NonNullableReferencePropertyConvention = class
    inherit NonNullableConventionBase
    interface IPropertyAddedConvention
    interface IConvention
    interface IPropertyFieldChangedConvention
    interface IComplexPropertyAddedConvention
    interface IComplexPropertyFieldChangedConvention
Public Class NonNullableReferencePropertyConvention
Inherits NonNullableConventionBase
Implements IPropertyAddedConvention, IPropertyFieldChangedConvention
Public Class NonNullableReferencePropertyConvention
Inherits NonNullableConventionBase
Implements IComplexPropertyAddedConvention, IComplexPropertyFieldChangedConvention, IPropertyAddedConvention, IPropertyFieldChangedConvention
继承
NonNullableReferencePropertyConvention
实现

注解

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

构造函数

NonNullableReferencePropertyConvention(ProviderConventionSetBuilderDependencies)

创建 NonNullableReferencePropertyConvention 的新实例。

属性

Dependencies

此服务的依赖项。

(继承自 NonNullableConventionBase)

方法

IsNonNullableReferenceType(IConventionModelBuilder, MemberInfo)

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

(继承自 NonNullableConventionBase)
ProcessComplexPropertyAdded(IConventionComplexPropertyBuilder, IConventionContext<IConventionComplexPropertyBuilder>)

在将复杂属性添加到类似类型的对象之后调用。

ProcessComplexPropertyFieldChanged(IConventionComplexPropertyBuilder, FieldInfo, FieldInfo, IConventionContext<FieldInfo>)

在更改复杂属性的后备字段后调用。

ProcessModelFinalized(IConventionModelBuilder, IConventionContext<IConventionModelBuilder>)

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

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

在最终确定模型时调用。

(继承自 NonNullableConventionBase)
ProcessPropertyAdded(IConventionPropertyBuilder, IConventionContext<IConventionPropertyBuilder>)

在将属性添加到实体类型后调用。

ProcessPropertyFieldChanged(IConventionPropertyBuilder, FieldInfo, FieldInfo, IConventionContext<FieldInfo>)

在属性的后备字段更改后调用。

TryGetNullabilityInfo(IConventionModelBuilder, MemberInfo, NullabilityInfo)

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

(继承自 NonNullableConventionBase)

适用于