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

调用此方法将替代此实体类型的所有属性,即在模型上设置的任何访问模式。

适用于