diff --git a/test/EFCore.Cosmos.FunctionalTests/Scaffolding/CompiledModelCosmosTest.cs b/test/EFCore.Cosmos.FunctionalTests/Scaffolding/CompiledModelCosmosTest.cs index 72d63b646a8..3ed4080a3bb 100644 --- a/test/EFCore.Cosmos.FunctionalTests/Scaffolding/CompiledModelCosmosTest.cs +++ b/test/EFCore.Cosmos.FunctionalTests/Scaffolding/CompiledModelCosmosTest.cs @@ -146,13 +146,13 @@ public virtual Task Basic_cosmos_model() Assert.Equal(new[] { id, partitionId, blob, storeId, jObject, eTag }, dataEntity.GetProperties()); }); - // Primitive collections not supported yet + [ConditionalFact(Skip = "Primitive collections not supported yet")] public override Task BigModel() - => Task.CompletedTask; + => base.BigModel(); - // Primitive collections not supported yet + [ConditionalFact(Skip = "Primitive collections not supported yet")] public override Task ComplexTypes() - => Task.CompletedTask; + => base.ComplexTypes(); protected override TestHelpers TestHelpers => CosmosTestHelpers.Instance; protected override ITestStoreFactory TestStoreFactory => CosmosTestStoreFactory.Instance; diff --git a/test/EFCore.InMemory.FunctionalTests/Scaffolding/CompiledModelInMemoryTest.cs b/test/EFCore.InMemory.FunctionalTests/Scaffolding/CompiledModelInMemoryTest.cs index 58af999098a..9a93d99f988 100644 --- a/test/EFCore.InMemory.FunctionalTests/Scaffolding/CompiledModelInMemoryTest.cs +++ b/test/EFCore.InMemory.FunctionalTests/Scaffolding/CompiledModelInMemoryTest.cs @@ -494,9 +494,9 @@ protected virtual void AssertCyclesModel(IModel model) TestHelpers.ModelAsserter.AssertEqual(principalBaseFk.PrincipalKey.Properties, dependentFk.Properties); } - // Primitive collections not supported completely + [ConditionalFact(Skip = "Primitive collections not supported completely")] public override Task BigModel() - => Task.CompletedTask; + => base.BigModel(); public class Scaffolding { diff --git a/test/EFCore.Specification.Tests/Scaffolding/CompiledModelTestBase.cs b/test/EFCore.Specification.Tests/Scaffolding/CompiledModelTestBase.cs index 4607bdbad93..f008e6c6a53 100644 --- a/test/EFCore.Specification.Tests/Scaffolding/CompiledModelTestBase.cs +++ b/test/EFCore.Specification.Tests/Scaffolding/CompiledModelTestBase.cs @@ -1465,7 +1465,8 @@ private IModel CompileModel( { var build = new BuildSource { - Sources = scaffoldedFiles.ToDictionary(f => f.Path, f => f.Code), NullableReferenceTypes = options.UseNullableReferenceTypes + Sources = scaffoldedFiles.ToDictionary(f => f.Path, f => f.Code), + NullableReferenceTypes = options.UseNullableReferenceTypes }; AddReferences(build); @@ -1491,42 +1492,50 @@ private void AssertBaseline( string testName) { var testDirectory = Path.GetDirectoryName(_filePath); - if (string.IsNullOrEmpty(testDirectory) - || !Directory.Exists(testDirectory)) + if (string.IsNullOrEmpty(testDirectory)) { - return; + return; // cannot look for the baseline } - var baselinesDirectory = Path.Combine(testDirectory, "Baselines", testName); - try + var prefix = Path.DirectorySeparatorChar + "_" + Path.DirectorySeparatorChar; + if (testDirectory.StartsWith(prefix)) { - Directory.CreateDirectory(baselinesDirectory); + // assumes a current directory like /path/to/efcore/artifacts/bin/EFCore.Sqlite.FunctionalTests/Release/net9.0 + // so that a path mangled by DeterministicSourcePaths such as /_/test/EFCore.Sqlite.FunctionalTests/Scaffolding becomes + // /path/to/efcore/test/EFCore.Sqlite.FunctionalTests/Scaffolding + testDirectory = string.Join(Path.DirectorySeparatorChar, Enumerable.Repeat("..", 5)) + testDirectory[2..]; } - catch + if (!Directory.Exists(testDirectory)) { - return; + throw new Exception($"Test directory '{testDirectory}' not found from '{Directory.GetCurrentDirectory()}'"); } + var baselinesDirectory = Path.Combine(testDirectory, "Baselines", testName); + Directory.CreateDirectory(baselinesDirectory); + var shouldRewrite = Environment.GetEnvironmentVariable("EF_TEST_REWRITE_BASELINES")?.ToUpper() is "1" or "TRUE"; + List exceptions = []; foreach (var file in scaffoldedFiles) { var fullFilePath = Path.Combine(baselinesDirectory, file.Path); - if (!File.Exists(fullFilePath) - || shouldRewrite) + try { - File.WriteAllText(fullFilePath, file.Code); + Assert.Equal(File.ReadAllText(fullFilePath), file.Code, ignoreLineEndingDifferences: true); } - else + catch (Exception ex) { - try - { - Assert.Equal(File.ReadAllText(fullFilePath), file.Code, ignoreLineEndingDifferences: true); - } - catch (Exception ex) + if (shouldRewrite) { - throw new Exception($"Difference found in {file.Path}", ex); + File.WriteAllText(fullFilePath, file.Code); } + + exceptions.Add(new Exception($"Difference found in {file.Path}", ex)); } } + + if (exceptions.Count > 0) + { + throw new AggregateException($"Differences found in {exceptions.Count} files", exceptions); + } } } diff --git a/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/BigModel/ManyTypesEntityType.cs b/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/BigModel/ManyTypesEntityType.cs index 2d40767a42b..0b1bdc09403 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/BigModel/ManyTypesEntityType.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/BigModel/ManyTypesEntityType.cs @@ -14933,11 +14933,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas storeGenerationIndex: -1); nullableUri.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( - (Uri v1, Uri v2) => v1 == v2, + (Uri v1, Uri v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), (Uri v) => ((object)v).GetHashCode(), (Uri v) => v), keyComparer: new ValueComparer( - (Uri v1, Uri v2) => v1 == v2, + (Uri v1, Uri v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), (Uri v) => ((object)v).GetHashCode(), (Uri v) => v), providerValueComparer: new ValueComparer( @@ -14988,11 +14988,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas storeGenerationIndex: -1); nullableUriArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer(new ValueComparer( - (Uri v1, Uri v2) => v1 == v2, + (Uri v1, Uri v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), (Uri v) => ((object)v).GetHashCode(), (Uri v) => v)), keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( - (Uri v1, Uri v2) => v1 == v2, + (Uri v1, Uri v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), (Uri v) => ((object)v).GetHashCode(), (Uri v) => v)), providerValueComparer: new ValueComparer( @@ -15018,11 +15018,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (string v) => new Uri(v, UriKind.RelativeOrAbsolute)))), elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( - (Uri v1, Uri v2) => v1 == v2, + (Uri v1, Uri v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), (Uri v) => ((object)v).GetHashCode(), (Uri v) => v), keyComparer: new ValueComparer( - (Uri v1, Uri v2) => v1 == v2, + (Uri v1, Uri v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), (Uri v) => ((object)v).GetHashCode(), (Uri v) => v), providerValueComparer: new ValueComparer( @@ -17259,11 +17259,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas storeGenerationIndex: -1); uri.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( - (Uri v1, Uri v2) => v1 == v2, + (Uri v1, Uri v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), (Uri v) => ((object)v).GetHashCode(), (Uri v) => v), keyComparer: new ValueComparer( - (Uri v1, Uri v2) => v1 == v2, + (Uri v1, Uri v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), (Uri v) => ((object)v).GetHashCode(), (Uri v) => v), providerValueComparer: new ValueComparer( @@ -17314,11 +17314,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas storeGenerationIndex: -1); uriArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer(new ValueComparer( - (Uri v1, Uri v2) => v1 == v2, + (Uri v1, Uri v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), (Uri v) => ((object)v).GetHashCode(), (Uri v) => v)), keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( - (Uri v1, Uri v2) => v1 == v2, + (Uri v1, Uri v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), (Uri v) => ((object)v).GetHashCode(), (Uri v) => v)), providerValueComparer: new ValueComparer( @@ -17344,11 +17344,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (string v) => new Uri(v, UriKind.RelativeOrAbsolute)))), elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( - (Uri v1, Uri v2) => v1 == v2, + (Uri v1, Uri v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), (Uri v) => ((object)v).GetHashCode(), (Uri v) => v), keyComparer: new ValueComparer( - (Uri v1, Uri v2) => v1 == v2, + (Uri v1, Uri v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), (Uri v) => ((object)v).GetHashCode(), (Uri v) => v), providerValueComparer: new ValueComparer( @@ -17400,11 +17400,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas storeGenerationIndex: -1); uriToStringConverterProperty.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( - (Uri v1, Uri v2) => v1 == v2, + (Uri v1, Uri v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), (Uri v) => ((object)v).GetHashCode(), (Uri v) => v), keyComparer: new ValueComparer( - (Uri v1, Uri v2) => v1 == v2, + (Uri v1, Uri v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), (Uri v) => ((object)v).GetHashCode(), (Uri v) => v), providerValueComparer: new ValueComparer( diff --git a/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/BigModel_with_JSON_columns/ManyTypesEntityType.cs b/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/BigModel_with_JSON_columns/ManyTypesEntityType.cs index 2d40767a42b..0b1bdc09403 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/BigModel_with_JSON_columns/ManyTypesEntityType.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/BigModel_with_JSON_columns/ManyTypesEntityType.cs @@ -14933,11 +14933,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas storeGenerationIndex: -1); nullableUri.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( - (Uri v1, Uri v2) => v1 == v2, + (Uri v1, Uri v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), (Uri v) => ((object)v).GetHashCode(), (Uri v) => v), keyComparer: new ValueComparer( - (Uri v1, Uri v2) => v1 == v2, + (Uri v1, Uri v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), (Uri v) => ((object)v).GetHashCode(), (Uri v) => v), providerValueComparer: new ValueComparer( @@ -14988,11 +14988,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas storeGenerationIndex: -1); nullableUriArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer(new ValueComparer( - (Uri v1, Uri v2) => v1 == v2, + (Uri v1, Uri v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), (Uri v) => ((object)v).GetHashCode(), (Uri v) => v)), keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( - (Uri v1, Uri v2) => v1 == v2, + (Uri v1, Uri v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), (Uri v) => ((object)v).GetHashCode(), (Uri v) => v)), providerValueComparer: new ValueComparer( @@ -15018,11 +15018,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (string v) => new Uri(v, UriKind.RelativeOrAbsolute)))), elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( - (Uri v1, Uri v2) => v1 == v2, + (Uri v1, Uri v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), (Uri v) => ((object)v).GetHashCode(), (Uri v) => v), keyComparer: new ValueComparer( - (Uri v1, Uri v2) => v1 == v2, + (Uri v1, Uri v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), (Uri v) => ((object)v).GetHashCode(), (Uri v) => v), providerValueComparer: new ValueComparer( @@ -17259,11 +17259,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas storeGenerationIndex: -1); uri.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( - (Uri v1, Uri v2) => v1 == v2, + (Uri v1, Uri v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), (Uri v) => ((object)v).GetHashCode(), (Uri v) => v), keyComparer: new ValueComparer( - (Uri v1, Uri v2) => v1 == v2, + (Uri v1, Uri v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), (Uri v) => ((object)v).GetHashCode(), (Uri v) => v), providerValueComparer: new ValueComparer( @@ -17314,11 +17314,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas storeGenerationIndex: -1); uriArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer(new ValueComparer( - (Uri v1, Uri v2) => v1 == v2, + (Uri v1, Uri v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), (Uri v) => ((object)v).GetHashCode(), (Uri v) => v)), keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( - (Uri v1, Uri v2) => v1 == v2, + (Uri v1, Uri v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), (Uri v) => ((object)v).GetHashCode(), (Uri v) => v)), providerValueComparer: new ValueComparer( @@ -17344,11 +17344,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (string v) => new Uri(v, UriKind.RelativeOrAbsolute)))), elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( - (Uri v1, Uri v2) => v1 == v2, + (Uri v1, Uri v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), (Uri v) => ((object)v).GetHashCode(), (Uri v) => v), keyComparer: new ValueComparer( - (Uri v1, Uri v2) => v1 == v2, + (Uri v1, Uri v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), (Uri v) => ((object)v).GetHashCode(), (Uri v) => v), providerValueComparer: new ValueComparer( @@ -17400,11 +17400,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas storeGenerationIndex: -1); uriToStringConverterProperty.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( - (Uri v1, Uri v2) => v1 == v2, + (Uri v1, Uri v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), (Uri v) => ((object)v).GetHashCode(), (Uri v) => v), keyComparer: new ValueComparer( - (Uri v1, Uri v2) => v1 == v2, + (Uri v1, Uri v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), (Uri v) => ((object)v).GetHashCode(), (Uri v) => v), providerValueComparer: new ValueComparer( diff --git a/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/BigModel/ManyTypesEntityType.cs b/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/BigModel/ManyTypesEntityType.cs index 849e4e248b0..168afa9209f 100644 --- a/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/BigModel/ManyTypesEntityType.cs +++ b/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/BigModel/ManyTypesEntityType.cs @@ -13374,11 +13374,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas storeGenerationIndex: -1); nullableUri.TypeMapping = SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( - (Uri v1, Uri v2) => v1 == v2, + (Uri v1, Uri v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), (Uri v) => ((object)v).GetHashCode(), (Uri v) => v), keyComparer: new ValueComparer( - (Uri v1, Uri v2) => v1 == v2, + (Uri v1, Uri v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), (Uri v) => ((object)v).GetHashCode(), (Uri v) => v), providerValueComparer: new ValueComparer( @@ -13423,11 +13423,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas storeGenerationIndex: -1); nullableUriArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer(new ValueComparer( - (Uri v1, Uri v2) => v1 == v2, + (Uri v1, Uri v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), (Uri v) => ((object)v).GetHashCode(), (Uri v) => v)), keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( - (Uri v1, Uri v2) => v1 == v2, + (Uri v1, Uri v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), (Uri v) => ((object)v).GetHashCode(), (Uri v) => v)), providerValueComparer: new ValueComparer( @@ -13448,11 +13448,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (string v) => new Uri(v, UriKind.RelativeOrAbsolute)))), elementMapping: SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( - (Uri v1, Uri v2) => v1 == v2, + (Uri v1, Uri v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), (Uri v) => ((object)v).GetHashCode(), (Uri v) => v), keyComparer: new ValueComparer( - (Uri v1, Uri v2) => v1 == v2, + (Uri v1, Uri v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), (Uri v) => ((object)v).GetHashCode(), (Uri v) => v), providerValueComparer: new ValueComparer( @@ -15392,11 +15392,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas storeGenerationIndex: -1); uri.TypeMapping = SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( - (Uri v1, Uri v2) => v1 == v2, + (Uri v1, Uri v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), (Uri v) => ((object)v).GetHashCode(), (Uri v) => v), keyComparer: new ValueComparer( - (Uri v1, Uri v2) => v1 == v2, + (Uri v1, Uri v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), (Uri v) => ((object)v).GetHashCode(), (Uri v) => v), providerValueComparer: new ValueComparer( @@ -15441,11 +15441,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas storeGenerationIndex: -1); uriArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer(new ValueComparer( - (Uri v1, Uri v2) => v1 == v2, + (Uri v1, Uri v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), (Uri v) => ((object)v).GetHashCode(), (Uri v) => v)), keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( - (Uri v1, Uri v2) => v1 == v2, + (Uri v1, Uri v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), (Uri v) => ((object)v).GetHashCode(), (Uri v) => v)), providerValueComparer: new ValueComparer( @@ -15466,11 +15466,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (string v) => new Uri(v, UriKind.RelativeOrAbsolute)))), elementMapping: SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( - (Uri v1, Uri v2) => v1 == v2, + (Uri v1, Uri v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), (Uri v) => ((object)v).GetHashCode(), (Uri v) => v), keyComparer: new ValueComparer( - (Uri v1, Uri v2) => v1 == v2, + (Uri v1, Uri v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), (Uri v) => ((object)v).GetHashCode(), (Uri v) => v), providerValueComparer: new ValueComparer( @@ -15516,11 +15516,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas storeGenerationIndex: -1); uriToStringConverterProperty.TypeMapping = SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( - (Uri v1, Uri v2) => v1 == v2, + (Uri v1, Uri v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), (Uri v) => ((object)v).GetHashCode(), (Uri v) => v), keyComparer: new ValueComparer( - (Uri v1, Uri v2) => v1 == v2, + (Uri v1, Uri v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), (Uri v) => ((object)v).GetHashCode(), (Uri v) => v), providerValueComparer: new ValueComparer( diff --git a/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/BigModel_with_JSON_columns/ManyTypesEntityType.cs b/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/BigModel_with_JSON_columns/ManyTypesEntityType.cs index 849e4e248b0..168afa9209f 100644 --- a/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/BigModel_with_JSON_columns/ManyTypesEntityType.cs +++ b/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/BigModel_with_JSON_columns/ManyTypesEntityType.cs @@ -13374,11 +13374,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas storeGenerationIndex: -1); nullableUri.TypeMapping = SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( - (Uri v1, Uri v2) => v1 == v2, + (Uri v1, Uri v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), (Uri v) => ((object)v).GetHashCode(), (Uri v) => v), keyComparer: new ValueComparer( - (Uri v1, Uri v2) => v1 == v2, + (Uri v1, Uri v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), (Uri v) => ((object)v).GetHashCode(), (Uri v) => v), providerValueComparer: new ValueComparer( @@ -13423,11 +13423,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas storeGenerationIndex: -1); nullableUriArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer(new ValueComparer( - (Uri v1, Uri v2) => v1 == v2, + (Uri v1, Uri v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), (Uri v) => ((object)v).GetHashCode(), (Uri v) => v)), keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( - (Uri v1, Uri v2) => v1 == v2, + (Uri v1, Uri v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), (Uri v) => ((object)v).GetHashCode(), (Uri v) => v)), providerValueComparer: new ValueComparer( @@ -13448,11 +13448,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (string v) => new Uri(v, UriKind.RelativeOrAbsolute)))), elementMapping: SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( - (Uri v1, Uri v2) => v1 == v2, + (Uri v1, Uri v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), (Uri v) => ((object)v).GetHashCode(), (Uri v) => v), keyComparer: new ValueComparer( - (Uri v1, Uri v2) => v1 == v2, + (Uri v1, Uri v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), (Uri v) => ((object)v).GetHashCode(), (Uri v) => v), providerValueComparer: new ValueComparer( @@ -15392,11 +15392,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas storeGenerationIndex: -1); uri.TypeMapping = SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( - (Uri v1, Uri v2) => v1 == v2, + (Uri v1, Uri v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), (Uri v) => ((object)v).GetHashCode(), (Uri v) => v), keyComparer: new ValueComparer( - (Uri v1, Uri v2) => v1 == v2, + (Uri v1, Uri v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), (Uri v) => ((object)v).GetHashCode(), (Uri v) => v), providerValueComparer: new ValueComparer( @@ -15441,11 +15441,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas storeGenerationIndex: -1); uriArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer(new ValueComparer( - (Uri v1, Uri v2) => v1 == v2, + (Uri v1, Uri v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), (Uri v) => ((object)v).GetHashCode(), (Uri v) => v)), keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( - (Uri v1, Uri v2) => v1 == v2, + (Uri v1, Uri v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), (Uri v) => ((object)v).GetHashCode(), (Uri v) => v)), providerValueComparer: new ValueComparer( @@ -15466,11 +15466,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (string v) => new Uri(v, UriKind.RelativeOrAbsolute)))), elementMapping: SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( - (Uri v1, Uri v2) => v1 == v2, + (Uri v1, Uri v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), (Uri v) => ((object)v).GetHashCode(), (Uri v) => v), keyComparer: new ValueComparer( - (Uri v1, Uri v2) => v1 == v2, + (Uri v1, Uri v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), (Uri v) => ((object)v).GetHashCode(), (Uri v) => v), providerValueComparer: new ValueComparer( @@ -15516,11 +15516,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas storeGenerationIndex: -1); uriToStringConverterProperty.TypeMapping = SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( - (Uri v1, Uri v2) => v1 == v2, + (Uri v1, Uri v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), (Uri v) => ((object)v).GetHashCode(), (Uri v) => v), keyComparer: new ValueComparer( - (Uri v1, Uri v2) => v1 == v2, + (Uri v1, Uri v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), (Uri v) => ((object)v).GetHashCode(), (Uri v) => v), providerValueComparer: new ValueComparer(