IConventionProperty.SetBeforeSaveBehavior 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 a value indicating whether this property can be modified before the entity is saved to the database.
public Microsoft.EntityFrameworkCore.Metadata.PropertySaveBehavior? SetBeforeSaveBehavior (Microsoft.EntityFrameworkCore.Metadata.PropertySaveBehavior? beforeSaveBehavior, bool fromDataAnnotation = false);
abstract member SetBeforeSaveBehavior : Nullable<Microsoft.EntityFrameworkCore.Metadata.PropertySaveBehavior> * bool -> Nullable<Microsoft.EntityFrameworkCore.Metadata.PropertySaveBehavior>
Public Function SetBeforeSaveBehavior (beforeSaveBehavior As Nullable(Of PropertySaveBehavior), Optional fromDataAnnotation As Boolean = false) As Nullable(Of PropertySaveBehavior)
Parameters
- beforeSaveBehavior
- Nullable<PropertySaveBehavior>
A value indicating whether this property can be modified before the entity is
saved to the database. null
to reset to default.
- fromDataAnnotation
- Boolean
Indicates whether the configuration was specified using a data annotation.
Returns
The configured value.
Remarks
If Throw, then an exception will be thrown if a value is assigned to this property when it is in the Added state.
If Ignore, then any value set will be ignored when it is in the Added state.
Applies to
Entity Framework