語言

OwnedNavigationBuilder<TOwnerEntity,TDependentEntity>.UsePropertyAccessMode 方法

定義

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

public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TOwnerEntity,TDependentEntity> UsePropertyAccessMode(Microsoft.EntityFrameworkCore.PropertyAccessMode propertyAccessMode);
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<TEntity,TDependentEntity> UsePropertyAccessMode(Microsoft.EntityFrameworkCore.PropertyAccessMode propertyAccessMode);
override this.UsePropertyAccessMode : Microsoft.EntityFrameworkCore.PropertyAccessMode -> Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<'OwnerEntity, 'DependentEntity (requires 'OwnerEntity : null and 'DependentEntity : null)>
override this.UsePropertyAccessMode : Microsoft.EntityFrameworkCore.PropertyAccessMode -> Microsoft.EntityFrameworkCore.Metadata.Builders.OwnedNavigationBuilder<'Entity, 'DependentEntity (requires 'Entity : null and 'DependentEntity : null)>
Public Overridable Function UsePropertyAccessMode (propertyAccessMode As PropertyAccessMode) As OwnedNavigationBuilder(Of TOwnerEntity, TDependentEntity)
Public Overridable Function UsePropertyAccessMode (propertyAccessMode As PropertyAccessMode) As OwnedNavigationBuilder(Of TEntity, TDependentEntity)

參數

propertyAccessMode
PropertyAccessMode

PropertyAccessMode用於此實體類型的屬性。

傳回

OwnedNavigationBuilder<TEntity,TDependentEntity>

同一個建構器實例,這樣可以串接多個設定呼叫。

備註

預設情況下,如果依慣例找到或已指定,則在建構新物件時會使用該欄位,通常是從資料庫查詢實體時。 所有其他進出通道皆使用物業。 呼叫此方法會改變該實體類型所有屬性的行為,如列舉中所述 PropertyAccessMode 。

呼叫此方法會覆蓋該實體類型中所有屬性,該類型中任何已設定的存取模式。

適用於