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