语言

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 。

调用此方法将覆盖此实体类型的所有属性,这些属性是针对模型上设置的任何访问模式。

适用于