PropertyBuilder.HasMaxLength(Int32) 方法

定義

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

public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder HasMaxLength (int maxLength);
abstract member HasMaxLength : int -> Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder
override this.HasMaxLength : int -> Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder
Public Overridable Function HasMaxLength (maxLength As Integer) As PropertyBuilder

參數

maxLength
Int32

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

傳回

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

適用於