Class RequiredPropertyAttributeConvention
- Namespace
- Microsoft.EntityFrameworkCore.Metadata.Conventions
- Assembly
- Microsoft.EntityFrameworkCore.dll
A convention that configures properties as required if they have the RequiredAttribute applied.
public class RequiredPropertyAttributeConvention : PropertyAttributeConventionBase<RequiredAttribute>, IPropertyAddedConvention, IPropertyFieldChangedConvention, IComplexPropertyAddedConvention, IComplexPropertyFieldChangedConvention, IConvention
- Inheritance
-
RequiredPropertyAttributeConvention
- Implements
- Inherited Members
Remarks
See Model building conventions for more information and examples.
Constructors
RequiredPropertyAttributeConvention(ProviderConventionSetBuilderDependencies)
Creates a new instance of RequiredPropertyAttributeConvention.
public RequiredPropertyAttributeConvention(ProviderConventionSetBuilderDependencies dependencies)
Parameters
dependencies
ProviderConventionSetBuilderDependenciesParameter object containing dependencies for this convention.
Methods
ProcessPropertyAdded(IConventionComplexPropertyBuilder, RequiredAttribute, MemberInfo, IConventionContext)
protected override void ProcessPropertyAdded(IConventionComplexPropertyBuilder propertyBuilder, RequiredAttribute attribute, MemberInfo clrMember, IConventionContext context)
Parameters
propertyBuilder
IConventionComplexPropertyBuilderattribute
RequiredAttributeclrMember
MemberInfocontext
IConventionContext
ProcessPropertyAdded(IConventionPropertyBuilder, RequiredAttribute, MemberInfo, IConventionContext)
protected override void ProcessPropertyAdded(IConventionPropertyBuilder propertyBuilder, RequiredAttribute attribute, MemberInfo clrMember, IConventionContext context)
Parameters
propertyBuilder
IConventionPropertyBuilderattribute
RequiredAttributeclrMember
MemberInfocontext
IConventionContext