Share via


IConventionModel.SetPropertyAccessMode Method

Definition

Sets the PropertyAccessMode to use for properties of all entity types in this model.

public Microsoft.EntityFrameworkCore.PropertyAccessMode? SetPropertyAccessMode (Microsoft.EntityFrameworkCore.PropertyAccessMode? propertyAccessMode, bool fromDataAnnotation = false);
abstract member SetPropertyAccessMode : Nullable<Microsoft.EntityFrameworkCore.PropertyAccessMode> * bool -> Nullable<Microsoft.EntityFrameworkCore.PropertyAccessMode>
Public Function SetPropertyAccessMode (propertyAccessMode As Nullable(Of PropertyAccessMode), Optional fromDataAnnotation As Boolean = false) As Nullable(Of PropertyAccessMode)

Parameters

propertyAccessMode
Nullable<PropertyAccessMode>

The PropertyAccessMode, or null to clear the mode set.

fromDataAnnotation
Boolean

Indicates whether the configuration was specified using a data annotation.

Returns

The configured value.

Remarks

Note that individual entity types can override this access mode, and individual properties of entity types can override the access mode set on the entity type. The value set here will be used for any property for which no override has been specified.

Applies to