ComplexTypePropertyBuilder<TProperty>.HasMaxLength(Int32) 方法

定义

配置可在此属性中存储的最大数据长度。 只能在数组属性上设置最大长度 (包括 String 属性) 。

public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePropertyBuilder<TProperty> HasMaxLength (int maxLength);
override this.HasMaxLength : int -> Microsoft.EntityFrameworkCore.Metadata.Builders.ComplexTypePropertyBuilder<'Property>
Public Overridable Function HasMaxLength (maxLength As Integer) As ComplexTypePropertyBuilder(Of TProperty)

参数

maxLength
Int32

属性中允许的最大数据长度。 值 指示 -1 属性没有最大长度。

返回

同一个生成器实例,以便可以链接多个配置调用。

适用于