MaxLengthAttributeConvention 类

定义

一种约定,该约定基于 MaxLengthAttribute 对 属性应用的 配置最大长度。

public class MaxLengthAttributeConvention : Microsoft.EntityFrameworkCore.Metadata.Conventions.PropertyAttributeConventionBase<System.ComponentModel.DataAnnotations.MaxLengthAttribute>
public class MaxLengthAttributeConvention : Microsoft.EntityFrameworkCore.Metadata.Conventions.PropertyAttributeConventionBase<System.ComponentModel.DataAnnotations.MaxLengthAttribute>, Microsoft.EntityFrameworkCore.Metadata.Conventions.IComplexPropertyAddedConvention
type MaxLengthAttributeConvention = class
    inherit PropertyAttributeConventionBase<MaxLengthAttribute>
type MaxLengthAttributeConvention = class
    inherit PropertyAttributeConventionBase<MaxLengthAttribute>
    interface IComplexPropertyAddedConvention
    interface IConvention
Public Class MaxLengthAttributeConvention
Inherits PropertyAttributeConventionBase(Of MaxLengthAttribute)
Public Class MaxLengthAttributeConvention
Inherits PropertyAttributeConventionBase(Of MaxLengthAttribute)
Implements IComplexPropertyAddedConvention
继承
实现

注解

有关详细信息和示例,请参阅 模型生成约定

构造函数

MaxLengthAttributeConvention(ProviderConventionSetBuilderDependencies)

创建 MaxLengthAttributeConvention 的新实例。

属性

Dependencies

此服务的依赖项。

(继承自 PropertyAttributeConventionBase<TAttribute>)

方法

ProcessComplexPropertyAdded(IConventionComplexPropertyBuilder, IConventionContext<IConventionComplexPropertyBuilder>)

在将复杂属性添加到类似类型的对象后调用。

(继承自 PropertyAttributeConventionBase<TAttribute>)
ProcessComplexPropertyFieldChanged(IConventionComplexPropertyBuilder, FieldInfo, FieldInfo, IConventionContext<FieldInfo>)

在更改复杂属性的后备字段后调用。

(继承自 PropertyAttributeConventionBase<TAttribute>)
ProcessPropertyAdded(IConventionComplexPropertyBuilder, MaxLengthAttribute, MemberInfo, IConventionContext)

一种约定,该约定基于 MaxLengthAttribute 对 属性应用的 配置最大长度。

ProcessPropertyAdded(IConventionComplexPropertyBuilder, TAttribute, MemberInfo, IConventionContext)

在将复杂属性添加到具有关联 CLR 属性或字段特性的类型后调用。

(继承自 PropertyAttributeConventionBase<TAttribute>)
ProcessPropertyAdded(IConventionPropertyBuilder, IConventionContext<IConventionPropertyBuilder>)

在将属性添加到实体类型后调用。

(继承自 PropertyAttributeConventionBase<TAttribute>)
ProcessPropertyAdded(IConventionPropertyBuilder, MaxLengthAttribute, MemberInfo, IConventionContext)

在将属性添加到具有关联 CLR 属性或字段特性的实体类型后调用。

ProcessPropertyAdded(IConventionPropertyBuilder, TAttribute, MemberInfo, IConventionContext)

在将属性添加到具有关联 CLR 属性或字段特性的实体类型后调用。

(继承自 PropertyAttributeConventionBase<TAttribute>)
ProcessPropertyFieldChanged(IConventionPropertyBuilder, FieldInfo, FieldInfo, IConventionContext<FieldInfo>)

更改属性的后备字段后调用。

(继承自 PropertyAttributeConventionBase<TAttribute>)

适用于