語言

IConventionModel.SetPropertyAccessMode 方法

定義

設定 以 PropertyAccessMode 作為該模型中所有實體類型的屬性的使用。

public Microsoft.EntityFrameworkCore.PropertyAccessMode? SetPropertyAccessMode(Microsoft.EntityFrameworkCore.PropertyAccessMode? propertyAccessMode, bool fromDataAnnotation = false);
abstract member SetPropertyAccessMode : Nullable<Microsoft.EntityFrameworkCore.PropertyAccessMode> * bool -> Nullable<Microsoft.EntityFrameworkCore.PropertyAccessMode>
Public Function SetPropertyAccessMode (propertyAccessMode As Nullable(Of PropertyAccessMode), Optional fromDataAnnotation As Boolean = false) As Nullable(Of PropertyAccessMode)

參數

propertyAccessMode
Nullable<PropertyAccessMode>

該 PropertyAccessMode,或 null 以清除模式設定。

fromDataAnnotation
Boolean

表示配置是否以資料註解方式指定。

傳回

設定值。

備註

請注意,個別實體類型可以覆寫此存取模式,而實體類型的個別屬性也能覆蓋該實體類型設定的存取模式。 此處設定的值將用於任何未指定覆寫的屬性。

適用於