TypeMappingConfigurationBuilder<TProperty>.HasMaxLength(Int32) 方法

定義

設定可以儲存在此屬性中的資料長度上限。 最大長度只能在陣列屬性上設定, (包括 String 屬性) 。

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

參數

maxLength
Int32

屬性中允許的資料長度上限。 的值 -1 表示 屬性沒有最大長度。

傳回

相同的產生器實例,以便鏈結多個組態呼叫。

適用於