Прочетете на английски

Споделяне чрез


NonNullableReferencePropertyConvention Class

Definition

A convention that configures the properties of non-nullable types as required.

C#
public class NonNullableReferencePropertyConvention : Microsoft.EntityFrameworkCore.Metadata.Conventions.NonNullableConventionBase, Microsoft.EntityFrameworkCore.Metadata.Conventions.IPropertyAddedConvention, Microsoft.EntityFrameworkCore.Metadata.Conventions.IPropertyFieldChangedConvention
C#
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
C#
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
Inheritance
NonNullableReferencePropertyConvention
Implements

Remarks

See Model building conventions for more information and examples.

Constructors

Properties

Dependencies

Dependencies for this service.

(Inherited from NonNullableConventionBase)

Methods

IsNonNullableReferenceType(IConventionModelBuilder, MemberInfo)

Returns a value indicating whether the member type is a non-nullable reference type.

(Inherited from NonNullableConventionBase)
ProcessComplexPropertyAdded(IConventionComplexPropertyBuilder, IConventionContext<IConventionComplexPropertyBuilder>)

Called after a complex property is added to a type-like object.

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

Called after the backing field for a complex property is changed.

ProcessModelFinalized(IConventionModelBuilder, IConventionContext<IConventionModelBuilder>)

Called after a model is finalized. Removes the cached state annotation used by this convention.

(Inherited from NonNullableConventionBase)
ProcessModelFinalizing(IConventionModelBuilder, IConventionContext<IConventionModelBuilder>)

Called when a model is being finalized.

(Inherited from NonNullableConventionBase)
ProcessPropertyAdded(IConventionPropertyBuilder, IConventionContext<IConventionPropertyBuilder>)

Called after a property is added to the entity type.

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

Called after the element type for a property is changed.

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

Called after the backing field for a property is changed.

TryGetNullabilityInfo(IConventionModelBuilder, MemberInfo, NullabilityInfo)

Returns a value indicating whether the member type is a non-nullable reference type.

(Inherited from NonNullableConventionBase)

Applies to

Продукт Версии
Entity Framework Core 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0