共用方式為


OwnedNavigationBuilder<TOwnerEntity,TDependentEntity>.UsePropertyAccessMode 方法

定義

PropertyAccessMode設定要用於此實體類型之所有屬性的 。

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

參數

propertyAccessMode
PropertyAccessMode

PropertyAccessMode要用於這個實體類型之屬性的 。

傳回

OwnedNavigationBuilder<TEntity,TDependentEntity>

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

備註

根據預設,如果依慣例找到支援欄位或已指定支援欄位,則會在建構新物件時使用,通常是從資料庫查詢實體時。 屬性會用於所有其他存取。 呼叫這個方法將會變更此實體類型之所有屬性的行為,如列舉中所述 PropertyAccessMode

針對此實體類型的所有屬性呼叫此方法,會覆寫模型上設定的任何存取模式。

適用於