Table of Contents

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 ProviderConventionSetBuilderDependencies

Parameter 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 IConventionComplexPropertyBuilder
attribute MaxLengthAttribute
clrMember MemberInfo
context IConventionContext

ProcessPropertyAdded(IConventionPropertyBuilder, MaxLengthAttribute, MemberInfo, IConventionContext)

protected override void ProcessPropertyAdded(IConventionPropertyBuilder propertyBuilder, MaxLengthAttribute attribute, MemberInfo clrMember, IConventionContext context)

Parameters

propertyBuilder IConventionPropertyBuilder
attribute MaxLengthAttribute
clrMember MemberInfo
context IConventionContext