Skip to content

Commit

Permalink
Review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
ajcvickers committed Aug 27, 2020
1 parent f1a16f4 commit c474ec2
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public virtual void ProcessModelInitialized(
{
modelBuilder.HasChangeTrackingStrategy(ChangeTrackingStrategy.ChangingAndChangedNotifications);
#pragma warning disable EF1001 // Internal EF Core API usage.
modelBuilder.HasAnnotation(CoreAnnotationNames.SkipChangeTrackingStrategyValidationAnnotation, "true");
modelBuilder.HasAnnotation(CoreAnnotationNames.FullChangeTrackingNotificationsRequiredAnnotation, "true");
#pragma warning restore EF1001 // Internal EF Core API usage.
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/EFCore/Infrastructure/ModelValidator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@ protected virtual void ValidateChangeTrackingStrategy(
{
Check.NotNull(model, nameof(model));

var requireFullNotifications = (string)model[CoreAnnotationNames.SkipChangeTrackingStrategyValidationAnnotation] == "true";
var requireFullNotifications = (string)model[CoreAnnotationNames.FullChangeTrackingNotificationsRequiredAnnotation] == "true";
foreach (var entityType in model.GetEntityTypes())
{
var errorMessage = entityType.AsEntityType().CheckChangeTrackingStrategy(
Expand Down
4 changes: 2 additions & 2 deletions src/EFCore/Metadata/Internal/CoreAnnotationNames.cs
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ public static class CoreAnnotationNames
/// any release. You should only use it directly in your code with extreme caution and knowing that
/// doing so can result in application failures when updating to a new Entity Framework Core release.
/// </summary>
public const string SkipChangeTrackingStrategyValidationAnnotation = "ModelValidator.SkipChangeTrackingStrategyValidation";
public const string FullChangeTrackingNotificationsRequiredAnnotation = "ModelValidator.FullChangeTrackingNotificationsRequired";

/// <summary>
/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to
Expand Down Expand Up @@ -316,7 +316,7 @@ public static class CoreAnnotationNames
DuplicateServiceProperties,
AmbiguousField,
SkipDetectChangesAnnotation,
SkipChangeTrackingStrategyValidationAnnotation
FullChangeTrackingNotificationsRequiredAnnotation
};
}
}
2 changes: 1 addition & 1 deletion src/EFCore/Metadata/Internal/EntityType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3069,7 +3069,7 @@ public virtual void AddData([NotNull] IEnumerable<object> data)
{
if (changeTrackingStrategy != null)
{
var requireFullNotifications = (string)Model[CoreAnnotationNames.SkipChangeTrackingStrategyValidationAnnotation] == "true";
var requireFullNotifications = (string)Model[CoreAnnotationNames.FullChangeTrackingNotificationsRequiredAnnotation] == "true";
var errorMessage = CheckChangeTrackingStrategy(changeTrackingStrategy.Value, requireFullNotifications);
if (errorMessage != null)
{
Expand Down
2 changes: 1 addition & 1 deletion src/EFCore/Properties/CoreStrings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/EFCore/Properties/CoreStrings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@
<value>The foreign key {foreignKey} targeting the key {key} on '{principalType}' cannot be removed from the entity type '{entityType}' because it is defined on the entity type '{otherEntityType}'.</value>
</data>
<data name="FullChangeTrackingRequired" xml:space="preserve">
<value>The entity type '{entityType}' is configured to use the '{changeTrackingStrategy}' change tracking strategy when full change tracking notifications are required. Configure all entity types in the model to use the '{fullStrategy}' or '{fullPlusStrategy}' strategy.</value>
<value>The entity type '{entityType}' is configured to use the '{changeTrackingStrategy}' change tracking strategy when full change tracking notifications are required. Use 'ModelBuilder.HasChangeTrackingStrategy' in 'OnModelCreating' to configure all entity types in the model to use the '{fullStrategy}' or '{fullPlusStrategy}' strategy.</value>
</data>
<data name="FunctionOnClient" xml:space="preserve">
<value>The '{methodName}' method is not supported because the query has switched to client-evaluation. Inspect the log to determine which query expressions are triggering client-evaluation.</value>
Expand Down

0 comments on commit c474ec2

Please sign in to comment.