语言

NonNullableReferencePropertyConvention 类

定义

一种约定,用于根据需要配置不可为 null 类型的属性。

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.IPropertyElementTypeChangedConvention, 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
public class NonNullableReferencePropertyConvention : Microsoft.EntityFrameworkCore.Metadata.Conventions.NonNullableConventionBase, Microsoft.EntityFrameworkCore.Metadata.Conventions.IPropertyAddedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IPropertyFieldChangedConvention
type NonNullableReferencePropertyConvention = class
    inherit NonNullableConventionBase
    interface IPropertyAddedConvention
    interface IConvention
    interface IPropertyFieldChangedConvention
    interface IPropertyElementTypeChangedConvention
    interface IComplexPropertyAddedConvention
    interface IComplexPropertyFieldChangedConvention
type NonNullableReferencePropertyConvention = class
    inherit NonNullableConventionBase
    interface IPropertyAddedConvention
    interface IConvention
    interface IPropertyFieldChangedConvention
    interface IComplexPropertyAddedConvention
    interface IComplexPropertyFieldChangedConvention
type NonNullableReferencePropertyConvention = class
    inherit NonNullableConventionBase
    interface IPropertyAddedConvention
    interface IConvention
    interface IPropertyFieldChangedConvention
Public Class NonNullableReferencePropertyConvention
Inherits NonNullableConventionBase
Implements IComplexPropertyAddedConvention, IComplexPropertyFieldChangedConvention, IPropertyAddedConvention, IPropertyElementTypeChangedConvention, IPropertyFieldChangedConvention
Public Class NonNullableReferencePropertyConvention
Inherits NonNullableConventionBase
Implements IComplexPropertyAddedConvention, IComplexPropertyFieldChangedConvention, IPropertyAddedConvention, IPropertyFieldChangedConvention
Public Class NonNullableReferencePropertyConvention
Inherits NonNullableConventionBase
Implements IPropertyAddedConvention, IPropertyFieldChangedConvention
继承
NonNullableReferencePropertyConvention
实现

注解

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

构造函数

名称 说明
NonNullableReferencePropertyConvention(ProviderConventionSetBuilderDependencies)

一种约定,用于根据需要配置不可为 null 类型的属性。

属性

名称 说明
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>)

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

ProcessPropertyElementTypeChanged(IConventionPropertyBuilder, IElementType, IElementType, IConventionContext<IElementType>)

在更改属性的元素类型后调用。

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

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

TryGetNullabilityInfo(IConventionModelBuilder, MemberInfo, NullabilityInfo)

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

(继承自 NonNullableConventionBase)

适用于