/// <summary> /// Sets the change tracking strategy to use for this entity type. This strategy indicates how the /// context detects changes to properties for an instance of the entity type. /// </summary> /// <param name="entityType"> The entity type to set the change tracking strategy for. </param> /// <param name="changeTrackingStrategy"> The strategy to use. </param> /// <param name="fromDataAnnotation"> Indicates whether the configuration was specified using a data annotation. </param> public static void SetChangeTrackingStrategy( [NotNull] this IConventionEntityType entityType, ChangeTrackingStrategy changeTrackingStrategy, bool fromDataAnnotation = false) { Check.NotNull(entityType, nameof(entityType)); var errorMessage = entityType.CheckChangeTrackingStrategy(changeTrackingStrategy); if (errorMessage != null) { throw new InvalidOperationException(errorMessage); } entityType.SetAnnotation(CoreAnnotationNames.ChangeTrackingStrategy, changeTrackingStrategy, fromDataAnnotation); }