IConventionPropertyBase.SetFieldInfo(FieldInfo, Boolean) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Sets the FieldInfo for the underlying CLR field that this property should use.
public System.Reflection.FieldInfo SetFieldInfo (System.Reflection.FieldInfo fieldInfo, bool fromDataAnnotation = false);
public System.Reflection.FieldInfo? SetFieldInfo (System.Reflection.FieldInfo? fieldInfo, bool fromDataAnnotation = false);
abstract member SetFieldInfo : System.Reflection.FieldInfo * bool -> System.Reflection.FieldInfo
Public Function SetFieldInfo (fieldInfo As FieldInfo, Optional fromDataAnnotation As Boolean = false) As FieldInfo
Parameters
- fromDataAnnotation
- Boolean
Indicates whether the configuration was specified using a data annotation.
Returns
The new FieldInfo.
Remarks
By default, the backing field, if one is found 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. This can be changed by calling SetPropertyAccessMode(Nullable<PropertyAccessMode>, Boolean).
Applies to
Entity Framework