diff --git a/src/EFCore.Design/Properties/DesignStrings.Designer.cs b/src/EFCore.Design/Properties/DesignStrings.Designer.cs
index 33d3bdbf9e1..265ebee84ee 100644
--- a/src/EFCore.Design/Properties/DesignStrings.Designer.cs
+++ b/src/EFCore.Design/Properties/DesignStrings.Designer.cs
@@ -517,14 +517,6 @@ public static string MSBuildWorkspaceFailure(object? kind, object? message)
GetString("MSBuildWorkspaceFailure", nameof(kind), nameof(message)),
kind, message);
- ///
- /// The annotation '{annotationName}' was specified twice with potentially different values. Specifying the same annotation multiple times for different providers is no longer supported. Review the generated Migration to ensure it is correct and, if necessary, edit the Migration to fix any issues.
- ///
- public static string MultipleAnnotationConflict(object? annotationName)
- => string.Format(
- GetString("MultipleAnnotationConflict", nameof(annotationName)),
- annotationName);
-
///
/// More than one DbContext was found. Specify which one to use. Use the '-Context' parameter for PowerShell commands and the '--context' parameter for dotnet commands.
///
diff --git a/src/EFCore.Design/Properties/DesignStrings.resx b/src/EFCore.Design/Properties/DesignStrings.resx
index 3153de94ed4..c3777c2da09 100644
--- a/src/EFCore.Design/Properties/DesignStrings.resx
+++ b/src/EFCore.Design/Properties/DesignStrings.resx
@@ -319,9 +319,6 @@ Change your target project to the migrations project by using the Package Manage
MSBuild Workspace failure: {kind} - {message}
-
- The annotation '{annotationName}' was specified twice with potentially different values. Specifying the same annotation multiple times for different providers is no longer supported. Review the generated Migration to ensure it is correct and, if necessary, edit the Migration to fix any issues.
-
More than one DbContext was found. Specify which one to use. Use the '-Context' parameter for PowerShell commands and the '--context' parameter for dotnet commands.
diff --git a/src/EFCore.Design/Design/Internal/IOperationReporter.cs b/src/EFCore.Relational/Design/Internal/IOperationReporter.cs
similarity index 100%
rename from src/EFCore.Design/Design/Internal/IOperationReporter.cs
rename to src/EFCore.Relational/Design/Internal/IOperationReporter.cs
diff --git a/src/EFCore.Relational/EFCore.Relational.baseline.json b/src/EFCore.Relational/EFCore.Relational.baseline.json
index 78998352236..e37eca0a3a6 100644
--- a/src/EFCore.Relational/EFCore.Relational.baseline.json
+++ b/src/EFCore.Relational/EFCore.Relational.baseline.json
@@ -16710,6 +16710,9 @@
{
"Member": "static string ModificationCommandInvalidEntityStateSensitive(object? entityType, object? keyValues, object? entityState);"
},
+ {
+ "Member": "static string MultipleAnnotationConflict(object? annotationName);"
+ },
{
"Member": "static string MultipleColumnsWithSameJsonContainerName(object? entityType, object? columnName);"
},
diff --git a/src/EFCore.Design/Migrations/Internal/ISnapshotModelProcessor.cs b/src/EFCore.Relational/Migrations/Internal/ISnapshotModelProcessor.cs
similarity index 100%
rename from src/EFCore.Design/Migrations/Internal/ISnapshotModelProcessor.cs
rename to src/EFCore.Relational/Migrations/Internal/ISnapshotModelProcessor.cs
diff --git a/src/EFCore.Design/Migrations/Internal/SnapshotModelProcessor.cs b/src/EFCore.Relational/Migrations/Internal/SnapshotModelProcessor.cs
similarity index 96%
rename from src/EFCore.Design/Migrations/Internal/SnapshotModelProcessor.cs
rename to src/EFCore.Relational/Migrations/Internal/SnapshotModelProcessor.cs
index c46bb2bf93b..9c3e9580263 100644
--- a/src/EFCore.Design/Migrations/Internal/SnapshotModelProcessor.cs
+++ b/src/EFCore.Relational/Migrations/Internal/SnapshotModelProcessor.cs
@@ -2,6 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.
using Microsoft.EntityFrameworkCore.Design.Internal;
+using Microsoft.EntityFrameworkCore.Diagnostics;
using Microsoft.EntityFrameworkCore.Internal;
using Microsoft.EntityFrameworkCore.Metadata.Internal;
@@ -52,8 +53,10 @@ public SnapshotModelProcessor(
public virtual IModel? Process(IReadOnlyModel? model, bool resetVersion = false)
{
if (model == null
+#pragma warning disable EF1001 // Internal EF Core API usage.
|| model is not Model mutableModel
|| mutableModel.IsReadOnly)
+#pragma warning restore EF1001 // Internal EF Core API usage.
{
return null;
}
@@ -85,7 +88,9 @@ public SnapshotModelProcessor(
mutableModel.RemoveAnnotation("ChangeDetector.SkipDetectChanges");
if (resetVersion)
{
+#pragma warning disable EF1001 // Internal EF Core API usage.
mutableModel.SetProductVersion(ProductInfo.GetVersion());
+#pragma warning restore EF1001 // Internal EF Core API usage.
}
return _modelRuntimeInitializer.Initialize((IModel)model, designTime: true, validationLogger: null);
@@ -117,7 +122,7 @@ private void ProcessComplexProperties(IReadOnlyTypeBase typeBase, string version
foreach (var complexProperty in typeBase.GetComplexProperties())
{
ProcessElement(complexProperty, version);
-
+
if (complexProperty is IMutableComplexProperty mutableComplexProperty)
{
UpdateComplexPropertyNullability(mutableComplexProperty, version);
@@ -160,7 +165,7 @@ private void ProcessElement(IReadOnlyAnnotatable? metadata, string version)
else if (!Equals(duplicate.Value, annotation.Value))
{
_operationReporter.WriteWarning(
- DesignStrings.MultipleAnnotationConflict(stripped[1..]));
+ RelationalStrings.MultipleAnnotationConflict(stripped[1..]));
}
}
}
diff --git a/src/EFCore.Relational/Properties/RelationalStrings.Designer.cs b/src/EFCore.Relational/Properties/RelationalStrings.Designer.cs
index 96e6ac2c2dd..9b38da270ab 100644
--- a/src/EFCore.Relational/Properties/RelationalStrings.Designer.cs
+++ b/src/EFCore.Relational/Properties/RelationalStrings.Designer.cs
@@ -1573,6 +1573,14 @@ public static string ModificationCommandInvalidEntityStateSensitive(object? enti
GetString("ModificationCommandInvalidEntityStateSensitive", nameof(entityType), nameof(keyValues), nameof(entityState)),
entityType, keyValues, entityState);
+ ///
+ /// The annotation '{annotationName}' was specified twice with potentially different values. Specifying the same annotation multiple times for different providers is no longer supported. Review the generated Migration to ensure it is correct and, if necessary, edit the Migration to fix any issues.
+ ///
+ public static string MultipleAnnotationConflict(object? annotationName)
+ => string.Format(
+ GetString("MultipleAnnotationConflict", nameof(annotationName)),
+ annotationName);
+
///
/// Entity type '{entityType}' is mapped to multiple columns with name '{columnName}', and one of them is configured as a JSON column. Assign different names to the columns.
///
diff --git a/src/EFCore.Relational/Properties/RelationalStrings.resx b/src/EFCore.Relational/Properties/RelationalStrings.resx
index cd3ad37927f..de4225de935 100644
--- a/src/EFCore.Relational/Properties/RelationalStrings.resx
+++ b/src/EFCore.Relational/Properties/RelationalStrings.resx
@@ -1049,6 +1049,9 @@
Cannot save changes for an entity of type '{entityType}' with primary key values {keyValues} in state '{entityState}'. This may indicate a bug in Entity Framework, file an issue at https://aka.ms/efcorefeedback.
+
+ The annotation '{annotationName}' was specified twice with potentially different values. Specifying the same annotation multiple times for different providers is no longer supported. Review the generated Migration to ensure it is correct and, if necessary, edit the Migration to fix any issues.
+
Entity type '{entityType}' is mapped to multiple columns with name '{columnName}', and one of them is configured as a JSON column. Assign different names to the columns.
diff --git a/src/ef/ef.csproj b/src/ef/ef.csproj
index 4c3d18cda35..c34cfc87c2b 100644
--- a/src/ef/ef.csproj
+++ b/src/ef/ef.csproj
@@ -21,7 +21,7 @@
-
+
diff --git a/test/EFCore.Design.Tests/Migrations/Design/SnapshotModelProcessorTest.cs b/test/EFCore.Design.Tests/Migrations/Design/SnapshotModelProcessorTest.cs
index d892bf13d42..7d1bc8927bc 100644
--- a/test/EFCore.Design.Tests/Migrations/Design/SnapshotModelProcessorTest.cs
+++ b/test/EFCore.Design.Tests/Migrations/Design/SnapshotModelProcessorTest.cs
@@ -89,7 +89,7 @@ public void Warns_for_conflicting_annotations()
var (level, message) = reporter.Messages.Single();
Assert.Equal(LogLevel.Warning, level);
- Assert.Equal(DesignStrings.MultipleAnnotationConflict("DefaultSchema"), message);
+ Assert.Equal(RelationalStrings.MultipleAnnotationConflict("DefaultSchema"), message);
Assert.Equal(2, model.GetAnnotations().Count());
var actual = (string)model["Relational:DefaultSchema"];
@@ -112,7 +112,7 @@ public void Warns_for_conflicting_annotations_one_relational()
var (level, message) = reporter.Messages.Single();
Assert.Equal(LogLevel.Warning, level);
- Assert.Equal(DesignStrings.MultipleAnnotationConflict("DefaultSchema"), message);
+ Assert.Equal(RelationalStrings.MultipleAnnotationConflict("DefaultSchema"), message);
Assert.Equal(2, model.GetAnnotations().Count());
var actual = (string)model["Relational:DefaultSchema"];
diff --git a/test/EFCore.Specification.Tests/EFCore.Specification.Tests.csproj b/test/EFCore.Specification.Tests/EFCore.Specification.Tests.csproj
index f0f6767cc31..c5298d9eede 100644
--- a/test/EFCore.Specification.Tests/EFCore.Specification.Tests.csproj
+++ b/test/EFCore.Specification.Tests/EFCore.Specification.Tests.csproj
@@ -54,6 +54,7 @@
+