共用方式為


NonNullableReferencePropertyConvention 類別

定義

慣例,會視需要設定不可為 Null 之型別的屬性。

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)

適用於