Delen via


OwnedNavigationBuilder<TOwnerEntity,TDependentEntity>.UsePropertyAccessMode Method

Definition

Sets the PropertyAccessMode to use for all properties of this entity type.

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)

Parameters

propertyAccessMode
PropertyAccessMode

The PropertyAccessMode to use for properties of this entity type.

Returns

OwnedNavigationBuilder<TEntity,TDependentEntity>

The same builder instance so that multiple configuration calls can be chained.

Remarks

By default, the backing field, if one is found by convention or has been specified, is used when new objects are constructed, typically when entities are queried from the database. Properties are used for all other accesses. Calling this method will change that behavior for all properties of this entity type as described in the PropertyAccessMode enum.

Calling this method overrides for all properties of this entity type any access mode that was set on the model.

Applies to