Delen via


MutablePropertyExtensions.SetBeforeSaveBehavior Method

Definition

Gets or sets a value indicating whether this property can be modified before the entity is saved to the database.

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.

public static void SetBeforeSaveBehavior (this Microsoft.EntityFrameworkCore.Metadata.IMutableProperty property, Microsoft.EntityFrameworkCore.Metadata.PropertySaveBehavior? beforeSaveBehavior);
static member SetBeforeSaveBehavior : Microsoft.EntityFrameworkCore.Metadata.IMutableProperty * Nullable<Microsoft.EntityFrameworkCore.Metadata.PropertySaveBehavior> -> unit
<Extension()>
Public Sub SetBeforeSaveBehavior (property As IMutableProperty, beforeSaveBehavior As Nullable(Of PropertySaveBehavior))

Parameters

property
IMutableProperty

The property.

beforeSaveBehavior
Nullable<PropertySaveBehavior>

A value indicating whether this property can be modified before the entity is saved to the database.

Applies to