Table of Contents

Class StringLengthAttributeConvention

Namespace
Microsoft.EntityFrameworkCore.Metadata.Conventions
Assembly
Microsoft.EntityFrameworkCore.dll

A convention that configures the maximum length based on the StringLengthAttribute applied on the property.

public class StringLengthAttributeConvention : PropertyAttributeConventionBase<StringLengthAttribute>, IPropertyAddedConvention, IPropertyFieldChangedConvention, IConvention
Inheritance
StringLengthAttributeConvention
Implements
Inherited Members

Remarks

See Model building conventions for more information and examples.

Constructors

StringLengthAttributeConvention(ProviderConventionSetBuilderDependencies)

Creates a new instance of StringLengthAttributeConvention.

public StringLengthAttributeConvention(ProviderConventionSetBuilderDependencies dependencies)

Parameters

dependencies ProviderConventionSetBuilderDependencies

Parameter object containing dependencies for this convention.

Methods

ProcessPropertyAdded(IConventionPropertyBuilder, StringLengthAttribute, MemberInfo, IConventionContext)

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

Parameters

propertyBuilder IConventionPropertyBuilder
attribute StringLengthAttribute
clrMember MemberInfo
context IConventionContext