ConventionModelExtensions.SetChangeTrackingStrategy 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 default change tracking strategy to use for entities in the model. This strategy indicates how the context detects changes to properties for an instance of an entity type.
public static void SetChangeTrackingStrategy (this Microsoft.EntityFrameworkCore.Metadata.IConventionModel model, Microsoft.EntityFrameworkCore.ChangeTrackingStrategy? changeTrackingStrategy, bool fromDataAnnotation = false);
public static Microsoft.EntityFrameworkCore.ChangeTrackingStrategy? SetChangeTrackingStrategy (this Microsoft.EntityFrameworkCore.Metadata.IConventionModel model, Microsoft.EntityFrameworkCore.ChangeTrackingStrategy? changeTrackingStrategy, bool fromDataAnnotation = false);
static member SetChangeTrackingStrategy : Microsoft.EntityFrameworkCore.Metadata.IConventionModel * Nullable<Microsoft.EntityFrameworkCore.ChangeTrackingStrategy> * bool -> unit
static member SetChangeTrackingStrategy : Microsoft.EntityFrameworkCore.Metadata.IConventionModel * Nullable<Microsoft.EntityFrameworkCore.ChangeTrackingStrategy> * bool -> Nullable<Microsoft.EntityFrameworkCore.ChangeTrackingStrategy>
<Extension()>
Public Sub SetChangeTrackingStrategy (model As IConventionModel, changeTrackingStrategy As Nullable(Of ChangeTrackingStrategy), Optional fromDataAnnotation As Boolean = false)
<Extension()>
Public Function SetChangeTrackingStrategy (model As IConventionModel, changeTrackingStrategy As Nullable(Of ChangeTrackingStrategy), Optional fromDataAnnotation As Boolean = false) As Nullable(Of ChangeTrackingStrategy)
Parameters
- model
- IConventionModel
The model to set the default change tracking strategy for.
- changeTrackingStrategy
- Nullable<ChangeTrackingStrategy>
The strategy to use.
- fromDataAnnotation
- Boolean
Indicates whether the configuration was specified using a data annotation.
Returns
The configured value.
Applies to
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.
Entity Framework