Share via


PropertyBuilder<TProperty>.UsePropertyAccessMode Method

Definition

Overloads

UsePropertyAccessMode(PropertyAccessMode)

Sets the PropertyAccessMode to use for this property.

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 witll change that behavior for this property as described in the PropertyAccessMode enum.

Calling this method overrrides for this property any access mode that was set on the entity type or model.

UsePropertyAccessMode(PropertyAccessMode)

Sets the PropertyAccessMode to use for this property.

UsePropertyAccessMode(PropertyAccessMode)

Sets the PropertyAccessMode to use for this property.

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 witll change that behavior for this property as described in the PropertyAccessMode enum.

Calling this method overrrides for this property any access mode that was set on the entity type or model.

public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder<TProperty> UsePropertyAccessMode (Microsoft.EntityFrameworkCore.Metadata.PropertyAccessMode propertyAccessMode);
override this.UsePropertyAccessMode : Microsoft.EntityFrameworkCore.Metadata.PropertyAccessMode -> Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder<'Property>
Public Overridable Function UsePropertyAccessMode (propertyAccessMode As PropertyAccessMode) As PropertyBuilder(Of TProperty)

Parameters

propertyAccessMode
PropertyAccessMode

The PropertyAccessMode to use for this property.

Returns

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

Applies to

UsePropertyAccessMode(PropertyAccessMode)

Source:
PropertyBuilder%60.cs
Source:
PropertyBuilder%60.cs
Source:
PropertyBuilder%60.cs
Source:
PropertyBuilder%60.cs
Source:
PropertyBuilder%60.cs
Source:
PropertyBuilder%60.cs
Source:
PropertyBuilder%60.cs
Source:
PropertyBuilder%60.cs
Source:
PropertyBuilder%60.cs

Sets the PropertyAccessMode to use for this property.

public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder<TProperty> UsePropertyAccessMode (Microsoft.EntityFrameworkCore.PropertyAccessMode propertyAccessMode);
override this.UsePropertyAccessMode : Microsoft.EntityFrameworkCore.PropertyAccessMode -> Microsoft.EntityFrameworkCore.Metadata.Builders.PropertyBuilder<'Property>
Public Overridable Function UsePropertyAccessMode (propertyAccessMode As PropertyAccessMode) As PropertyBuilder(Of TProperty)

Parameters

propertyAccessMode
PropertyAccessMode

The PropertyAccessMode to use for this property.

Returns

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 this property as described in the PropertyAccessMode enum.

Calling this method overrides for this property any access mode that was set on the entity type or model.

Applies to