From 2269580c14812b1a7d82f81f8a1c6f36c28b90db Mon Sep 17 00:00:00 2001 From: Arthur Vickers Date: Tue, 30 Apr 2024 15:59:24 +0100 Subject: [PATCH 1/2] Support hierarchical partition keys in Cosmos provider Fixes #28186 Fixes #28265 Fixes #33535 Also: - Allow non-string partition key values - Warn if no partition key has been defined - Use a value converter if needed for values passed to WithPartitionKey (This is probably a bug, but should be docced as a breaking change anyway.) Updated based on review feedback --- .../Diagnostics/CosmosEventId.cs | 23 +- .../CosmosItemCommandExecutedEventData.cs | 8 +- .../Diagnostics/CosmosQueryEventData.cs | 8 +- .../CosmosQueryExecutedEventData.cs | 8 +- .../Diagnostics/CosmosReadItemEventData.cs | 8 +- .../Internal/CosmosLoggerExtensions.cs | 89 +- .../Internal/CosmosLoggingDefinitions.cs | 8 + .../CosmosEntityTypeBuilderExtensions.cs | 101 +- .../Extensions/CosmosEntityTypeExtensions.cs | 124 +- .../Extensions/CosmosQueryableExtensions.cs | 34 +- .../Internal/PartitionKeyBuilderExtensions.cs | 85 + .../Internal/CosmosModelValidator.cs | 102 +- .../CosmosKeyDiscoveryConvention.cs | 7 +- ...osmosManyToManyJoinEntityTypeConvention.cs | 59 +- .../Conventions/StoreKeyConvention.cs | 63 +- .../Internal/CosmosAnnotationNames.cs | 2 +- .../Properties/CosmosStrings.Designer.cs | 71 +- .../Properties/CosmosStrings.resx | 21 +- .../Internal/CosmosQueryCompilationContext.cs | 2 +- ...ueryMetadataExtractingExpressionVisitor.cs | 28 +- ...yableMethodTranslatingExpressionVisitor.cs | 142 +- ...ingExpressionVisitor.QueryingEnumerable.cs | 26 +- ...ssionVisitor.ReadItemQueryingEnumerable.cs | 40 +- ...osShapedQueryCompilingExpressionVisitor.cs | 6 +- .../Query/Internal/SelectExpression.cs | 42 +- .../Storage/Internal/ContainerProperties.cs | 10 +- .../Storage/Internal/CosmosClientWrapper.cs | 114 +- .../Storage/Internal/CosmosDatabaseCreator.cs | 23 +- .../Storage/Internal/ICosmosClientWrapper.cs | 10 +- .../Internal/IdValueGenerator.cs | 4 +- src/Shared/ExpressionExtensions.cs | 2 +- .../BuiltInDataTypesCosmosTest.cs | 4 + .../ConcurrencyDetectorDisabledCosmosTest.cs | 3 +- .../ConcurrencyDetectorEnabledCosmosTest.cs | 3 + .../ConfigPatternsCosmosTest.cs | 3 + .../CosmosConcurrencyTest.cs | 1 + .../CustomConvertersCosmosTest.cs | 3 + .../EmbeddedDocumentsTest.cs | 3 + .../EndToEndCosmosTest.cs | 174 +- .../F1CosmosFixture.cs | 3 + .../FindCosmosTest.cs | 3 + .../HierarchicalPartitionKeyTest.cs | 293 + .../KeysWithConvertersCosmosTest.cs | 3 +- .../MaterializationInterceptionCosmosTest.cs | 23 +- .../CosmosModelBuilderGenericTest.cs | 498 +- .../CosmosTestModelBuilderExtensions.cs | 11 +- .../OverzealousInitializationCosmosTest.cs | 4 + .../Query/InheritanceQueryCosmosFixture.cs | 4 + .../Query/NorthwindQueryCosmosFixture.cs | 4 + .../Query/OwnedQueryCosmosTest.cs | 4 + .../Query/QueryLoggingCosmosTestBase.cs | 4 +- ...onInterceptionWithDiagnosticsCosmosTest.cs | 3 + .../Basic_cosmos_model/DataEntityType.cs | 56 +- .../SimpleModel/DependentDerivedEntityType.cs | 30 +- .../Scaffolding/CompiledModelCosmosTest.cs | 42 +- .../TestUtilities/CosmosTestHelpers.cs | 2 + .../TestUtilities/CosmosTestStore.cs | 23 +- .../CustomPartitionKeyIdGenerator.cs | 4 +- .../ValueConvertersEndToEndCosmosTest.cs | 3 + .../Diagnostics/CosmosEventIdTest.cs | 5 + .../Extensions/CosmosBuilderExtensionsTest.cs | 65 +- .../CosmosMetadataExtensionsTest.cs | 52 + .../PartitionKeyBuilderExtensionsTest.cs | 165 + .../CosmosModelValidatorTest.cs | 55 +- .../ComplexTypes/PrincipalBaseEntityType.cs | 532 +- .../PrincipalDerivedEntityType.cs | 10 +- .../MyEntityEntityType.cs | 20 +- .../Custom_type_mapping/MyEntityEntityType.cs | 20 +- .../MyEntityEntityType.cs | 20 +- .../MyEntityEntityType.cs | 20 +- .../IdentityUser0EntityType.cs | 4 +- .../IdentityUserEntityType.cs | 94 +- .../Fully_qualified_model/IndexEntityType.cs | 12 +- .../ScaffoldingEntityType.cs | 12 +- .../Baselines/Global_namespace/EntityType1.cs | 20 +- .../LazyProxiesEntity3EntityType.cs | 10 +- .../LazyProxiesEntity4EntityType.cs | 18 +- .../LazyProxiesEntity1EntityType.cs | 6 +- .../LazyProxiesEntity2EntityType.cs | 6 +- .../LazyConstructorEntityEntityType.cs | 6 +- .../LazyPropertyDelegateEntityEntityType.cs | 6 +- .../LazyPropertyEntityEntityType.cs | 6 +- .../DependentBaseEntityType.cs | 18 +- .../PrincipalBaseEntityType.cs | 188 +- .../PrincipalDerivedEntityType.cs | 6 +- .../SelfReferentialEntityEntityType.cs | 18 +- .../SimpleModel/DependentDerivedEntityType.cs | 10 +- .../Scaffolding/CompiledModelInMemoryTest.cs | 32 +- .../CompiledModelRelationalTestBase.cs | 12 +- .../MaterializationInterceptionTestBase.cs | 4 +- .../ModelBuilderTest.ComplexType.cs | 2 + .../ModelBuilderTest.TestModel.cs | 1 + .../Scaffolding/CompiledModelTestBase.cs | 6 +- .../SingletonInterceptorsTestBase.cs | 2 +- .../TestUtilities/TestAnnotationComparer.cs | 32 +- .../SqlServerModelBuilderTestBase.cs | 12 +- .../BigModel/DependentBaseEntityType.cs | 22 +- .../BigModel/DependentDerivedEntityType.cs | 22 +- .../Baselines/BigModel/ManyTypesEntityType.cs | 2914 ++++---- .../BigModel/OwnedType0EntityType.cs | 110 +- .../Baselines/BigModel/OwnedTypeEntityType.cs | 110 +- .../BigModel/PrincipalBaseEntityType.cs | 120 +- ...cipalDerivedDependentBasebyteEntityType.cs | 102 +- .../BigModel/PrincipalDerivedEntityType.cs | 10 +- .../DependentBaseEntityType.cs | 22 +- .../DependentDerivedEntityType.cs | 22 +- .../ManyTypesEntityType.cs | 2914 ++++---- .../OwnedType0EntityType.cs | 110 +- .../OwnedTypeEntityType.cs | 110 +- .../PrincipalBaseEntityType.cs | 124 +- ...cipalDerivedDependentBasebyteEntityType.cs | 102 +- .../PrincipalDerivedEntityType.cs | 8 +- .../CheckConstraints/DataEntityType.cs | 8 +- .../ComplexTypes/PrincipalBaseEntityType.cs | 554 +- .../PrincipalDerivedEntityType.cs | 10 +- .../Dynamic_schema/DataEntityType.cs | 8 +- .../Key_HiLo_sequence/DataEntityType.cs | 8 +- .../Baselines/Key_sequence/DataEntityType.cs | 8 +- .../SimpleModel/DependentDerivedEntityType.cs | 10 +- .../SpatialTypesEntityType.cs | 6 +- .../Tpc_Sprocs/DependentBaseEntityType.cs | 12 +- .../Tpc_Sprocs/PrincipalBaseEntityType.cs | 122 +- .../Tpc_Sprocs/PrincipalDerivedEntityType.cs | 6 +- .../Baselines/Triggers/DataEntityType.cs | 8 +- .../Scaffolding/CompiledModelSqlServerTest.cs | 6 +- .../Baselines/BigModel/DataEntityType.cs | 8 +- .../BigModel/DbContextModelBuilder.cs | 132 + .../BigModel/DependentBaseEntityType.cs | 16 +- .../BigModel/DependentDerivedEntityType.cs | 10 +- .../Baselines/BigModel/ManyTypesEntityType.cs | 6644 +++++++++++------ .../BigModel/OwnedType0EntityType.cs | 144 +- .../Baselines/BigModel/OwnedTypeEntityType.cs | 144 +- .../BigModel/PrincipalBaseEntityType.cs | 160 +- ...cipalDerivedDependentBasebyteEntityType.cs | 92 +- .../BigModel/PrincipalDerivedEntityType.cs | 10 +- .../DataEntityType.cs | 8 +- .../DbContextModelBuilder.cs | 132 + .../DependentBaseEntityType.cs | 16 +- .../DependentDerivedEntityType.cs | 10 +- .../ManyTypesEntityType.cs | 6644 +++++++++++------ .../OwnedType0EntityType.cs | 144 +- .../OwnedTypeEntityType.cs | 144 +- .../PrincipalBaseEntityType.cs | 160 +- ...cipalDerivedDependentBasebyteEntityType.cs | 92 +- .../PrincipalDerivedEntityType.cs | 10 +- .../CheckConstraints/DataEntityType.cs | 8 +- ...ParameterTypeMappingContextModelBuilder.cs | 6 +- .../FunctionTypeMappingContextModelBuilder.cs | 6 +- .../Baselines/DbFunctions/DataEntityType.cs | 4 +- .../DbFunctionContextModelBuilder.cs | 6 +- .../Dynamic_schema/DataEntityType.cs | 8 +- .../SimpleModel/DependentDerivedEntityType.cs | 4 +- .../Baselines/Triggers/DataEntityType.cs | 8 +- .../Scaffolding/CompiledModelSqliteTest.cs | 16 +- 154 files changed, 16026 insertions(+), 10336 deletions(-) create mode 100644 src/EFCore.Cosmos/Extensions/Internal/PartitionKeyBuilderExtensions.cs create mode 100644 test/EFCore.Cosmos.FunctionalTests/HierarchicalPartitionKeyTest.cs create mode 100644 test/EFCore.Cosmos.Tests/Extensions/PartitionKeyBuilderExtensionsTest.cs diff --git a/src/EFCore.Cosmos/Diagnostics/CosmosEventId.cs b/src/EFCore.Cosmos/Diagnostics/CosmosEventId.cs index c1580503337..6de27fd0a63 100644 --- a/src/EFCore.Cosmos/Diagnostics/CosmosEventId.cs +++ b/src/EFCore.Cosmos/Diagnostics/CosmosEventId.cs @@ -34,7 +34,11 @@ private enum Id ExecutedReadItem, ExecutedCreateItem, ExecutedReplaceItem, - ExecutedDeleteItem + ExecutedDeleteItem, + + // Model validation events + NoPartitionKeyDefined = CoreEventId.ProviderBaseId + 600, + } private static readonly string DatabasePrefix = DbLoggerCategory.Database.Name + "."; @@ -149,4 +153,21 @@ public static readonly EventId ExecutedReplaceItem /// public static readonly EventId ExecutedDeleteItem = new((int)Id.ExecutedDeleteItem, CommandPrefix + Id.ExecutedDeleteItem); + + private static EventId MakeValidationId(Id id) + => new((int)id, DbLoggerCategory.Model.Validation.Name + "." + id); + + /// + /// No partition key has been configured for an entity type. It is highly recommended that an appropriate partition key be defined. + /// See https://aka.ms/efdocs-cosmos-partition-keys for more information. + /// + /// + /// + /// This event is in the category. + /// + /// + /// This event uses the payload when used with a . + /// + /// + public static readonly EventId NoPartitionKeyDefined = MakeValidationId(Id.NoPartitionKeyDefined); } diff --git a/src/EFCore.Cosmos/Diagnostics/CosmosItemCommandExecutedEventData.cs b/src/EFCore.Cosmos/Diagnostics/CosmosItemCommandExecutedEventData.cs index f342eac04f0..f6865b7ea4d 100644 --- a/src/EFCore.Cosmos/Diagnostics/CosmosItemCommandExecutedEventData.cs +++ b/src/EFCore.Cosmos/Diagnostics/CosmosItemCommandExecutedEventData.cs @@ -21,7 +21,7 @@ public class CosmosItemCommandExecutedEventData : EventData /// The activity ID. /// The ID of the resource being read. /// The ID of the Cosmos container being queried. - /// The key of the Cosmos partition that the query is using. + /// The key of the Cosmos partition that the query is using. /// Indicates whether the application allows logging of sensitive data. public CosmosItemCommandExecutedEventData( EventDefinitionBase eventDefinition, @@ -31,7 +31,7 @@ public CosmosItemCommandExecutedEventData( string activityId, string containerId, string resourceId, - string? partitionKey, + PartitionKey partitionKeyValue, bool logSensitiveData) : base(eventDefinition, messageGenerator) { @@ -40,7 +40,7 @@ public CosmosItemCommandExecutedEventData( ActivityId = activityId; ContainerId = containerId; ResourceId = resourceId; - PartitionKey = partitionKey; + PartitionKeyValue = partitionKeyValue; LogSensitiveData = logSensitiveData; } @@ -72,7 +72,7 @@ public CosmosItemCommandExecutedEventData( /// /// The key of the Cosmos partition that the query is using. /// - public virtual string? PartitionKey { get; } + public virtual PartitionKey PartitionKeyValue { get; } /// /// Indicates whether the application allows logging of sensitive data. diff --git a/src/EFCore.Cosmos/Diagnostics/CosmosQueryEventData.cs b/src/EFCore.Cosmos/Diagnostics/CosmosQueryEventData.cs index 2d6a56fbaad..fca1bea3489 100644 --- a/src/EFCore.Cosmos/Diagnostics/CosmosQueryEventData.cs +++ b/src/EFCore.Cosmos/Diagnostics/CosmosQueryEventData.cs @@ -17,7 +17,7 @@ public class CosmosQueryEventData : EventData /// The event definition. /// A delegate that generates a log message for this event. /// The ID of the Cosmos container being queried. - /// The key of the Cosmos partition that the query is using. + /// The key value of the Cosmos partition that the query is using. /// Name/values for each parameter in the Cosmos Query. /// The SQL representing the query. /// Indicates whether the application allows logging of sensitive data. @@ -25,14 +25,14 @@ public CosmosQueryEventData( EventDefinitionBase eventDefinition, Func messageGenerator, string containerId, - string? partitionKey, + PartitionKey partitionKeyValue, IReadOnlyList<(string Name, object? Value)> parameters, string querySql, bool logSensitiveData) : base(eventDefinition, messageGenerator) { ContainerId = containerId; - PartitionKey = partitionKey; + PartitionKeyValue = partitionKeyValue; Parameters = parameters; QuerySql = querySql; LogSensitiveData = logSensitiveData; @@ -46,7 +46,7 @@ public CosmosQueryEventData( /// /// The key of the Cosmos partition that the query is using. /// - public virtual string? PartitionKey { get; } + public virtual PartitionKey PartitionKeyValue { get; } /// /// Name/values for each parameter in the Cosmos Query. diff --git a/src/EFCore.Cosmos/Diagnostics/CosmosQueryExecutedEventData.cs b/src/EFCore.Cosmos/Diagnostics/CosmosQueryExecutedEventData.cs index 621ce34aae3..2934ac9e71f 100644 --- a/src/EFCore.Cosmos/Diagnostics/CosmosQueryExecutedEventData.cs +++ b/src/EFCore.Cosmos/Diagnostics/CosmosQueryExecutedEventData.cs @@ -20,7 +20,7 @@ public class CosmosQueryExecutedEventData : EventData /// The request charge in RU. /// The activity ID. /// The ID of the Cosmos container being queried. - /// The key of the Cosmos partition that the query is using. + /// The key value of the Cosmos partition that the query is using. /// Name/values for each parameter in the Cosmos Query. /// The SQL representing the query. /// Indicates whether the application allows logging of sensitive data. @@ -31,7 +31,7 @@ public CosmosQueryExecutedEventData( double requestCharge, string activityId, string containerId, - string? partitionKey, + PartitionKey partitionKeyValue, IReadOnlyList<(string Name, object? Value)> parameters, string querySql, bool logSensitiveData) @@ -41,7 +41,7 @@ public CosmosQueryExecutedEventData( RequestCharge = requestCharge; ActivityId = activityId; ContainerId = containerId; - PartitionKey = partitionKey; + PartitionKeyValue = partitionKeyValue; Parameters = parameters; QuerySql = querySql; LogSensitiveData = logSensitiveData; @@ -70,7 +70,7 @@ public CosmosQueryExecutedEventData( /// /// The key of the Cosmos partition that the query is using. /// - public virtual string? PartitionKey { get; } + public virtual PartitionKey PartitionKeyValue { get; } /// /// Name/values for each parameter in the Cosmos Query. diff --git a/src/EFCore.Cosmos/Diagnostics/CosmosReadItemEventData.cs b/src/EFCore.Cosmos/Diagnostics/CosmosReadItemEventData.cs index b6c3b4edc24..a782e0c9b28 100644 --- a/src/EFCore.Cosmos/Diagnostics/CosmosReadItemEventData.cs +++ b/src/EFCore.Cosmos/Diagnostics/CosmosReadItemEventData.cs @@ -18,20 +18,20 @@ public class CosmosReadItemEventData : EventData /// A delegate that generates a log message for this event. /// The ID of the resource being read. /// The ID of the Cosmos container being queried. - /// The key of the Cosmos partition that the query is using. + /// The key value of the Cosmos partition that the query is using. /// Indicates whether the application allows logging of sensitive data. public CosmosReadItemEventData( EventDefinitionBase eventDefinition, Func messageGenerator, string resourceId, string containerId, - string? partitionKey, + PartitionKey partitionKeyValue, bool logSensitiveData) : base(eventDefinition, messageGenerator) { ResourceId = resourceId; ContainerId = containerId; - PartitionKey = partitionKey; + PartitionKeyValue = partitionKeyValue; LogSensitiveData = logSensitiveData; } @@ -48,7 +48,7 @@ public CosmosReadItemEventData( /// /// The key of the Cosmos partition that the query is using. /// - public virtual string? PartitionKey { get; } + public virtual PartitionKey PartitionKeyValue { get; } /// /// Indicates whether the application allows logging of sensitive data. diff --git a/src/EFCore.Cosmos/Diagnostics/Internal/CosmosLoggerExtensions.cs b/src/EFCore.Cosmos/Diagnostics/Internal/CosmosLoggerExtensions.cs index 75834a6465c..32e4f91c1f5 100644 --- a/src/EFCore.Cosmos/Diagnostics/Internal/CosmosLoggerExtensions.cs +++ b/src/EFCore.Cosmos/Diagnostics/Internal/CosmosLoggerExtensions.cs @@ -54,7 +54,7 @@ public static void SyncNotSupported( public static void ExecutingSqlQuery( this IDiagnosticsLogger diagnostics, string containerId, - string? partitionKey, + PartitionKey partitionKeyValue, CosmosSqlQuery cosmosSqlQuery) { var definition = CosmosResources.LogExecutingSqlQuery(diagnostics); @@ -66,7 +66,7 @@ public static void ExecutingSqlQuery( definition.Log( diagnostics, containerId, - logSensitiveData ? partitionKey : "?", + logSensitiveData ? partitionKeyValue.ToString() : "?", FormatParameters(cosmosSqlQuery.Parameters, logSensitiveData && cosmosSqlQuery.Parameters.Count > 0), Environment.NewLine, cosmosSqlQuery.Query); @@ -78,7 +78,7 @@ public static void ExecutingSqlQuery( definition, ExecutingSqlQuery, containerId, - partitionKey, + partitionKeyValue, cosmosSqlQuery.Parameters.Select(p => (p.Name, p.Value)).ToList(), cosmosSqlQuery.Query, diagnostics.ShouldLogSensitiveData()); @@ -93,7 +93,7 @@ private static string ExecutingSqlQuery(EventDefinitionBase definition, EventDat var p = (CosmosQueryEventData)payload; return d.GenerateMessage( p.ContainerId, - p.LogSensitiveData ? p.PartitionKey : "?", + p.LogSensitiveData ? p.PartitionKeyValue.ToString() : "?", FormatParameters(p.Parameters, p is { LogSensitiveData: true, Parameters.Count: > 0 }), Environment.NewLine, p.QuerySql); @@ -108,7 +108,7 @@ private static string ExecutingSqlQuery(EventDefinitionBase definition, EventDat public static void ExecutingReadItem( this IDiagnosticsLogger diagnostics, string containerId, - string? partitionKey, + PartitionKey partitionKeyValue, string resourceId) { var definition = CosmosResources.LogExecutingReadItem(diagnostics); @@ -116,7 +116,11 @@ public static void ExecutingReadItem( if (diagnostics.ShouldLog(definition)) { var logSensitiveData = diagnostics.ShouldLogSensitiveData(); - definition.Log(diagnostics, logSensitiveData ? resourceId : "?", containerId, logSensitiveData ? partitionKey : "?"); + definition.Log( + diagnostics, + logSensitiveData ? resourceId : "?", + containerId, + logSensitiveData ? partitionKeyValue.ToString() : "?"); } if (diagnostics.NeedsEventData(definition, out var diagnosticSourceEnabled, out var simpleLogEnabled)) @@ -126,7 +130,7 @@ public static void ExecutingReadItem( ExecutingReadItem, resourceId, containerId, - partitionKey, + partitionKeyValue, diagnostics.ShouldLogSensitiveData()); diagnostics.DispatchEventData(definition, eventData, diagnosticSourceEnabled, simpleLogEnabled); @@ -137,7 +141,9 @@ private static string ExecutingReadItem(EventDefinitionBase definition, EventDat { var d = (EventDefinition)definition; var p = (CosmosReadItemEventData)payload; - return d.GenerateMessage(p.LogSensitiveData ? p.ResourceId : "?", p.ContainerId, p.LogSensitiveData ? p.PartitionKey : "?"); + return d.GenerateMessage( + p.LogSensitiveData ? p.ResourceId : "?", + p.ContainerId, p.LogSensitiveData ? p.PartitionKeyValue.ToString() : "?"); } /// @@ -152,7 +158,7 @@ public static void ExecutedReadNext( double requestCharge, string activityId, string containerId, - string? partitionKey, + PartitionKey partitionKeyValue, CosmosSqlQuery cosmosSqlQuery) { var definition = CosmosResources.LogExecutedReadNext(diagnostics); @@ -171,7 +177,7 @@ public static void ExecutedReadNext( requestCharge, activityId, containerId, - logSensitiveData ? partitionKey : "?", + logSensitiveData ? partitionKeyValue.ToString() : "?", FormatParameters(cosmosSqlQuery.Parameters, logSensitiveData && cosmosSqlQuery.Parameters.Count > 0), Environment.NewLine, cosmosSqlQuery.Query)); @@ -186,7 +192,7 @@ public static void ExecutedReadNext( requestCharge, activityId, containerId, - partitionKey, + partitionKeyValue, cosmosSqlQuery.Parameters.Select(p => (p.Name, p.Value)).ToList(), cosmosSqlQuery.Query, diagnostics.ShouldLogSensitiveData()); @@ -208,7 +214,7 @@ private static string ExecutedReadNext(EventDefinitionBase definition, EventData p.RequestCharge, p.ActivityId, p.ContainerId, - p.LogSensitiveData ? p.PartitionKey : "?", + p.LogSensitiveData ? p.PartitionKeyValue.ToString() : "?", FormatParameters(p.Parameters, p is { LogSensitiveData: true, Parameters.Count: > 0 }), Environment.NewLine, p.QuerySql)); @@ -227,7 +233,7 @@ public static void ExecutedReadItem( string activityId, string resourceId, string containerId, - string? partitionKey) + PartitionKey partitionKeyValue) { var definition = CosmosResources.LogExecutedReadItem(diagnostics); @@ -241,7 +247,7 @@ public static void ExecutedReadItem( activityId, containerId, logSensitiveData ? resourceId : "?", - logSensitiveData ? partitionKey : "?"); + logSensitiveData ? partitionKeyValue.ToString() : "?"); } if (diagnostics.NeedsEventData(definition, out var diagnosticSourceEnabled, out var simpleLogEnabled)) @@ -254,7 +260,7 @@ public static void ExecutedReadItem( activityId, containerId, resourceId, - partitionKey, + partitionKeyValue, diagnostics.ShouldLogSensitiveData()); diagnostics.DispatchEventData(definition, eventData, diagnosticSourceEnabled, simpleLogEnabled); @@ -271,7 +277,7 @@ private static string ExecutedReadItem(EventDefinitionBase definition, EventData p.ActivityId, p.ContainerId, p.LogSensitiveData ? p.ResourceId : "?", - p.LogSensitiveData ? p.PartitionKey : "?"); + p.LogSensitiveData ? p.PartitionKeyValue.ToString() : "?"); } /// @@ -287,7 +293,7 @@ public static void ExecutedCreateItem( string activityId, string resourceId, string containerId, - string? partitionKey) + PartitionKey partitionKeyValue) { var definition = CosmosResources.LogExecutedCreateItem(diagnostics); @@ -301,7 +307,7 @@ public static void ExecutedCreateItem( activityId, containerId, logSensitiveData ? resourceId : "?", - logSensitiveData ? partitionKey : "?"); + logSensitiveData ? partitionKeyValue.ToString() : "?"); } if (diagnostics.NeedsEventData(definition, out var diagnosticSourceEnabled, out var simpleLogEnabled)) @@ -314,7 +320,7 @@ public static void ExecutedCreateItem( activityId, containerId, resourceId, - partitionKey, + partitionKeyValue, diagnostics.ShouldLogSensitiveData()); diagnostics.DispatchEventData(definition, eventData, diagnosticSourceEnabled, simpleLogEnabled); @@ -331,7 +337,7 @@ private static string ExecutedCreateItem(EventDefinitionBase definition, EventDa p.ActivityId, p.ContainerId, p.LogSensitiveData ? p.ResourceId : "?", - p.LogSensitiveData ? p.PartitionKey : "?"); + p.LogSensitiveData ? p.PartitionKeyValue.ToString() : "?"); } /// @@ -347,7 +353,7 @@ public static void ExecutedDeleteItem( string activityId, string resourceId, string containerId, - string? partitionKey) + PartitionKey partitionKeyValue) { var definition = CosmosResources.LogExecutedDeleteItem(diagnostics); @@ -361,7 +367,7 @@ public static void ExecutedDeleteItem( activityId, containerId, logSensitiveData ? resourceId : "?", - logSensitiveData ? partitionKey : "?"); + logSensitiveData ? partitionKeyValue.ToString() : "?"); } if (diagnostics.NeedsEventData(definition, out var diagnosticSourceEnabled, out var simpleLogEnabled)) @@ -374,7 +380,7 @@ public static void ExecutedDeleteItem( activityId, containerId, resourceId, - partitionKey, + partitionKeyValue, diagnostics.ShouldLogSensitiveData()); diagnostics.DispatchEventData(definition, eventData, diagnosticSourceEnabled, simpleLogEnabled); @@ -391,7 +397,7 @@ private static string ExecutedDeleteItem(EventDefinitionBase definition, EventDa p.ActivityId, p.ContainerId, p.LogSensitiveData ? p.ResourceId : "?", - p.LogSensitiveData ? p.PartitionKey : "?"); + p.LogSensitiveData ? p.PartitionKeyValue.ToString() : "?"); } /// @@ -407,7 +413,7 @@ public static void ExecutedReplaceItem( string activityId, string resourceId, string containerId, - string? partitionKey) + PartitionKey partitionKeyValue) { var definition = CosmosResources.LogExecutedReplaceItem(diagnostics); @@ -421,7 +427,7 @@ public static void ExecutedReplaceItem( activityId, containerId, logSensitiveData ? resourceId : "?", - logSensitiveData ? partitionKey : "?"); + logSensitiveData ? partitionKeyValue.ToString() : "?"); } if (diagnostics.NeedsEventData(definition, out var diagnosticSourceEnabled, out var simpleLogEnabled)) @@ -434,7 +440,7 @@ public static void ExecutedReplaceItem( activityId, containerId, resourceId, - partitionKey, + partitionKeyValue, diagnostics.ShouldLogSensitiveData()); diagnostics.DispatchEventData(definition, eventData, diagnosticSourceEnabled, simpleLogEnabled); @@ -451,7 +457,34 @@ private static string ExecutedReplaceItem(EventDefinitionBase definition, EventD p.ActivityId, p.ContainerId, p.LogSensitiveData ? p.ResourceId : "?", - p.LogSensitiveData ? p.PartitionKey : "?"); + p.LogSensitiveData ? p.PartitionKeyValue.ToString() : "?"); + } + + /// + /// This is an internal API that supports the Entity Framework Core infrastructure and not subject to + /// the same compatibility standards as public APIs. It may be changed or removed without notice in + /// 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. + /// + public static void NoPartitionKeyDefined( + this IDiagnosticsLogger diagnostics, + IEntityType entityType) + { + var definition = CosmosResources.LogNoPartitionKeyDefined(diagnostics); + + if (diagnostics.ShouldLog(definition)) + { + definition.Log(diagnostics, entityType.DisplayName()); + } + + if (diagnostics.NeedsEventData(definition, out var diagnosticSourceEnabled, out var simpleLogEnabled)) + { + var eventData = new EntityTypeEventData( + definition, + (d, p) => ((EventDefinition)d).GenerateMessage(((EntityTypeEventData)p).EntityType.DisplayName()), + entityType); + diagnostics.DispatchEventData(definition, eventData, diagnosticSourceEnabled, simpleLogEnabled); + } } private static string FormatParameters(IReadOnlyList<(string Name, object? Value)> parameters, bool shouldLogParameterValues) diff --git a/src/EFCore.Cosmos/Diagnostics/Internal/CosmosLoggingDefinitions.cs b/src/EFCore.Cosmos/Diagnostics/Internal/CosmosLoggingDefinitions.cs index 79cda1d0bea..a4d504358d8 100644 --- a/src/EFCore.Cosmos/Diagnostics/Internal/CosmosLoggingDefinitions.cs +++ b/src/EFCore.Cosmos/Diagnostics/Internal/CosmosLoggingDefinitions.cs @@ -74,4 +74,12 @@ public class CosmosLoggingDefinitions : LoggingDefinitions /// doing so can result in application failures when updating to a new Entity Framework Core release. /// public EventDefinitionBase? LogSyncNotSupported; + + /// + /// This is an internal API that supports the Entity Framework Core infrastructure and not subject to + /// the same compatibility standards as public APIs. It may be changed or removed without notice in + /// 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. + /// + public EventDefinitionBase? LogNoPartitionKeyDefined; } diff --git a/src/EFCore.Cosmos/Extensions/CosmosEntityTypeBuilderExtensions.cs b/src/EFCore.Cosmos/Extensions/CosmosEntityTypeBuilderExtensions.cs index 22490499039..3292e43101a 100644 --- a/src/EFCore.Cosmos/Extensions/CosmosEntityTypeBuilderExtensions.cs +++ b/src/EFCore.Cosmos/Extensions/CosmosEntityTypeBuilderExtensions.cs @@ -196,49 +196,68 @@ public static bool CanSetJsonProperty( } /// - /// Configures the property that is used to store the partition key. + /// Configures the properties that are used to store the parts of a simple or + /// hierarchical partition key. /// /// /// See Modeling entity types and relationships, and /// Accessing Azure Cosmos DB with EF Core for more information and examples. /// /// The builder for the entity type being configured. - /// The name of the partition key property. + /// The name of the first or only partition key property. + /// The names of additional properties that will form a hierarchical partition key. /// The same builder instance so that multiple calls can be chained. public static EntityTypeBuilder HasPartitionKey( this EntityTypeBuilder entityTypeBuilder, - string? name) + string? name, + params string[]? additionalPropertyNames) { - entityTypeBuilder.Metadata.SetPartitionKeyPropertyName(name); + Check.NullButNotEmpty(name, nameof(name)); + Check.HasNoEmptyElements(additionalPropertyNames, nameof(additionalPropertyNames)); + + if (name is null) + { + entityTypeBuilder.Metadata.SetPartitionKeyPropertyNames(null); + } + else + { + var propertyNames = new List { name }; + propertyNames.AddRange(additionalPropertyNames); + entityTypeBuilder.Metadata.SetPartitionKeyPropertyNames(propertyNames); + } return entityTypeBuilder; } /// - /// Configures the property that is used to store the partition key. + /// Configures the properties that are used to store the parts of a simple or + /// hierarchical partition key. /// /// /// See Modeling entity types and relationships, and /// Accessing Azure Cosmos DB with EF Core for more information and examples. /// /// The builder for the entity type being configured. - /// The name of the partition key property. + /// The name of the first or only partition key property. + /// The names of additional properties that will form a hierarchical partition key. /// The same builder instance so that multiple calls can be chained. public static EntityTypeBuilder HasPartitionKey( this EntityTypeBuilder entityTypeBuilder, - string? name) + string? name, + params string[]? additionalPropertyNames) where TEntity : class - => (EntityTypeBuilder)HasPartitionKey((EntityTypeBuilder)entityTypeBuilder, name); + => (EntityTypeBuilder)HasPartitionKey((EntityTypeBuilder)entityTypeBuilder, name, additionalPropertyNames); /// - /// Configures the property that is used to store the partition key. + /// Configures the properties that are used to store the parts of a simple or + /// hierarchical partition key. /// /// /// See Modeling entity types and relationships, and /// Accessing Azure Cosmos DB with EF Core for more information and examples. /// /// The builder for the entity type being configured. - /// The partition key property. + /// The properties that will form the partition key. /// The same builder instance so that multiple calls can be chained. public static EntityTypeBuilder HasPartitionKey( this EntityTypeBuilder entityTypeBuilder, @@ -247,7 +266,10 @@ public static EntityTypeBuilder HasPartitionKey( { Check.NotNull(propertyExpression, nameof(propertyExpression)); - return HasPartitionKey(entityTypeBuilder, propertyExpression.GetMemberAccess().GetSimpleMemberName()); + entityTypeBuilder.Metadata.SetPartitionKeyPropertyNames( + propertyExpression.GetMemberAccessList().Select(e => e.GetSimpleMemberName()).ToList()); + + return entityTypeBuilder; } /// @@ -264,23 +286,61 @@ public static EntityTypeBuilder HasPartitionKey( /// The same builder instance if the configuration was applied, /// otherwise. /// + [Obsolete("Use HasPartitionKey(IReadOnlyList, bool)")] public static IConventionEntityTypeBuilder? HasPartitionKey( this IConventionEntityTypeBuilder entityTypeBuilder, string? name, bool fromDataAnnotation = false) + => entityTypeBuilder.HasPartitionKey(name == null ? null : [name], fromDataAnnotation); + + /// + /// Returns a value indicating whether the property that is used to store the partition key can be set + /// from the current configuration source + /// + /// + /// See Modeling entity types and relationships, and + /// Accessing Azure Cosmos DB with EF Core for more information and examples. + /// + /// The builder for the entity type being configured. + /// The name of the partition key property. + /// Indicates whether the configuration was specified using a data annotation. + /// if the configuration can be applied. + [Obsolete("Use HasPartitionKey(IReadOnlyList, bool)")] + public static bool CanSetPartitionKey( + this IConventionEntityTypeBuilder entityTypeBuilder, + string? name, + bool fromDataAnnotation = false) + => entityTypeBuilder.CanSetPartitionKey(name == null ? null : [name], fromDataAnnotation); + + /// + /// Configures the properties that are used to store the parts of a + /// hierarchical partition key. + /// + /// + /// See Modeling entity types and relationships, and + /// Accessing Azure Cosmos DB with EF Core for more information and examples. + /// + /// The builder for the entity type being configured. + /// The names of the properties that will form the hierarchical partition key. + /// Indicates whether the configuration was specified using a data annotation. + /// The same builder instance if the configuration was applied, otherwise. + public static IConventionEntityTypeBuilder? HasPartitionKey( + this IConventionEntityTypeBuilder entityTypeBuilder, + IReadOnlyList? propertyNames, + bool fromDataAnnotation = false) { - if (!entityTypeBuilder.CanSetPartitionKey(name, fromDataAnnotation)) + if (!entityTypeBuilder.CanSetPartitionKey(propertyNames, fromDataAnnotation)) { return null; } - entityTypeBuilder.Metadata.SetPartitionKeyPropertyName(name, fromDataAnnotation); + entityTypeBuilder.Metadata.SetPartitionKeyPropertyNames(propertyNames, fromDataAnnotation); return entityTypeBuilder; } /// - /// Returns a value indicating whether the property that is used to store the partition key can be set + /// Returns a value indicating whether the properties that are used to store the parts of a hierarchical partition key /// from the current configuration source /// /// @@ -288,18 +348,17 @@ public static EntityTypeBuilder HasPartitionKey( /// Accessing Azure Cosmos DB with EF Core for more information and examples. /// /// The builder for the entity type being configured. - /// The name of the partition key property. + /// The name of the partition key properties. /// Indicates whether the configuration was specified using a data annotation. /// if the configuration can be applied. public static bool CanSetPartitionKey( this IConventionEntityTypeBuilder entityTypeBuilder, - string? name, + IReadOnlyList? names, bool fromDataAnnotation = false) - { - Check.NullButNotEmpty(name, nameof(name)); - - return entityTypeBuilder.CanSetAnnotation(CosmosAnnotationNames.PartitionKeyName, name, fromDataAnnotation); - } + => entityTypeBuilder.CanSetAnnotation( + CosmosAnnotationNames.PartitionKeyNames, + names is null ? names : Check.HasNoEmptyElements(names, nameof(names)), + fromDataAnnotation); /// /// Configures this entity to use CosmosDb etag concurrency checks. diff --git a/src/EFCore.Cosmos/Extensions/CosmosEntityTypeExtensions.cs b/src/EFCore.Cosmos/Extensions/CosmosEntityTypeExtensions.cs index 53b220d21c3..be6ad2a2bc1 100644 --- a/src/EFCore.Cosmos/Extensions/CosmosEntityTypeExtensions.cs +++ b/src/EFCore.Cosmos/Extensions/CosmosEntityTypeExtensions.cs @@ -119,18 +119,18 @@ public static void SetContainingPropertyName(this IMutableEntityType entityType, /// /// The entity type to get the partition key property name for. /// The name of the partition key property. + [Obsolete("Use SetPartitionKeyPropertyNames")] public static string? GetPartitionKeyPropertyName(this IReadOnlyEntityType entityType) - => entityType[CosmosAnnotationNames.PartitionKeyName] as string; + => entityType.GetPartitionKeyPropertyNames().FirstOrDefault(); /// /// Sets the name of the property that is used to store the partition key key. /// /// The entity type to set the partition key property name for. /// The name to set. + [Obsolete("Use SetPartitionKeyPropertyNames")] public static void SetPartitionKeyPropertyName(this IMutableEntityType entityType, string? name) - => entityType.SetOrRemoveAnnotation( - CosmosAnnotationNames.PartitionKeyName, - Check.NullButNotEmpty(name, nameof(name))); + => entityType.SetPartitionKeyPropertyNames(name == null ? null : [name]); /// /// Sets the name of the property that is used to store the partition key. @@ -138,75 +138,131 @@ public static void SetPartitionKeyPropertyName(this IMutableEntityType entityTyp /// The entity type to set the partition key property name for. /// The name to set. /// Indicates whether the configuration was specified using a data annotation. + [Obsolete("Use SetPartitionKeyPropertyNames")] public static string? SetPartitionKeyPropertyName( this IConventionEntityType entityType, string? name, bool fromDataAnnotation = false) - => (string?)entityType.SetOrRemoveAnnotation( - CosmosAnnotationNames.PartitionKeyName, - Check.NullButNotEmpty(name, nameof(name)), - fromDataAnnotation)?.Value; + => entityType.SetPartitionKeyPropertyNames(name is null ? null : [name], fromDataAnnotation)?.FirstOrDefault(); /// /// Gets the for the property that is used to store the partition key. /// /// The entity type to find configuration source for. /// The for the partition key property. + [Obsolete("Use GetPartitionKeyPropertyNamesConfigurationSource")] public static ConfigurationSource? GetPartitionKeyPropertyNameConfigurationSource(this IConventionEntityType entityType) - => entityType.FindAnnotation(CosmosAnnotationNames.PartitionKeyName) - ?.GetConfigurationSource(); + => entityType.GetPartitionKeyPropertyNamesConfigurationSource(); /// /// Returns the property that is used to store the partition key. /// /// The entity type to get the partition key property for. /// The name of the partition key property. + [Obsolete("Use GetPartitionKeyProperties")] public static IReadOnlyProperty? GetPartitionKeyProperty(this IReadOnlyEntityType entityType) - { - var partitionKeyPropertyName = entityType.GetPartitionKeyPropertyName(); - return partitionKeyPropertyName == null - ? null - : entityType.FindProperty(partitionKeyPropertyName); - } + => entityType.GetPartitionKeyProperties().FirstOrDefault(); /// /// Returns the property that is used to store the partition key. /// /// The entity type to get the partition key property for. /// The name of the partition key property. + [Obsolete("Use GetPartitionKeyProperties")] public static IMutableProperty? GetPartitionKeyProperty(this IMutableEntityType entityType) - { - var partitionKeyPropertyName = entityType.GetPartitionKeyPropertyName(); - return partitionKeyPropertyName == null - ? null - : entityType.FindProperty(partitionKeyPropertyName); - } + => entityType.GetPartitionKeyProperties().FirstOrDefault(); /// /// Returns the property that is used to store the partition key. /// /// The entity type to get the partition key property for. /// The name of the partition key property. + [Obsolete("Use GetPartitionKeyProperties")] public static IConventionProperty? GetPartitionKeyProperty(this IConventionEntityType entityType) - { - var partitionKeyPropertyName = entityType.GetPartitionKeyPropertyName(); - return partitionKeyPropertyName == null - ? null - : entityType.FindProperty(partitionKeyPropertyName); - } + => entityType.GetPartitionKeyProperties().FirstOrDefault(); /// /// Returns the property that is used to store the partition key. /// /// The entity type to get the partition key property for. /// The name of the partition key property. + [Obsolete("Use GetPartitionKeyProperties")] public static IProperty? GetPartitionKeyProperty(this IEntityType entityType) - { - var partitionKeyPropertyName = entityType.GetPartitionKeyPropertyName(); - return partitionKeyPropertyName == null - ? null - : entityType.FindProperty(partitionKeyPropertyName); - } + => entityType.GetPartitionKeyProperties().FirstOrDefault(); + + /// + /// Returns the names of the properties that are used to store the hierarchical partition key, if any. + /// + /// The entity type. + /// The names of the partition key properties, or if not set. + public static IReadOnlyList GetPartitionKeyPropertyNames(this IReadOnlyEntityType entityType) + => entityType[CosmosAnnotationNames.PartitionKeyNames] as IReadOnlyList ?? Array.Empty(); + + /// + /// Sets the names of the properties that are used to store the hierarchical partition key. + /// + /// The entity type. + /// The names to set, or to clear all names. + public static void SetPartitionKeyPropertyNames(this IMutableEntityType entityType, IReadOnlyList? names) + => entityType.SetOrRemoveAnnotation( + CosmosAnnotationNames.PartitionKeyNames, names is null ? names : Check.HasNoEmptyElements(names, nameof(names))); + + /// + /// Sets the names of the properties that are used to store the hierarchical partition key. + /// + /// The entity type to set the partition key property name for. + /// The names to set. + /// Indicates whether the configuration was specified using a data annotation. + public static IReadOnlyList? SetPartitionKeyPropertyNames( + this IConventionEntityType entityType, + IReadOnlyList? names, + bool fromDataAnnotation = false) + => (IReadOnlyList?)entityType + .SetOrRemoveAnnotation( + CosmosAnnotationNames.PartitionKeyNames, + names is null ? names : Check.HasNoEmptyElements(names, nameof(names)), + fromDataAnnotation)?.Value; + + /// + /// Gets the for the properties that are used to store the hierarchical partition key. + /// + /// The entity type to find configuration source for. + /// The for the partition key properties. + public static ConfigurationSource? GetPartitionKeyPropertyNamesConfigurationSource(this IConventionEntityType entityType) + => entityType.FindAnnotation(CosmosAnnotationNames.PartitionKeyNames) + ?.GetConfigurationSource(); + + /// + /// Returns the the properties that are used to store the hierarchical partition key. + /// + /// The entity type. + /// The hierarchical partition key properties. + public static IReadOnlyList GetPartitionKeyProperties(this IReadOnlyEntityType entityType) + => entityType.GetPartitionKeyPropertyNames().Select(n => entityType.FindProperty(n)!).ToList(); + + /// + /// Returns the the properties that are used to store the hierarchical partition key. + /// + /// The entity type. + /// The hierarchical partition key properties. + public static IReadOnlyList GetPartitionKeyProperties(this IMutableEntityType entityType) + => entityType.GetPartitionKeyPropertyNames().Select(n => entityType.FindProperty(n)!).ToList(); + + /// + /// Returns the the properties that are used to store the hierarchical partition key. + /// + /// The entity type. + /// The hierarchical partition key properties. + public static IReadOnlyList GetPartitionKeyProperties(this IConventionEntityType entityType) + => entityType.GetPartitionKeyPropertyNames().Select(n => entityType.FindProperty(n)!).ToList(); + + /// + /// Returns the the properties that are used to store the hierarchical partition key. + /// + /// The entity type. + /// The hierarchical partition key properties. + public static IReadOnlyList GetPartitionKeyProperties(this IEntityType entityType) + => entityType.GetPartitionKeyPropertyNames().Select(n => entityType.FindProperty(n)!).ToList(); /// /// Returns the name of the property that is used to store the ETag. diff --git a/src/EFCore.Cosmos/Extensions/CosmosQueryableExtensions.cs b/src/EFCore.Cosmos/Extensions/CosmosQueryableExtensions.cs index 603a2eb5cb0..1d6950c8ef3 100644 --- a/src/EFCore.Cosmos/Extensions/CosmosQueryableExtensions.cs +++ b/src/EFCore.Cosmos/Extensions/CosmosQueryableExtensions.cs @@ -18,7 +18,27 @@ namespace Microsoft.EntityFrameworkCore; public static class CosmosQueryableExtensions { internal static readonly MethodInfo WithPartitionKeyMethodInfo - = typeof(CosmosQueryableExtensions).GetTypeInfo().GetDeclaredMethod(nameof(WithPartitionKey))!; + = typeof(CosmosQueryableExtensions).GetTypeInfo() + .GetDeclaredMethods(nameof(WithPartitionKey)) + .Single(mi => mi.GetParameters().Length == 3); + + /// + /// Specify the partition key value for partition used for the query. Required when using + /// a resource token that provides permission based on a partition key for authentication. + /// + /// + /// See Querying data with EF Core, and + /// Accessing Azure Cosmos DB with EF Core for more information and examples. + /// + /// The type of entity being queried. + /// The source query. + /// The partition key value. + /// A new query with the set partition key. + public static IQueryable WithPartitionKey( + this IQueryable source, + [NotParameterized] string partitionKey) + where TEntity : class + => WithPartitionKey(source, partitionKey, []); /// /// Specify the partition key for partition used for the query. Required when using @@ -30,14 +50,17 @@ internal static readonly MethodInfo WithPartitionKeyMethodInfo /// /// The type of entity being queried. /// The source query. - /// The partition key. + /// The partition key value. + /// Additional values for hierarchical partitions. /// A new query with the set partition key. public static IQueryable WithPartitionKey( this IQueryable source, - [NotParameterized] string partitionKey) + [NotParameterized] object partitionKeyValue, + [NotParameterized] params object[] additionalPartitionKeyValues) where TEntity : class { - Check.NotNull(partitionKey, nameof(partitionKey)); + Check.NotNull(partitionKeyValue, nameof(partitionKeyValue)); + Check.HasNoNulls(additionalPartitionKeyValues, nameof(additionalPartitionKeyValues)); return source.Provider is EntityQueryProvider @@ -46,7 +69,8 @@ source.Provider is EntityQueryProvider instance: null, method: WithPartitionKeyMethodInfo.MakeGenericMethod(typeof(TEntity)), source.Expression, - Expression.Constant(partitionKey))) + Expression.Constant(partitionKeyValue, typeof(object)), + Expression.Constant(additionalPartitionKeyValues, typeof(object[])))) : source; } diff --git a/src/EFCore.Cosmos/Extensions/Internal/PartitionKeyBuilderExtensions.cs b/src/EFCore.Cosmos/Extensions/Internal/PartitionKeyBuilderExtensions.cs new file mode 100644 index 00000000000..f367d546489 --- /dev/null +++ b/src/EFCore.Cosmos/Extensions/Internal/PartitionKeyBuilderExtensions.cs @@ -0,0 +1,85 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using Microsoft.EntityFrameworkCore.Cosmos.Internal; + +namespace Microsoft.EntityFrameworkCore.Internal; + +/// +/// This is an internal API that supports the Entity Framework Core infrastructure and not subject to +/// the same compatibility standards as public APIs. It may be changed or removed without notice in +/// 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. +/// +public static class PartitionKeyBuilderExtensions +{ + /// + /// This is an internal API that supports the Entity Framework Core infrastructure and not subject to + /// the same compatibility standards as public APIs. It may be changed or removed without notice in + /// 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. + /// + public static PartitionKeyBuilder Add(this PartitionKeyBuilder builder, object? value, IProperty? property) + { + var converter = property?.GetTypeMapping().Converter; + if (converter != null) + { + value = converter.ConvertToProvider(value); + } + + if (value == null) + { + builder.AddNullValue(); + } + else + { + var expectedType = (converter?.ProviderClrType ?? property?.ClrType)?.UnwrapNullableType(); + if (value is string stringValue) + { + if (expectedType != null && expectedType != typeof(string)) + { + CheckType(typeof(string)); + } + + builder.Add(stringValue); + } + else if (value is bool boolValue) + { + if (expectedType != null && expectedType != typeof(bool)) + { + CheckType(typeof(bool)); + } + + builder.Add(boolValue); + } + else if (value.GetType().IsNumeric()) + { + if (expectedType != null && !expectedType.IsNumeric()) + { + CheckType(value.GetType()); + } + + builder.Add(Convert.ToDouble(value)); + } + else + { + throw new InvalidOperationException(CosmosStrings.PartitionKeyBadValue(value.GetType())); + } + + void CheckType(Type actualType) + { + if (expectedType != null && expectedType != actualType) + { + throw new InvalidOperationException( + CosmosStrings.PartitionKeyBadValueType( + expectedType.ShortDisplayName(), + property!.DeclaringType.DisplayName(), + property.Name, + actualType.DisplayName())); + } + } + } + + return builder; + } +} diff --git a/src/EFCore.Cosmos/Infrastructure/Internal/CosmosModelValidator.cs b/src/EFCore.Cosmos/Infrastructure/Internal/CosmosModelValidator.cs index 1fb048fd995..59e148b1537 100644 --- a/src/EFCore.Cosmos/Infrastructure/Internal/CosmosModelValidator.cs +++ b/src/EFCore.Cosmos/Infrastructure/Internal/CosmosModelValidator.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using Microsoft.EntityFrameworkCore.Cosmos.Diagnostics.Internal; using Microsoft.EntityFrameworkCore.Cosmos.Internal; using Microsoft.EntityFrameworkCore.Cosmos.Metadata.Internal; @@ -51,6 +52,7 @@ protected virtual void ValidateSharedContainerCompatibility( IModel model, IDiagnosticsLogger logger) { + // All entity types mapped to a single container must have the same container-level settings, most notably partition keys. var containers = new Dictionary>(); foreach (var entityType in model.GetEntityTypes().Where(et => et.FindPrimaryKey() != null)) { @@ -102,7 +104,7 @@ protected virtual void ValidateSharedContainerCompatibility( IDiagnosticsLogger logger) { var discriminatorValues = new Dictionary(); - IProperty? partitionKey = null; + List partitionKeyStoreNames = new(); int? analyticalTtl = null; int? defaultTtl = null; ThroughputProperties? throughput = null; @@ -110,39 +112,46 @@ protected virtual void ValidateSharedContainerCompatibility( foreach (var entityType in mappedTypes) { Check.DebugAssert(entityType.IsDocumentRoot(), "Only document roots expected here."); - var partitionKeyPropertyName = entityType.GetPartitionKeyPropertyName(); - if (partitionKeyPropertyName != null) + + var storeNames = entityType.GetPartitionKeyPropertyNames() + .Select(n => entityType.FindProperty(n)?.GetJsonPropertyName()) + .ToList(); + + if (firstEntityType is null) { - var nextPartitionKeyProperty = entityType.FindProperty(partitionKeyPropertyName)!; - if (partitionKey == null) + partitionKeyStoreNames = storeNames; + firstEntityType = entityType; + } + else + { + if (partitionKeyStoreNames.Count != storeNames.Count) { - if (firstEntityType != null) - { - throw new InvalidOperationException(CosmosStrings.NoPartitionKey(firstEntityType.DisplayName(), container)); - } - - partitionKey = nextPartitionKeyProperty; + throw new InvalidOperationException( + CosmosStrings.NoPartitionKey( + firstEntityType.DisplayName(), + string.Join(",", partitionKeyStoreNames), + entityType.DisplayName(), + string.Join(",", storeNames), + container)); } - else if (partitionKey.GetJsonPropertyName() != nextPartitionKeyProperty.GetJsonPropertyName()) + + for (var i = 0; i < storeNames.Count; i++) { - throw new InvalidOperationException( - CosmosStrings.PartitionKeyStoreNameMismatch( - partitionKey.Name, firstEntityType!.DisplayName(), partitionKey.GetJsonPropertyName(), - nextPartitionKeyProperty.Name, entityType.DisplayName(), nextPartitionKeyProperty.GetJsonPropertyName())); + if (!string.Equals(storeNames[i], partitionKeyStoreNames[i], StringComparison.Ordinal)) + { + throw new InvalidOperationException( + CosmosStrings.PartitionKeyStoreNameMismatch( + firstEntityType.GetPartitionKeyPropertyNames()[i], firstEntityType.DisplayName(), partitionKeyStoreNames[i], + entityType.GetPartitionKeyPropertyNames()[i], entityType.DisplayName(), storeNames[i])); + } } } - else if (partitionKey != null) - { - throw new InvalidOperationException(CosmosStrings.NoPartitionKey(entityType.DisplayName(), container)); - } if (mappedTypes.Count == 1) { break; } - firstEntityType ??= entityType; - if (entityType.ClrType.IsInstantiable() && entityType.GetContainingPropertyName() == null) { @@ -313,30 +322,39 @@ protected virtual void ValidateKeys( throw new InvalidOperationException(CosmosStrings.NoIdKey(entityType.DisplayName(), idProperty.Name)); } - var partitionKeyPropertyName = entityType.GetPartitionKeyPropertyName(); - if (partitionKeyPropertyName != null) + var partitionKeyPropertyNames = entityType.GetPartitionKeyPropertyNames(); + if (partitionKeyPropertyNames.Count == 0) { - var partitionKey = entityType.FindProperty(partitionKeyPropertyName); - if (partitionKey == null) + logger.NoPartitionKeyDefined(entityType); + } + else + { + foreach (var partitionKeyPropertyName in partitionKeyPropertyNames) { - throw new InvalidOperationException( - CosmosStrings.PartitionKeyMissingProperty(entityType.DisplayName(), partitionKeyPropertyName)); - } + var partitionKey = entityType.FindProperty(partitionKeyPropertyName); + if (partitionKey == null) + { + throw new InvalidOperationException( + CosmosStrings.PartitionKeyMissingProperty(entityType.DisplayName(), partitionKeyPropertyName)); + } - var partitionKeyType = partitionKey.GetTypeMapping().Converter?.ProviderClrType - ?? partitionKey.ClrType; - if (partitionKeyType != typeof(string)) - { - throw new InvalidOperationException( - CosmosStrings.PartitionKeyNonStringStoreType( - partitionKeyPropertyName, entityType.DisplayName(), partitionKeyType.ShortDisplayName())); - } + var partitionKeyType = (partitionKey.GetTypeMapping().Converter?.ProviderClrType + ?? partitionKey.ClrType).UnwrapNullableType(); + if (partitionKeyType != typeof(string) + && !partitionKeyType.IsNumeric() + && partitionKeyType != typeof(bool)) + { + throw new InvalidOperationException( + CosmosStrings.PartitionKeyBadStoreType( + partitionKeyPropertyName, entityType.DisplayName(), partitionKeyType.ShortDisplayName())); + } - if (!partitionKey.GetContainingKeys().Any(k => k.Properties.Contains(idProperty))) - { - throw new InvalidOperationException( - CosmosStrings.NoPartitionKeyKey( - entityType.DisplayName(), partitionKeyPropertyName, idProperty.Name)); + if (!partitionKey.GetContainingKeys().Any(k => k.Properties.Contains(idProperty))) + { + throw new InvalidOperationException( + CosmosStrings.NoPartitionKeyKey( + entityType.DisplayName(), partitionKeyPropertyName, idProperty.Name)); + } } } } diff --git a/src/EFCore.Cosmos/Metadata/Conventions/CosmosKeyDiscoveryConvention.cs b/src/EFCore.Cosmos/Metadata/Conventions/CosmosKeyDiscoveryConvention.cs index c88e74917b7..7610f92e876 100644 --- a/src/EFCore.Cosmos/Metadata/Conventions/CosmosKeyDiscoveryConvention.cs +++ b/src/EFCore.Cosmos/Metadata/Conventions/CosmosKeyDiscoveryConvention.cs @@ -41,7 +41,7 @@ public virtual void ProcessEntityTypeAnnotationChanged( IConventionAnnotation? oldAnnotation, IConventionContext context) { - if (name == CosmosAnnotationNames.PartitionKeyName) + if (name == CosmosAnnotationNames.PartitionKeyNames) { TryConfigurePrimaryKey(entityTypeBuilder); } @@ -55,10 +55,9 @@ protected override void ProcessKeyProperties(IList keyPrope return; } - var partitionKey = entityType.GetPartitionKeyPropertyName(); - if (partitionKey != null) + foreach (var propertyName in entityType.GetPartitionKeyPropertyNames()) { - var partitionKeyProperty = entityType.FindProperty(partitionKey); + var partitionKeyProperty = entityType.FindProperty(propertyName); if (partitionKeyProperty != null && !keyProperties.Contains(partitionKeyProperty)) { diff --git a/src/EFCore.Cosmos/Metadata/Conventions/CosmosManyToManyJoinEntityTypeConvention.cs b/src/EFCore.Cosmos/Metadata/Conventions/CosmosManyToManyJoinEntityTypeConvention.cs index cd90484f570..c7dfb7a2a10 100644 --- a/src/EFCore.Cosmos/Metadata/Conventions/CosmosManyToManyJoinEntityTypeConvention.cs +++ b/src/EFCore.Cosmos/Metadata/Conventions/CosmosManyToManyJoinEntityTypeConvention.cs @@ -41,7 +41,7 @@ public virtual void ProcessEntityTypeAnnotationChanged( IConventionAnnotation? oldAnnotation, IConventionContext context) { - if (name is CosmosAnnotationNames.PartitionKeyName or CosmosAnnotationNames.ContainerName) + if (name is CosmosAnnotationNames.PartitionKeyNames or CosmosAnnotationNames.ContainerName) { foreach (var skipNavigation in entityTypeBuilder.Metadata.GetSkipNavigations()) { @@ -84,18 +84,24 @@ private void ConfigurePartitionKeyJoinEntityType( IConventionSkipNavigation skipNavigation, IConventionEntityTypeBuilder joinEntityTypeBuilder) { - var principalPartitionKey = skipNavigation.DeclaringEntityType.GetPartitionKeyProperty()!; - var partitionKey = joinEntityTypeBuilder.Property(principalPartitionKey.ClrType, principalPartitionKey.Name)!.Metadata; - joinEntityTypeBuilder.HasPartitionKey(partitionKey.Name); + // The join entity type should belong to the same partition as the entity types on either side. + var principalProperties = skipNavigation.DeclaringEntityType.GetPartitionKeyProperties(); + if (!principalProperties.Any() || principalProperties.Any(p => p is null)) + { + return; + } + + var partitionKeyProperties = principalProperties.Select(p => joinEntityTypeBuilder.Property(p!.ClrType, p.Name)!.Metadata).ToList(); + joinEntityTypeBuilder.HasPartitionKey(partitionKeyProperties.Select(p => p.Name).ToList()); - CreateSkipNavigationForeignKey(skipNavigation, joinEntityTypeBuilder, partitionKey); - CreateSkipNavigationForeignKey(skipNavigation.Inverse!, joinEntityTypeBuilder, partitionKey); + CreateSkipNavigationForeignKey(skipNavigation, joinEntityTypeBuilder, partitionKeyProperties); + CreateSkipNavigationForeignKey(skipNavigation.Inverse!, joinEntityTypeBuilder, partitionKeyProperties); } private void CreateSkipNavigationForeignKey( IConventionSkipNavigation skipNavigation, IConventionEntityTypeBuilder joinEntityTypeBuilder, - IConventionProperty partitionKeyProperty) + List partitionKeyProperties) { if (skipNavigation.ForeignKey != null && !skipNavigation.Builder.CanSetForeignKey(null)) @@ -105,22 +111,19 @@ private void CreateSkipNavigationForeignKey( var principalKey = skipNavigation.DeclaringEntityType.FindPrimaryKey(); if (principalKey == null - || principalKey.Properties.All(p => p.Name != partitionKeyProperty.Name)) + || principalKey.Properties.All(p => !partitionKeyProperties.Select(e => e.Name).Contains(p.Name))) { CreateSkipNavigationForeignKey(skipNavigation, joinEntityTypeBuilder); return; } - if (skipNavigation.ForeignKey?.Properties.Contains(partitionKeyProperty) == true) - { - return; - } - + // Any partition key property that already exists should be used for the FK, otherwise a new property is created. var dependentProperties = new IConventionProperty[principalKey.Properties.Count]; for (var i = 0; i < principalKey.Properties.Count; i++) { var principalProperty = principalKey.Properties[i]; - if (principalProperty.Name == partitionKeyProperty.Name) + var partitionKeyProperty = partitionKeyProperties.FirstOrDefault(p => p.Name == principalProperty.Name); + if (partitionKeyProperty != null) { dependentProperties[i] = partitionKeyProperty; } @@ -149,12 +152,12 @@ private void ProcessJoinPartitionKey(IConventionSkipNavigation skipNavigation) var joinEntityTypeBuilder = joinEntityType.Builder; if (ShouldSharePartitionKey(skipNavigation)) { - var principalPartitionKey = skipNavigation.DeclaringEntityType.GetPartitionKeyProperty()!; - var partitionKey = joinEntityType.GetPartitionKeyProperty(); - if ((partitionKey != null - && (!joinEntityTypeBuilder.CanSetPartitionKey(principalPartitionKey.Name) - || (skipNavigation.ForeignKey!.Properties.Contains(partitionKey) - && inverseSkipNavigation.ForeignKey!.Properties.Contains(partitionKey)))) + var principalPartitionProperties = skipNavigation.DeclaringEntityType.GetPartitionKeyProperties(); + var partitionKeyProperties = joinEntityType.GetPartitionKeyProperties(); + if ((partitionKeyProperties.Any() + && (!joinEntityTypeBuilder.CanSetPartitionKey(principalPartitionProperties.Select(p => p!.Name).ToList()) + || (partitionKeyProperties.All(p => skipNavigation.ForeignKey!.Properties.Contains(p)) + && partitionKeyProperties.All(p => inverseSkipNavigation.ForeignKey!.Properties.Contains(p))))) || !skipNavigation.Builder.CanSetForeignKey(null) || !inverseSkipNavigation.Builder.CanSetForeignKey(null)) { @@ -165,12 +168,12 @@ private void ProcessJoinPartitionKey(IConventionSkipNavigation skipNavigation) } else { - var partitionKey = joinEntityType.GetPartitionKeyProperty(); - if (partitionKey != null - && joinEntityTypeBuilder.HasPartitionKey(null) != null - && ((skipNavigation.ForeignKey!.Properties.Contains(partitionKey) + var partitionKeyProperties = joinEntityType.GetPartitionKeyProperties(); + if (partitionKeyProperties.Any() + && joinEntityTypeBuilder.HasPartitionKey((IReadOnlyList?)null) != null + && ((partitionKeyProperties.Any(p => skipNavigation.ForeignKey!.Properties.Contains(p)) && skipNavigation.Builder.CanSetForeignKey(null)) - || (inverseSkipNavigation.ForeignKey!.Properties.Contains(partitionKey) + || (partitionKeyProperties.Any(p => inverseSkipNavigation.ForeignKey!.Properties.Contains(p)) && inverseSkipNavigation.Builder.CanSetForeignKey(null)))) { CreateSkipNavigationForeignKey(skipNavigation, joinEntityTypeBuilder); @@ -182,7 +185,7 @@ private void ProcessJoinPartitionKey(IConventionSkipNavigation skipNavigation) private static bool ShouldSharePartitionKey(IConventionSkipNavigation skipNavigation) => skipNavigation.DeclaringEntityType.GetContainer() == skipNavigation.TargetEntityType.GetContainer() - && skipNavigation.DeclaringEntityType.GetPartitionKeyPropertyName() != null - && skipNavigation.Inverse?.DeclaringEntityType.GetPartitionKeyPropertyName() - == skipNavigation.DeclaringEntityType.GetPartitionKeyPropertyName(); + && skipNavigation.DeclaringEntityType.GetPartitionKeyPropertyNames().Any() + && (skipNavigation.Inverse?.DeclaringEntityType.GetPartitionKeyPropertyNames() + .SequenceEqual(skipNavigation.DeclaringEntityType.GetPartitionKeyPropertyNames(), StringComparer.Ordinal) == true); } diff --git a/src/EFCore.Cosmos/Metadata/Conventions/StoreKeyConvention.cs b/src/EFCore.Cosmos/Metadata/Conventions/StoreKeyConvention.cs index 343f536f398..7aa0413bb61 100644 --- a/src/EFCore.Cosmos/Metadata/Conventions/StoreKeyConvention.cs +++ b/src/EFCore.Cosmos/Metadata/Conventions/StoreKeyConvention.cs @@ -100,20 +100,33 @@ private static void ProcessIdProperty(IConventionEntityTypeBuilder entityTypeBui } } - var partitionKey = entityType.GetPartitionKeyPropertyName(); - if (partitionKey != null) + var partitionKeyProperties = entityType.GetPartitionKeyProperties(); + if (partitionKeyProperties.Any() + && partitionKeyProperties.All(p => p != null)) { - var partitionKeyProperty = entityType.FindProperty(partitionKey); - if (partitionKeyProperty == null - || partitionKeyProperty == idProperty) + if (partitionKeyProperties.Count == 1 + && partitionKeyProperties[0] == idProperty) { - newKey = entityTypeBuilder.HasKey(new[] { idProperty })?.Metadata; + newKey = entityTypeBuilder.HasKey([idProperty])?.Metadata; } else { - if (entityType.FindKey(new[] { partitionKeyProperty, idProperty }) == null) + var keyContainsPartitionProperties = false; + var keys = entityType.GetKeys().ToList(); + foreach (var key in keys) { - newKey = entityTypeBuilder.HasKey(new[] { idProperty, partitionKeyProperty })?.Metadata; + if (key.Properties.Contains(idProperty) + && partitionKeyProperties.All(p => key.Properties.Contains(p))) + { + keyContainsPartitionProperties = true; + break; + } + } + + if (!keyContainsPartitionProperties) + { + var properties = new[] { idProperty }.Concat(partitionKeyProperties).ToList(); + newKey = entityTypeBuilder.HasKey(properties!)?.Metadata; } entityTypeBuilder.HasNoKey(new[] { idProperty }); @@ -121,7 +134,7 @@ private static void ProcessIdProperty(IConventionEntityTypeBuilder entityTypeBui } else { - newKey = entityTypeBuilder.HasKey(new[] { idProperty })?.Metadata; + newKey = entityTypeBuilder.HasKey([idProperty])?.Metadata; } } } @@ -130,14 +143,17 @@ private static void ProcessIdProperty(IConventionEntityTypeBuilder entityTypeBui idProperty = entityType.FindDeclaredProperty(DefaultIdPropertyName); } + // If we created a new key above that maps to the __id property, then remove any existing keys + // that were previously mapped to it. if (idProperty != null - && idProperty.GetContainingKeys().Count() > (newKey == null ? 0 : 1)) + && newKey != null) { - foreach (var key in idProperty.GetContainingKeys().ToList()) + var oldKeys = idProperty.GetContainingKeys().ToList(); + foreach (var oldKey in oldKeys) { - if (key != newKey) + if (oldKey != newKey) { - key.DeclaringEntityType.Builder.HasNoKey(key); + oldKey.DeclaringEntityType.Builder.HasNoKey(oldKey); } } } @@ -264,17 +280,24 @@ public virtual void ProcessEntityTypeAnnotationChanged( { ProcessIdProperty(entityTypeBuilder); } - else if (name == CosmosAnnotationNames.PartitionKeyName) + else if (name == CosmosAnnotationNames.PartitionKeyNames) { - var oldName = (string?)oldAnnotation?.Value; - if (oldName != null) + var oldNames = (IReadOnlyList?)oldAnnotation?.Value; + if (oldNames != null) { - var oldPartitionKeyProperty = entityTypeBuilder.Metadata.FindProperty(oldName); - if (oldPartitionKeyProperty != null) + var newNames = (IReadOnlyList?)annotation?.Value; + foreach (var oldName in oldNames) { - foreach (var key in oldPartitionKeyProperty.GetContainingKeys().ToList()) + if (newNames?.Contains(oldName) != true) { - key.DeclaringEntityType.Builder.HasNoKey(key); + var oldPartitionKeyProperty = entityTypeBuilder.Metadata.FindProperty(oldName); + if (oldPartitionKeyProperty != null) + { + foreach (var key in oldPartitionKeyProperty.GetContainingKeys().ToList()) + { + key.DeclaringEntityType.Builder.HasNoKey(key); + } + } } } } diff --git a/src/EFCore.Cosmos/Metadata/Internal/CosmosAnnotationNames.cs b/src/EFCore.Cosmos/Metadata/Internal/CosmosAnnotationNames.cs index d81ca49f4a1..6c0020aeb62 100644 --- a/src/EFCore.Cosmos/Metadata/Internal/CosmosAnnotationNames.cs +++ b/src/EFCore.Cosmos/Metadata/Internal/CosmosAnnotationNames.cs @@ -41,7 +41,7 @@ public static class CosmosAnnotationNames /// 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. /// - public const string PartitionKeyName = Prefix + "PartitionKeyName"; + public const string PartitionKeyNames = Prefix + "PartitionKeyNames"; /// /// This is an internal API that supports the Entity Framework Core infrastructure and not subject to diff --git a/src/EFCore.Cosmos/Properties/CosmosStrings.Designer.cs b/src/EFCore.Cosmos/Properties/CosmosStrings.Designer.cs index aecd79717d0..ad7425bf61c 100644 --- a/src/EFCore.Cosmos/Properties/CosmosStrings.Designer.cs +++ b/src/EFCore.Cosmos/Properties/CosmosStrings.Designer.cs @@ -190,12 +190,12 @@ public static string NonETagConcurrencyToken(object? entityType, object? propert entityType, property); /// - /// The entity type '{entityType}' does not have a partition key set, but is mapped to the container '{container}' shared by entity types with partition keys. Configure a compatible partition key on '{entityType}'. + /// The partition key properties for entity type '{entityType1}' are '{props1}', while the partition key properties for entity type '{entityType2}' are '{props2}', and both entity types are mapped to the container '{containerName}'. All entity types mapped to the same container must have compatible partition keys defined. /// - public static string NoPartitionKey(object? entityType, object? container) + public static string NoPartitionKey(object? entityType1, object? props1, object? entityType2, object? props2, object? containerName) => string.Format( - GetString("NoPartitionKey", nameof(entityType), nameof(container)), - entityType, container); + GetString("NoPartitionKey", nameof(entityType1), nameof(props1), nameof(entityType2), nameof(props2), nameof(containerName)), + entityType1, props1, entityType2, props2, containerName); /// /// The entity type '{entityType}' does not have a key declared on '{partitionKey}' and '{idProperty}' properties. Add a key to '{entityType}' that contains '{partitionKey}' and '{idProperty}'. @@ -271,6 +271,30 @@ public static string OwnedTypeDifferentContainer(object? entityType, object? own GetString("OwnedTypeDifferentContainer", nameof(entityType), nameof(owner), nameof(container)), entityType, owner, container); + /// + /// The type of the partition key property '{property}' on '{entityType}' is '{propertyType}'. All partition key property types must be numeric, Boolean, or string, or converted to one of these types. + /// + public static string PartitionKeyBadStoreType(object? property, object? entityType, object? propertyType) + => string.Format( + GetString("PartitionKeyBadStoreType", nameof(property), nameof(entityType), nameof(propertyType)), + property, entityType, propertyType); + + /// + /// The partition key value is of type '{valueType}' which is not valid for Cosmos partition keys. All partition key properties values must be numeric, Boolean, or string, or converted to one of these types. + /// + public static string PartitionKeyBadValue(object? valueType) + => string.Format( + GetString("PartitionKeyBadValue", nameof(valueType)), + valueType); + + /// + /// The partition key value supplied for '{propertyType}' property '{entityType}.{property}' is of type '{valueType}'. Partition key values must be of a type assignable to the property. + /// + public static string PartitionKeyBadValueType(object? propertyType, object? entityType, object? property, object? valueType) + => string.Format( + GetString("PartitionKeyBadValueType", nameof(propertyType), nameof(entityType), nameof(property), nameof(valueType)), + propertyType, entityType, property, valueType); + /// /// The partition key specified in the 'WithPartitionKey' call '{partitionKey1}' and the partition key specified in the 'Where' predicate '{partitionKey2}' must be identical to return any results. Remove one of them. /// @@ -293,14 +317,6 @@ public static string PartitionKeyMissingProperty(object? entityType, object? pro GetString("PartitionKeyMissingProperty", nameof(entityType), nameof(property)), entityType, property); - /// - /// The type of the partition key property '{property}' on '{entityType}' is '{propertyType}'. All partition key properties need to be strings or have a string value converter. - /// - public static string PartitionKeyNonStringStoreType(object? property, object? entityType, object? propertyType) - => string.Format( - GetString("PartitionKeyNonStringStoreType", nameof(property), nameof(entityType), nameof(propertyType)), - property, entityType, propertyType); - /// /// The partition key property '{property1}' on '{entityType1}' is mapped as '{storeName1}', but the partition key property '{property2}' on '{entityType2}' is mapped as '{storeName2}'. All partition key properties need to be mapped to the same store property for entity types mapped to the same container. /// @@ -381,6 +397,12 @@ public static string UpdateStoreException(object? itemId) public static string VisitChildrenMustBeOverridden => GetString("VisitChildrenMustBeOverridden"); + /// + /// 'WithPartitionKeyMethodInfo' can only be called on a entity query root. See https://aka.ms/efdocs-cosmos-partition-keys for more information. + /// + public static string WithPartitionKeyBadNode + => GetString("WithPartitionKeyBadNode"); + private static string GetString(string name, params string[] formatterNames) { var value = _resourceManager.GetString(name)!; @@ -579,6 +601,31 @@ public static FallbackEventDefinition LogExecutedReadNext(IDiagnosticsLogger log return (EventDefinition)definition; } + /// + /// No partition key has been configured for entity type '{entityType}'. It is highly recommended that an appropriate partition key be defined. See https://aka.ms/efdocs-cosmos-partition-keys for more information. + /// + public static EventDefinition LogNoPartitionKeyDefined(IDiagnosticsLogger logger) + { + var definition = ((Diagnostics.Internal.CosmosLoggingDefinitions)logger.Definitions).LogNoPartitionKeyDefined; + if (definition == null) + { + definition = NonCapturingLazyInitializer.EnsureInitialized( + ref ((Diagnostics.Internal.CosmosLoggingDefinitions)logger.Definitions).LogNoPartitionKeyDefined, + logger, + static logger => new EventDefinition( + logger.Options, + CosmosEventId.NoPartitionKeyDefined, + LogLevel.Warning, + "CosmosEventId.NoPartitionKeyDefined", + level => LoggerMessage.Define( + level, + CosmosEventId.NoPartitionKeyDefined, + _resourceManager.GetString("LogNoPartitionKeyDefined")!))); + } + + return (EventDefinition)definition; + } + /// /// Azure Cosmos DB does not support synchronous I/O. Make sure to use and correctly await only async methods when using Entity Framework Core to access Azure Cosmos DB. See https://aka.ms/ef-cosmos-nosync for more information. /// diff --git a/src/EFCore.Cosmos/Properties/CosmosStrings.resx b/src/EFCore.Cosmos/Properties/CosmosStrings.resx index 0709e132b3a..3243c41e5c1 100644 --- a/src/EFCore.Cosmos/Properties/CosmosStrings.resx +++ b/src/EFCore.Cosmos/Properties/CosmosStrings.resx @@ -187,6 +187,10 @@ Executing SQL query for container '{containerId}' in partition '{partitionKey}' [Parameters=[{parameters}]]{newLine}{commandText} Information CosmosEventId.ExecutingSqlQuery string string? string string string + + No partition key has been configured for entity type '{entityType}'. It is highly recommended that an appropriate partition key be defined. See https://aka.ms/efdocs-cosmos-partition-keys for more information. + Warning CosmosEventId.NoPartitionKeyDefined string + Azure Cosmos DB does not support synchronous I/O. Make sure to use and correctly await only async methods when using Entity Framework Core to access Azure Cosmos DB. See https://aka.ms/ef-cosmos-nosync for more information. Error CosmosEventId.SyncNotSupported @@ -216,7 +220,7 @@ The entity type '{entityType}' has property '{property}' configured as a concurrency token, but only a property mapped to '_etag' is supported as a concurrency token. Consider using 'PropertyBuilder.IsETagConcurrency'. - The entity type '{entityType}' does not have a partition key set, but is mapped to the container '{container}' shared by entity types with partition keys. Configure a compatible partition key on '{entityType}'. + The partition key properties for entity type '{entityType1}' are '{props1}', while the partition key properties for entity type '{entityType2}' are '{props2}', and both entity types are mapped to the container '{containerName}'. All entity types mapped to the same container must have compatible partition keys defined. The entity type '{entityType}' does not have a key declared on '{partitionKey}' and '{idProperty}' properties. Add a key to '{entityType}' that contains '{partitionKey}' and '{idProperty}'. @@ -248,6 +252,15 @@ The entity type '{entityType}' is owned by the entity type '{owner}', but is mapped to the container '{container}'. Owned types mapped to a container directly are not supported, remove this configuration to allow the owned type to be embedded in the same document as the owner. + + The type of the partition key property '{property}' on '{entityType}' is '{propertyType}'. All partition key property types must be numeric, Boolean, or string, or converted to one of these types. + + + The partition key value is of type '{valueType}' which is not valid for Cosmos partition keys. All partition key properties values must be numeric, Boolean, or string, or converted to one of these types. + + + The partition key value supplied for '{propertyType}' property '{entityType}.{property}' is of type '{valueType}'. Partition key values must be of a type assignable to the property. + The partition key specified in the 'WithPartitionKey' call '{partitionKey1}' and the partition key specified in the 'Where' predicate '{partitionKey2}' must be identical to return any results. Remove one of them. @@ -257,9 +270,6 @@ The partition key for entity type '{entityType}' is set to '{property}', but there is no property with that name. - - The type of the partition key property '{property}' on '{entityType}' is '{propertyType}'. All partition key properties need to be strings or have a string value converter. - The partition key property '{property1}' on '{entityType1}' is mapped as '{storeName1}', but the partition key property '{property2}' on '{entityType2}' is mapped as '{storeName2}'. All partition key properties need to be mapped to the same store property for entity types mapped to the same container. @@ -293,4 +303,7 @@ 'VisitChildren' must be overridden in the class deriving from 'SqlExpression'. + + 'WithPartitionKeyMethodInfo' can only be called on a entity query root. See https://aka.ms/efdocs-cosmos-partition-keys for more information. + \ No newline at end of file diff --git a/src/EFCore.Cosmos/Query/Internal/CosmosQueryCompilationContext.cs b/src/EFCore.Cosmos/Query/Internal/CosmosQueryCompilationContext.cs index 471cb10035e..49d99d3712d 100644 --- a/src/EFCore.Cosmos/Query/Internal/CosmosQueryCompilationContext.cs +++ b/src/EFCore.Cosmos/Query/Internal/CosmosQueryCompilationContext.cs @@ -18,5 +18,5 @@ public class CosmosQueryCompilationContext(QueryCompilationContextDependencies d /// 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. /// - public virtual string? PartitionKeyFromExtension { get; internal set; } + public virtual PartitionKey? PartitionKeyValueFromExtension { get; internal set; } } diff --git a/src/EFCore.Cosmos/Query/Internal/CosmosQueryMetadataExtractingExpressionVisitor.cs b/src/EFCore.Cosmos/Query/Internal/CosmosQueryMetadataExtractingExpressionVisitor.cs index 0fac66d6582..4e0dd73b3a9 100644 --- a/src/EFCore.Cosmos/Query/Internal/CosmosQueryMetadataExtractingExpressionVisitor.cs +++ b/src/EFCore.Cosmos/Query/Internal/CosmosQueryMetadataExtractingExpressionVisitor.cs @@ -1,6 +1,9 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using Microsoft.EntityFrameworkCore.Cosmos.Internal; +using Microsoft.EntityFrameworkCore.Internal; + namespace Microsoft.EntityFrameworkCore.Cosmos.Query.Internal; /// @@ -25,7 +28,30 @@ protected override Expression VisitMethodCall(MethodCallExpression methodCallExp { var innerQueryable = Visit(methodCallExpression.Arguments[0]); - cosmosQueryCompilationContext.PartitionKeyFromExtension = methodCallExpression.Arguments[1].GetConstantValue(); + var firstValue = methodCallExpression.Arguments[1].GetConstantValue(); + if (firstValue == null) + { + cosmosQueryCompilationContext.PartitionKeyValueFromExtension = PartitionKey.None; + } + else + { + if (innerQueryable is EntityQueryRootExpression rootExpression) + { + var partitionKeyProperties = rootExpression.EntityType.GetPartitionKeyProperties(); + var allValues = new[] { firstValue }.Concat(methodCallExpression.Arguments[2].GetConstantValue()).ToList(); + var builder = new PartitionKeyBuilder(); + for (var i = 0; i < allValues.Count; i++) + { + builder.Add(allValues[i], partitionKeyProperties[i]); + } + + cosmosQueryCompilationContext.PartitionKeyValueFromExtension = builder.Build(); + } + else + { + throw new InvalidOperationException(CosmosStrings.WithPartitionKeyBadNode); + } + } return innerQueryable; } diff --git a/src/EFCore.Cosmos/Query/Internal/CosmosQueryableMethodTranslatingExpressionVisitor.cs b/src/EFCore.Cosmos/Query/Internal/CosmosQueryableMethodTranslatingExpressionVisitor.cs index 39945e26347..6a122009775 100644 --- a/src/EFCore.Cosmos/Query/Internal/CosmosQueryableMethodTranslatingExpressionVisitor.cs +++ b/src/EFCore.Cosmos/Query/Internal/CosmosQueryableMethodTranslatingExpressionVisitor.cs @@ -107,11 +107,11 @@ protected CosmosQueryableMethodTranslatingExpressionVisitor( var entityTypePrimaryKeyProperties = entityType.FindPrimaryKey()!.Properties; var idProperty = entityType.GetProperties() .First(p => p.GetJsonPropertyName() == StoreKeyConvention.IdPropertyJsonName); + var partitionKeyProperties = entityType.GetPartitionKeyProperties(); - if (TryGetPartitionKeyProperty(entityType, out var partitionKeyProperty) - && entityTypePrimaryKeyProperties.SequenceEqual(queryProperties) - && (partitionKeyProperty == null - || entityTypePrimaryKeyProperties.Contains(partitionKeyProperty)) + if (entityTypePrimaryKeyProperties.SequenceEqual(queryProperties) + && (!partitionKeyProperties.Any() + || partitionKeyProperties.All(p => entityTypePrimaryKeyProperties.Contains(p))) && (idProperty.GetValueGeneratorFactory() != null || entityTypePrimaryKeyProperties.Contains(idProperty))) { @@ -189,19 +189,6 @@ static bool ExtractPartitionKeyFromPredicate( return false; } - - static bool TryGetPartitionKeyProperty(IEntityType entityType, out IProperty? partitionKeyProperty) - { - var partitionKeyPropertyName = entityType.GetPartitionKeyPropertyName(); - if (partitionKeyPropertyName is null) - { - partitionKeyProperty = null; - return true; - } - - partitionKeyProperty = entityType.FindProperty(partitionKeyPropertyName)!; - return true; - } } /// @@ -292,8 +279,7 @@ private static ShapedQueryExpression CreateShapedQueryExpression(IEntityType ent } var projection = (SqlExpression)selectExpression.GetMappedProjection(new ProjectionMember()); - projection = _sqlExpressionFactory.Function( - "AVG", new[] { projection }, projection.Type, projection.TypeMapping); + projection = _sqlExpressionFactory.Function("AVG", new[] { projection }, projection.Type, projection.TypeMapping); return AggregateResultShaper(source, projection, throwOnNullResult: true, resultType); } @@ -868,8 +854,7 @@ protected override ShapedQueryExpression TranslateSelect(ShapedQueryExpression s var serverOutputType = resultType.UnwrapNullableType(); var projection = (SqlExpression)selectExpression.GetMappedProjection(new ProjectionMember()); - projection = _sqlExpressionFactory.Function( - "SUM", new[] { projection }, serverOutputType, projection.TypeMapping); + projection = _sqlExpressionFactory.Function("SUM", new[] { projection }, serverOutputType, projection.TypeMapping); return AggregateResultShaper(source, projection, throwOnNullResult: false, resultType); } @@ -944,19 +929,32 @@ protected override ShapedQueryExpression TranslateSelect(ShapedQueryExpression s /// protected override ShapedQueryExpression? TranslateWhere(ShapedQueryExpression source, LambdaExpression predicate) { - if (source.ShaperExpression is StructuralTypeShaperExpression { StructuralType: IEntityType entityType } - && entityType.GetPartitionKeyPropertyName() is string partitionKeyPropertyName - && TryExtractPartitionKey(predicate.Body, entityType, out var newPredicate) is Expression partitionKeyValue) + if (source.ShaperExpression is StructuralTypeShaperExpression { StructuralType: IEntityType entityType } entityShaperExpression + && entityType.GetPartitionKeyPropertyNames().FirstOrDefault() != null) { - var partitionKeyProperty = entityType.GetProperty(partitionKeyPropertyName); - ((SelectExpression)source.QueryExpression).SetPartitionKey(partitionKeyProperty, partitionKeyValue); - - if (newPredicate == null) + List<(Expression Expression, IProperty Property)?> partitionKeyValues = new(); + if (TryExtractPartitionKey(predicate.Body, entityType, out var newPredicate, partitionKeyValues)) { - return source; - } + foreach (var propertyName in entityType.GetPartitionKeyPropertyNames()) + { + var partitionKeyValue = partitionKeyValues.FirstOrDefault(p => p!.Value.Property.Name == propertyName); + if (partitionKeyValue == null) + { + newPredicate = null; + break; + } - predicate = Expression.Lambda(newPredicate, predicate.Parameters); + ((SelectExpression)source.QueryExpression).AddPartitionKey( + partitionKeyValue.Value.Property, partitionKeyValue.Value.Expression); + } + + if (newPredicate == null) + { + return source; + } + + predicate = Expression.Lambda(newPredicate, predicate.Parameters); + } } if (TranslateLambdaExpression(source, predicate) is SqlExpression translation) @@ -968,22 +966,37 @@ protected override ShapedQueryExpression TranslateSelect(ShapedQueryExpression s return null; - Expression? TryExtractPartitionKey(Expression expression, IEntityType entityType, out Expression? updatedPredicate) + bool TryExtractPartitionKey( + Expression expression, + IEntityType entityType, + out Expression? updatedPredicate, + List<(Expression, IProperty)?> partitionKeyValues) { + updatedPredicate = null; if (expression is BinaryExpression binaryExpression) { - if (GetPartitionKeyValue(binaryExpression, entityType) is Expression pkv) + if (TryGetPartitionKeyValue(binaryExpression, entityType, out var valueExpression, out var property)) { - partitionKeyValue = pkv; - updatedPredicate = null; - return partitionKeyValue; + partitionKeyValues.Add((valueExpression!, property!)); + return true; } if (binaryExpression.NodeType == ExpressionType.AndAlso) { - var leftPartitionKeyValue = TryExtractPartitionKey(binaryExpression.Left, entityType, out var leftPredicate); - var rightPartitionKeyValue = TryExtractPartitionKey(binaryExpression.Right, entityType, out var rightPredicate); - if ((leftPartitionKeyValue != null) ^ (rightPartitionKeyValue != null)) + var foundInRight = TryExtractPartitionKey(binaryExpression.Left, entityType, out var leftPredicate, partitionKeyValues); + + var foundInLeft = TryExtractPartitionKey( + binaryExpression.Right, + entityType, + out var rightPredicate, + partitionKeyValues); + + if (foundInLeft && foundInRight) + { + return true; + } + + if (foundInLeft || foundInRight) { updatedPredicate = leftPredicate != null ? rightPredicate != null @@ -991,42 +1004,64 @@ protected override ShapedQueryExpression TranslateSelect(ShapedQueryExpression s : leftPredicate : rightPredicate; - return leftPartitionKeyValue ?? rightPartitionKeyValue; + return true; } } } + else if (expression.NodeType == ExpressionType.MemberAccess + && expression.Type == typeof(bool)) + { + if (IsPartitionKeyPropertyAccess(expression, entityType, out var property)) + { + partitionKeyValues.Add((Expression.Constant(true), property!)); + return true; + } + } + else if (expression.NodeType == ExpressionType.Not) + { + if (IsPartitionKeyPropertyAccess(((UnaryExpression)expression).Operand, entityType, out var property)) + { + partitionKeyValues.Add((Expression.Constant(false), property!)); + return true; + } + } updatedPredicate = expression; - - return null; + return false; } - Expression? GetPartitionKeyValue(BinaryExpression binaryExpression, IEntityType entityType) + bool TryGetPartitionKeyValue( + BinaryExpression binaryExpression, + IEntityType entityType, + out Expression? expression, + out IProperty? property) { if (binaryExpression.NodeType == ExpressionType.Equal) { - var valueExpression = IsPartitionKeyPropertyAccess(binaryExpression.Left, entityType) + expression = IsPartitionKeyPropertyAccess(binaryExpression.Left, entityType, out property) ? binaryExpression.Right - : IsPartitionKeyPropertyAccess(binaryExpression.Right, entityType) + : IsPartitionKeyPropertyAccess(binaryExpression.Right, entityType, out property) ? binaryExpression.Left : null; - if (valueExpression is ConstantExpression - || (valueExpression is ParameterExpression valueParameterExpression + if (expression is ConstantExpression + || (expression is ParameterExpression valueParameterExpression && valueParameterExpression.Name? .StartsWith(QueryCompilationContext.QueryParameterPrefix, StringComparison.Ordinal) == true)) { - return valueExpression; + return true; } } - return null; + expression = null; + property = null; + return false; } - bool IsPartitionKeyPropertyAccess(Expression expression, IEntityType entityType) + bool IsPartitionKeyPropertyAccess(Expression expression, IEntityType entityType, out IProperty? property) { - var property = expression switch + property = expression switch { MemberExpression memberExpression => entityType.FindProperty(memberExpression.Member.GetSimpleMemberName()), @@ -1038,7 +1073,7 @@ when methodCallExpression.TryGetIndexerArguments(_queryCompilationContext.Model, _ => null }; - return property != null && property.Name == entityType.GetPartitionKeyPropertyName(); + return property != null && entityType.GetPartitionKeyPropertyNames().Contains(property.Name); } } @@ -1072,8 +1107,7 @@ private static ShapedQueryExpression AggregateResultShaper( Type resultType) { var selectExpression = (SelectExpression)source.QueryExpression; - selectExpression.ReplaceProjectionMapping( - new Dictionary { { new ProjectionMember(), projection } }); + selectExpression.ReplaceProjectionMapping(new Dictionary { { new ProjectionMember(), projection } }); selectExpression.ClearOrdering(); diff --git a/src/EFCore.Cosmos/Query/Internal/CosmosShapedQueryCompilingExpressionVisitor.QueryingEnumerable.cs b/src/EFCore.Cosmos/Query/Internal/CosmosShapedQueryCompilingExpressionVisitor.QueryingEnumerable.cs index 86db21631dd..8fcfe871c05 100644 --- a/src/EFCore.Cosmos/Query/Internal/CosmosShapedQueryCompilingExpressionVisitor.QueryingEnumerable.cs +++ b/src/EFCore.Cosmos/Query/Internal/CosmosShapedQueryCompilingExpressionVisitor.QueryingEnumerable.cs @@ -27,7 +27,7 @@ private sealed class QueryingEnumerable : IEnumerable, IAsyncEnumerable private readonly Func _shaper; private readonly IQuerySqlGeneratorFactory _querySqlGeneratorFactory; private readonly Type _contextType; - private readonly string _partitionKey; + private readonly PartitionKey _partitionKeyValue; private readonly IDiagnosticsLogger _queryLogger; private readonly bool _standAloneStateManager; private readonly bool _threadSafetyChecksEnabled; @@ -39,7 +39,7 @@ public QueryingEnumerable( SelectExpression selectExpression, Func shaper, Type contextType, - string partitionKeyFromExtension, + PartitionKey partitionKeyValueFromExtension, bool standAloneStateManager, bool threadSafetyChecksEnabled) { @@ -53,13 +53,15 @@ public QueryingEnumerable( _standAloneStateManager = standAloneStateManager; _threadSafetyChecksEnabled = threadSafetyChecksEnabled; - var partitionKey = selectExpression.GetPartitionKey(cosmosQueryContext.ParameterValues); - if (partitionKey != null && partitionKeyFromExtension != null && partitionKeyFromExtension != partitionKey) + var partitionKey = selectExpression.GetPartitionKeyValue(cosmosQueryContext.ParameterValues); + if (partitionKey != PartitionKey.None + && partitionKeyValueFromExtension != PartitionKey.None + && !partitionKeyValueFromExtension.Equals(partitionKey)) { - throw new InvalidOperationException(CosmosStrings.PartitionKeyMismatch(partitionKeyFromExtension, partitionKey)); + throw new InvalidOperationException(CosmosStrings.PartitionKeyMismatch(partitionKeyValueFromExtension, partitionKey)); } - _partitionKey = partitionKey ?? partitionKeyFromExtension; + _partitionKeyValue = partitionKey != PartitionKey.None ? partitionKey : partitionKeyValueFromExtension; } public IAsyncEnumerator GetAsyncEnumerator(CancellationToken cancellationToken = default) @@ -108,7 +110,7 @@ private sealed class Enumerator : IEnumerator private readonly SelectExpression _selectExpression; private readonly Func _shaper; private readonly Type _contextType; - private readonly string _partitionKey; + private readonly PartitionKey _partitionKeyValue; private readonly IDiagnosticsLogger _queryLogger; private readonly bool _standAloneStateManager; private readonly IConcurrencyDetector _concurrencyDetector; @@ -123,7 +125,7 @@ public Enumerator(QueryingEnumerable queryingEnumerable) _shaper = queryingEnumerable._shaper; _selectExpression = queryingEnumerable._selectExpression; _contextType = queryingEnumerable._contextType; - _partitionKey = queryingEnumerable._partitionKey; + _partitionKeyValue = queryingEnumerable._partitionKeyValue; _queryLogger = queryingEnumerable._queryLogger; _standAloneStateManager = queryingEnumerable._standAloneStateManager; _exceptionDetector = _cosmosQueryContext.ExceptionDetector; @@ -155,7 +157,7 @@ public bool MoveNext() _enumerator = _cosmosQueryContext.CosmosClient .ExecuteSqlQuery( _selectExpression.Container, - _partitionKey, + _partitionKeyValue, sqlQuery) .GetEnumerator(); _cosmosQueryContext.InitializeStateManager(_standAloneStateManager); @@ -207,7 +209,7 @@ private sealed class AsyncEnumerator : IAsyncEnumerator private readonly SelectExpression _selectExpression; private readonly Func _shaper; private readonly Type _contextType; - private readonly string _partitionKey; + private readonly PartitionKey _partitionKeyValue; private readonly IDiagnosticsLogger _queryLogger; private readonly bool _standAloneStateManager; private readonly CancellationToken _cancellationToken; @@ -223,7 +225,7 @@ public AsyncEnumerator(QueryingEnumerable queryingEnumerable, CancellationTok _shaper = queryingEnumerable._shaper; _selectExpression = queryingEnumerable._selectExpression; _contextType = queryingEnumerable._contextType; - _partitionKey = queryingEnumerable._partitionKey; + _partitionKeyValue = queryingEnumerable._partitionKeyValue; _queryLogger = queryingEnumerable._queryLogger; _standAloneStateManager = queryingEnumerable._standAloneStateManager; _exceptionDetector = _cosmosQueryContext.ExceptionDetector; @@ -253,7 +255,7 @@ public async ValueTask MoveNextAsync() _enumerator = _cosmosQueryContext.CosmosClient .ExecuteSqlQueryAsync( _selectExpression.Container, - _partitionKey, + _partitionKeyValue, sqlQuery) .GetAsyncEnumerator(_cancellationToken); _cosmosQueryContext.InitializeStateManager(_standAloneStateManager); diff --git a/src/EFCore.Cosmos/Query/Internal/CosmosShapedQueryCompilingExpressionVisitor.ReadItemQueryingEnumerable.cs b/src/EFCore.Cosmos/Query/Internal/CosmosShapedQueryCompilingExpressionVisitor.ReadItemQueryingEnumerable.cs index fcdaa95da0e..948b67f22d4 100644 --- a/src/EFCore.Cosmos/Query/Internal/CosmosShapedQueryCompilingExpressionVisitor.ReadItemQueryingEnumerable.cs +++ b/src/EFCore.Cosmos/Query/Internal/CosmosShapedQueryCompilingExpressionVisitor.ReadItemQueryingEnumerable.cs @@ -58,30 +58,36 @@ IEnumerator IEnumerable.GetEnumerator() public string ToQueryString() { TryGetResourceId(out var resourceId); - TryGetPartitionId(out var partitionKey); + TryGetPartitionKey(out var partitionKey); return CosmosStrings.NoReadItemQueryString(resourceId, partitionKey); } - private bool TryGetPartitionId(out string partitionKey) + private bool TryGetPartitionKey(out PartitionKey partitionKeyValue) { - partitionKey = null; - - var partitionKeyPropertyName = _readItemExpression.EntityType.GetPartitionKeyPropertyName(); - if (partitionKeyPropertyName == null) + var properties = _readItemExpression.EntityType.GetPartitionKeyProperties(); + if (!properties.Any()) { + partitionKeyValue = PartitionKey.None; return true; } - var partitionKeyProperty = _readItemExpression.EntityType.FindProperty(partitionKeyPropertyName); - - if (TryGetParameterValue(partitionKeyProperty, out var value)) + var builder = new PartitionKeyBuilder(); + foreach (var property in properties) { - partitionKey = GetString(partitionKeyProperty, value); - - return !string.IsNullOrEmpty(partitionKey); + if (TryGetParameterValue(property, out var value)) + { + if (value == null) + { + partitionKeyValue = PartitionKey.Null; + return false; + } + builder.Add(value, property); + } } - return false; + partitionKeyValue = builder.Build(); + + return true; } private bool TryGetResourceId(out string resourceId) @@ -213,7 +219,7 @@ public bool MoveNext() throw new InvalidOperationException(CosmosStrings.ResourceIdMissing); } - if (!_readItemEnumerable.TryGetPartitionId(out var partitionKey)) + if (!_readItemEnumerable.TryGetPartitionKey(out var partitionKeyValue)) { throw new InvalidOperationException(CosmosStrings.PartitionKeyMissing); } @@ -222,7 +228,7 @@ public bool MoveNext() _item = _cosmosQueryContext.CosmosClient.ExecuteReadItem( _readItemExpression.Container, - partitionKey, + partitionKeyValue, resourceId); return ShapeResult(); @@ -265,7 +271,7 @@ public async ValueTask MoveNextAsync() throw new InvalidOperationException(CosmosStrings.ResourceIdMissing); } - if (!_readItemEnumerable.TryGetPartitionId(out var partitionKey)) + if (!_readItemEnumerable.TryGetPartitionKey(out var partitionKeyValue)) { throw new InvalidOperationException(CosmosStrings.PartitionKeyMissing); } @@ -274,7 +280,7 @@ public async ValueTask MoveNextAsync() _item = await _cosmosQueryContext.CosmosClient.ExecuteReadItemAsync( _readItemExpression.Container, - partitionKey, + partitionKeyValue, resourceId, _cancellationToken) .ConfigureAwait(false); diff --git a/src/EFCore.Cosmos/Query/Internal/CosmosShapedQueryCompilingExpressionVisitor.cs b/src/EFCore.Cosmos/Query/Internal/CosmosShapedQueryCompilingExpressionVisitor.cs index c8eaf2d1120..3acf05dc059 100644 --- a/src/EFCore.Cosmos/Query/Internal/CosmosShapedQueryCompilingExpressionVisitor.cs +++ b/src/EFCore.Cosmos/Query/Internal/CosmosShapedQueryCompilingExpressionVisitor.cs @@ -23,7 +23,9 @@ public partial class CosmosShapedQueryCompilingExpressionVisitor( { private readonly Type _contextType = cosmosQueryCompilationContext.ContextType; private readonly bool _threadSafetyChecksEnabled = dependencies.CoreSingletonOptions.AreThreadSafetyChecksEnabled; - private readonly string _partitionKeyFromExtension = cosmosQueryCompilationContext.PartitionKeyFromExtension; + + private readonly PartitionKey _partitionKeyValueFromExtension = cosmosQueryCompilationContext.PartitionKeyValueFromExtension + ?? PartitionKey.None; /// /// This is an internal API that supports the Entity Framework Core infrastructure and not subject to @@ -62,7 +64,7 @@ protected override Expression VisitShapedQuery(ShapedQueryExpression shapedQuery Constant(selectExpression), Constant(shaperLambda.Compile()), Constant(_contextType), - Constant(_partitionKeyFromExtension, typeof(string)), + Constant(_partitionKeyValueFromExtension, typeof(PartitionKey)), Constant( QueryCompilationContext.QueryTrackingBehavior == QueryTrackingBehavior.NoTrackingWithIdentityResolution), Constant(_threadSafetyChecksEnabled)); diff --git a/src/EFCore.Cosmos/Query/Internal/SelectExpression.cs b/src/EFCore.Cosmos/Query/Internal/SelectExpression.cs index 47535b31410..305ed971f9a 100644 --- a/src/EFCore.Cosmos/Query/Internal/SelectExpression.cs +++ b/src/EFCore.Cosmos/Query/Internal/SelectExpression.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using Microsoft.EntityFrameworkCore.Internal; using Microsoft.EntityFrameworkCore.Cosmos.Internal; namespace Microsoft.EntityFrameworkCore.Cosmos.Query.Internal; @@ -19,8 +20,7 @@ public class SelectExpression : Expression private readonly List _projection = []; private readonly List _orderings = []; - private ValueConverter? _partitionKeyValueConverter; - private Expression? _partitionKeyValue; + private readonly List<(Expression ValueExpression, IProperty Property)> _partitionKeyValues = new(); /// /// This is an internal API that supports the Entity Framework Core infrastructure and not subject to @@ -144,11 +144,8 @@ public virtual Expression GetMappedProjection(ProjectionMember projectionMember) /// 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. /// - public virtual void SetPartitionKey(IProperty partitionKeyProperty, Expression expression) - { - _partitionKeyValueConverter = partitionKeyProperty.GetTypeMapping().Converter; - _partitionKeyValue = expression; - } + public virtual void AddPartitionKey(IProperty partitionKeyProperty, Expression expression) + => _partitionKeyValues.Add((expression, partitionKeyProperty)); /// /// This is an internal API that supports the Entity Framework Core infrastructure and not subject to @@ -156,21 +153,28 @@ public virtual void SetPartitionKey(IProperty partitionKeyProperty, Expression e /// 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. /// - public virtual string? GetPartitionKey(IReadOnlyDictionary parameterValues) + public virtual PartitionKey GetPartitionKeyValue(IReadOnlyDictionary parameterValues) { - return _partitionKeyValue switch + if (!_partitionKeyValues.Any()) { - ConstantExpression constantExpression - => GetString(_partitionKeyValueConverter, constantExpression.Value), - ParameterExpression parameterExpression when parameterValues.TryGetValue(parameterExpression.Name!, out var value) - => GetString(_partitionKeyValueConverter, value), - _ => null - }; + return PartitionKey.None; + } + + var builder = new PartitionKeyBuilder(); + foreach (var tuple in _partitionKeyValues) + { + var rawKeyValue = tuple.ValueExpression switch + { + ConstantExpression constantExpression + => constantExpression.Value, + ParameterExpression parameterExpression when parameterValues.TryGetValue(parameterExpression.Name!, out var value) + => value, + _ => null + }; + builder.Add(rawKeyValue, tuple.Property); + } - static string? GetString(ValueConverter? converter, object? value) - => converter is null - ? (string?)value - : (string?)converter.ConvertToProvider(value); + return builder.Build(); } /// diff --git a/src/EFCore.Cosmos/Storage/Internal/ContainerProperties.cs b/src/EFCore.Cosmos/Storage/Internal/ContainerProperties.cs index f761557b183..d0761cd9ecb 100644 --- a/src/EFCore.Cosmos/Storage/Internal/ContainerProperties.cs +++ b/src/EFCore.Cosmos/Storage/Internal/ContainerProperties.cs @@ -25,7 +25,7 @@ public readonly record struct ContainerProperties /// 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. /// - public readonly string PartitionKey; + public readonly IReadOnlyList PartitionKeyStoreNames; /// /// This is an internal API that supports the Entity Framework Core infrastructure and not subject to @@ -59,13 +59,13 @@ public readonly record struct ContainerProperties /// public ContainerProperties( string containerId, - string partitionKey, + IReadOnlyList partitionKeyStoreNames, int? analyticalTtl, int? defaultTtl, ThroughputProperties? throughput) { Id = containerId; - PartitionKey = partitionKey; + PartitionKeyStoreNames = partitionKeyStoreNames; AnalyticalStoreTimeToLiveInSeconds = analyticalTtl; DefaultTimeToLive = defaultTtl; Throughput = throughput; @@ -79,13 +79,13 @@ public ContainerProperties( /// public void Deconstruct( out string containerId, - out string partitionKey, + out IReadOnlyList partitionKeyStoreNames, out int? analyticalTtl, out int? defaultTtl, out ThroughputProperties? throughput) { containerId = Id; - partitionKey = PartitionKey; + partitionKeyStoreNames = PartitionKeyStoreNames; analyticalTtl = AnalyticalStoreTimeToLiveInSeconds; defaultTtl = DefaultTimeToLive; throughput = Throughput; diff --git a/src/EFCore.Cosmos/Storage/Internal/CosmosClientWrapper.cs b/src/EFCore.Cosmos/Storage/Internal/CosmosClientWrapper.cs index 2f19ee60b13..62aa38750f8 100644 --- a/src/EFCore.Cosmos/Storage/Internal/CosmosClientWrapper.cs +++ b/src/EFCore.Cosmos/Storage/Internal/CosmosClientWrapper.cs @@ -8,6 +8,7 @@ using System.Text; using Microsoft.EntityFrameworkCore.Cosmos.Diagnostics.Internal; using Microsoft.EntityFrameworkCore.Cosmos.Infrastructure.Internal; +using Microsoft.EntityFrameworkCore.Internal; using Newtonsoft.Json; using Newtonsoft.Json.Linq; @@ -201,8 +202,9 @@ private static async Task CreateContainerIfNotExistsOnceAsync( CancellationToken cancellationToken = default) { var (parameters, wrapper) = parametersTuple; + var partitionKeyPaths = parameters.PartitionKeyStoreNames.Select(e => "/" + e).ToList(); var response = await wrapper.Client.GetDatabase(wrapper._databaseId).CreateContainerIfNotExistsAsync( - new Azure.Cosmos.ContainerProperties(parameters.Id, "/" + parameters.PartitionKey) + new Azure.Cosmos.ContainerProperties(parameters.Id, partitionKeyPaths) { PartitionKeyDefinitionVersion = PartitionKeyDefinitionVersion.V2, DefaultTimeToLive = parameters.DefaultTimeToLive, @@ -267,11 +269,11 @@ private static async Task CreateItemOnceAsync( var wrapper = parameters.Wrapper; var container = wrapper.Client.GetDatabase(wrapper._databaseId).GetContainer(parameters.ContainerId); var itemRequestOptions = CreateItemRequestOptions(entry, wrapper._enableContentResponseOnWrite); - var partitionKey = CreatePartitionKey(entry); + var partitionKeyValue = ExtractPartitionKeyValue(entry); var response = await container.CreateItemStreamAsync( stream, - partitionKey == null ? PartitionKey.None : new PartitionKey(partitionKey), + partitionKeyValue, itemRequestOptions, cancellationToken) .ConfigureAwait(false); @@ -282,7 +284,7 @@ private static async Task CreateItemOnceAsync( response.Headers.ActivityId, parameters.Document["id"].ToString(), parameters.ContainerId, - partitionKey); + partitionKeyValue); ProcessResponse(response, entry); @@ -343,12 +345,12 @@ private static async Task ReplaceItemOnceAsync( var wrapper = parameters.Wrapper; var container = wrapper.Client.GetDatabase(wrapper._databaseId).GetContainer(parameters.ContainerId); var itemRequestOptions = CreateItemRequestOptions(entry, wrapper._enableContentResponseOnWrite); - var partitionKey = CreatePartitionKey(entry); + var partitionKeyValue = ExtractPartitionKeyValue(entry); using var response = await container.ReplaceItemStreamAsync( stream, parameters.ResourceId, - partitionKey == null ? PartitionKey.None : new PartitionKey(partitionKey), + partitionKeyValue, itemRequestOptions, cancellationToken) .ConfigureAwait(false); @@ -359,7 +361,7 @@ private static async Task ReplaceItemOnceAsync( response.Headers.ActivityId, parameters.ResourceId, parameters.ContainerId, - partitionKey); + partitionKeyValue); ProcessResponse(response, entry); @@ -410,11 +412,11 @@ private static async Task DeleteItemOnceAsync( var items = wrapper.Client.GetDatabase(wrapper._databaseId).GetContainer(parameters.ContainerId); var itemRequestOptions = CreateItemRequestOptions(entry, wrapper._enableContentResponseOnWrite); - var partitionKey = CreatePartitionKey(entry); + var partitionKeyValue = ExtractPartitionKeyValue(entry); using var response = await items.DeleteItemStreamAsync( parameters.ResourceId, - partitionKey == null ? PartitionKey.None : new PartitionKey(partitionKey), + partitionKeyValue, itemRequestOptions, cancellationToken: cancellationToken) .ConfigureAwait(false); @@ -425,7 +427,7 @@ private static async Task DeleteItemOnceAsync( response.Headers.ActivityId, parameters.ResourceId, parameters.ContainerId, - partitionKey); + partitionKeyValue); ProcessResponse(response, entry); @@ -477,23 +479,21 @@ private static async Task DeleteItemOnceAsync( return new ItemRequestOptions { IfMatchEtag = (string?)etag, EnableContentResponseOnWrite = enabledContentResponse }; } - private static string? CreatePartitionKey(IUpdateEntry entry) + private static PartitionKey ExtractPartitionKeyValue(IUpdateEntry entry) { - object? partitionKey = null; - var partitionKeyPropertyName = entry.EntityType.GetPartitionKeyPropertyName(); - if (partitionKeyPropertyName != null) + var partitionKeyProperties = entry.EntityType.GetPartitionKeyProperties(); + if (!partitionKeyProperties.Any()) { - var partitionKeyProperty = entry.EntityType.FindProperty(partitionKeyPropertyName)!; - partitionKey = entry.GetCurrentValue(partitionKeyProperty); + return PartitionKey.None; + } - var converter = partitionKeyProperty.GetTypeMapping().Converter; - if (converter != null) - { - partitionKey = converter.ConvertToProvider(partitionKey); - } + var builder = new PartitionKeyBuilder(); + foreach (var property in partitionKeyProperties) + { + builder.Add(entry.GetCurrentValue(property), property); } - return (string?)partitionKey; + return builder.Build(); } private static void ProcessResponse(ResponseMessage response, IUpdateEntry entry) @@ -527,14 +527,14 @@ private static void ProcessResponse(ResponseMessage response, IUpdateEntry entry /// public virtual IEnumerable ExecuteSqlQuery( string containerId, - string? partitionKey, + PartitionKey partitionKeyValue, CosmosSqlQuery query) { _databaseLogger.SyncNotSupported(); - _commandLogger.ExecutingSqlQuery(containerId, partitionKey, query); + _commandLogger.ExecutingSqlQuery(containerId, partitionKeyValue, query); - return new DocumentEnumerable(this, containerId, partitionKey, query); + return new DocumentEnumerable(this, containerId, partitionKeyValue, query); } /// @@ -545,12 +545,12 @@ public virtual IEnumerable ExecuteSqlQuery( /// public virtual IAsyncEnumerable ExecuteSqlQueryAsync( string containerId, - string? partitionKey, + PartitionKey partitionKeyValue, CosmosSqlQuery query) { - _commandLogger.ExecutingSqlQuery(containerId, partitionKey, query); + _commandLogger.ExecutingSqlQuery(containerId, partitionKeyValue, query); - return new DocumentAsyncEnumerable(this, containerId, partitionKey, query); + return new DocumentAsyncEnumerable(this, containerId, partitionKeyValue, query); } /// @@ -561,14 +561,14 @@ public virtual IAsyncEnumerable ExecuteSqlQueryAsync( /// public virtual JObject? ExecuteReadItem( string containerId, - string? partitionKey, + PartitionKey partitionKeyValue, string resourceId) { _databaseLogger.SyncNotSupported(); - _commandLogger.ExecutingReadItem(containerId, partitionKey, resourceId); + _commandLogger.ExecutingReadItem(containerId, partitionKeyValue, resourceId); - var response = _executionStrategy.Execute((containerId, partitionKey, resourceId, this), CreateSingleItemQuery, null); + var response = _executionStrategy.Execute((containerId, partitionKeyValue, resourceId, this), CreateSingleItemQuery, null); _commandLogger.ExecutedReadItem( response.Diagnostics.GetClientElapsedTime(), @@ -576,7 +576,7 @@ public virtual IAsyncEnumerable ExecuteSqlQueryAsync( response.Headers.ActivityId, resourceId, containerId, - partitionKey); + partitionKeyValue); return JObjectFromReadItemResponseMessage(response); } @@ -589,14 +589,14 @@ public virtual IAsyncEnumerable ExecuteSqlQueryAsync( /// public virtual async Task ExecuteReadItemAsync( string containerId, - string? partitionKey, + PartitionKey partitionKeyValue, string resourceId, CancellationToken cancellationToken = default) { - _commandLogger.ExecutingReadItem(containerId, partitionKey, resourceId); + _commandLogger.ExecutingReadItem(containerId, partitionKeyValue, resourceId); var response = await _executionStrategy.ExecuteAsync( - (containerId, partitionKey, resourceId, this), + (containerId, partitionKeyValue, resourceId, this), CreateSingleItemQueryAsync, null, cancellationToken) @@ -608,27 +608,27 @@ public virtual IAsyncEnumerable ExecuteSqlQueryAsync( response.Headers.ActivityId, resourceId, containerId, - partitionKey); + partitionKeyValue); return JObjectFromReadItemResponseMessage(response); } private static ResponseMessage CreateSingleItemQuery( DbContext? context, - (string ContainerId, string? PartitionKey, string ResourceId, CosmosClientWrapper Wrapper) parameters) + (string ContainerId, PartitionKey PartitionKeyValue, string ResourceId, CosmosClientWrapper Wrapper) parameters) => CreateSingleItemQueryAsync(context, parameters).GetAwaiter().GetResult(); private static Task CreateSingleItemQueryAsync( DbContext? _, - (string ContainerId, string? PartitionKey, string ResourceId, CosmosClientWrapper Wrapper) parameters, + (string ContainerId, PartitionKey PartitionKeyValue, string ResourceId, CosmosClientWrapper Wrapper) parameters, CancellationToken cancellationToken = default) { - var (containerId, partitionKey, resourceId, wrapper) = parameters; + var (containerId, partitionKeyValue, resourceId, wrapper) = parameters; var container = wrapper.Client.GetDatabase(wrapper._databaseId).GetContainer(containerId); return container.ReadItemStreamAsync( resourceId, - string.IsNullOrEmpty(partitionKey) ? PartitionKey.None : new PartitionKey(partitionKey), + partitionKeyValue, cancellationToken: cancellationToken); } @@ -658,7 +658,7 @@ private static Task CreateSingleItemQueryAsync( /// public virtual FeedIterator CreateQuery( string containerId, - string? partitionKey, + PartitionKey partitionKeyValue, CosmosSqlQuery query) { var container = Client.GetDatabase(_databaseId).GetContainer(containerId); @@ -669,12 +669,12 @@ public virtual FeedIterator CreateQuery( queryDefinition, (current, parameter) => current.WithParameter(parameter.Name, parameter.Value)); - if (string.IsNullOrEmpty(partitionKey)) + if (partitionKeyValue == PartitionKey.None) { return container.GetItemQueryStreamIterator(queryDefinition); } - var queryRequestOptions = new QueryRequestOptions { PartitionKey = new PartitionKey(partitionKey) }; + var queryRequestOptions = new QueryRequestOptions { PartitionKey = partitionKeyValue }; return container.GetItemQueryStreamIterator(queryDefinition, requestOptions: queryRequestOptions); } @@ -722,18 +722,18 @@ private sealed class DocumentEnumerable : IEnumerable { private readonly CosmosClientWrapper _cosmosClient; private readonly string _containerId; - private readonly string? _partitionKey; + private readonly PartitionKey _partitionKeyValue; private readonly CosmosSqlQuery _cosmosSqlQuery; public DocumentEnumerable( CosmosClientWrapper cosmosClient, string containerId, - string? partitionKey, + PartitionKey partitionKeyValue, CosmosSqlQuery cosmosSqlQuery) { _cosmosClient = cosmosClient; _containerId = containerId; - _partitionKey = partitionKey; + _partitionKeyValue = partitionKeyValue; _cosmosSqlQuery = cosmosSqlQuery; } @@ -747,7 +747,7 @@ private sealed class Enumerator : IEnumerator { private readonly CosmosClientWrapper _cosmosClientWrapper; private readonly string _containerId; - private readonly string? _partitionKey; + private readonly PartitionKey _partitionKeyValue; private readonly CosmosSqlQuery _cosmosSqlQuery; private JObject? _current; @@ -762,7 +762,7 @@ public Enumerator(DocumentEnumerable documentEnumerable) { _cosmosClientWrapper = documentEnumerable._cosmosClient; _containerId = documentEnumerable._containerId; - _partitionKey = documentEnumerable._partitionKey; + _partitionKeyValue = documentEnumerable._partitionKeyValue; _cosmosSqlQuery = documentEnumerable._cosmosSqlQuery; } @@ -777,7 +777,7 @@ public bool MoveNext() { if (_jsonReader == null) { - _query ??= _cosmosClientWrapper.CreateQuery(_containerId, _partitionKey, _cosmosSqlQuery); + _query ??= _cosmosClientWrapper.CreateQuery(_containerId, _partitionKeyValue, _cosmosSqlQuery); if (!_query.HasMoreResults) { @@ -792,7 +792,7 @@ public bool MoveNext() _responseMessage.Headers.RequestCharge, _responseMessage.Headers.ActivityId, _containerId, - _partitionKey, + _partitionKeyValue, _cosmosSqlQuery); _responseMessage.EnsureSuccessStatusCode(); @@ -840,18 +840,18 @@ private sealed class DocumentAsyncEnumerable : IAsyncEnumerable { private readonly CosmosClientWrapper _cosmosClient; private readonly string _containerId; - private readonly string? _partitionKey; + private readonly PartitionKey _partitionKeyValue; private readonly CosmosSqlQuery _cosmosSqlQuery; public DocumentAsyncEnumerable( CosmosClientWrapper cosmosClient, string containerId, - string? partitionKey, + PartitionKey partitionKeyValue, CosmosSqlQuery cosmosSqlQuery) { _cosmosClient = cosmosClient; _containerId = containerId; - _partitionKey = partitionKey; + _partitionKeyValue = partitionKeyValue; _cosmosSqlQuery = cosmosSqlQuery; } @@ -862,7 +862,7 @@ private sealed class AsyncEnumerator : IAsyncEnumerator { private readonly CosmosClientWrapper _cosmosClientWrapper; private readonly string _containerId; - private readonly string? _partitionKey; + private readonly PartitionKey _partitionKeyValue; private readonly CosmosSqlQuery _cosmosSqlQuery; private readonly CancellationToken _cancellationToken; @@ -881,7 +881,7 @@ public AsyncEnumerator(DocumentAsyncEnumerable documentEnumerable, CancellationT { _cosmosClientWrapper = documentEnumerable._cosmosClient; _containerId = documentEnumerable._containerId; - _partitionKey = documentEnumerable._partitionKey; + _partitionKeyValue = documentEnumerable._partitionKeyValue; _cosmosSqlQuery = documentEnumerable._cosmosSqlQuery; _cancellationToken = cancellationToken; } @@ -893,7 +893,7 @@ public async ValueTask MoveNextAsync() if (_jsonReader == null) { - _query ??= _cosmosClientWrapper.CreateQuery(_containerId, _partitionKey, _cosmosSqlQuery); + _query ??= _cosmosClientWrapper.CreateQuery(_containerId, _partitionKeyValue, _cosmosSqlQuery); if (!_query.HasMoreResults) { @@ -908,7 +908,7 @@ public async ValueTask MoveNextAsync() _responseMessage.Headers.RequestCharge, _responseMessage.Headers.ActivityId, _containerId, - _partitionKey, + _partitionKeyValue, _cosmosSqlQuery); _responseMessage.EnsureSuccessStatusCode(); diff --git a/src/EFCore.Cosmos/Storage/Internal/CosmosDatabaseCreator.cs b/src/EFCore.Cosmos/Storage/Internal/CosmosDatabaseCreator.cs index 826c9c759f4..9ea755ce142 100644 --- a/src/EFCore.Cosmos/Storage/Internal/CosmosDatabaseCreator.cs +++ b/src/EFCore.Cosmos/Storage/Internal/CosmosDatabaseCreator.cs @@ -108,14 +108,17 @@ private static IEnumerable GetContainersToCreate(IModel mod foreach (var (containerName, mappedTypes) in containers) { - string? partitionKey = null; + IReadOnlyList partitionKeyStoreNames = Array.Empty(); int? analyticalTtl = null; int? defaultTtl = null; ThroughputProperties? throughput = null; foreach (var entityType in mappedTypes) { - partitionKey ??= GetPartitionKeyStoreName(entityType); + if (!partitionKeyStoreNames.Any()) + { + partitionKeyStoreNames = GetPartitionKeyStoreNames(entityType); + } analyticalTtl ??= entityType.GetAnalyticalStoreTimeToLive(); defaultTtl ??= entityType.GetDefaultTimeToLive(); throughput ??= entityType.GetThroughput(); @@ -123,7 +126,7 @@ private static IEnumerable GetContainersToCreate(IModel mod yield return new ContainerProperties( containerName, - partitionKey!, + partitionKeyStoreNames, analyticalTtl, defaultTtl, throughput); @@ -213,6 +216,7 @@ public virtual Task CanConnectAsync(CancellationToken cancellationToken = /// /// The entity type to get the partition key property name for. /// The name of the partition key property. + [Obsolete("Use GetPartitionKeyStoreNames")] private static string GetPartitionKeyStoreName(IEntityType entityType) { var name = entityType.GetPartitionKeyPropertyName(); @@ -220,4 +224,17 @@ private static string GetPartitionKeyStoreName(IEntityType entityType) ? entityType.FindProperty(name)!.GetJsonPropertyName() : CosmosClientWrapper.DefaultPartitionKey; } + + /// + /// Returns the store names of the properties that is used to store the partition keys. + /// + /// The entity type to get the partition key property names for. + /// The names of the partition key property. + private static IReadOnlyList GetPartitionKeyStoreNames(IEntityType entityType) + { + var properties = entityType.GetPartitionKeyProperties(); + return properties.Any() + ? properties.Select(p => p.GetJsonPropertyName()).ToList() + : [CosmosClientWrapper.DefaultPartitionKey]; + } } diff --git a/src/EFCore.Cosmos/Storage/Internal/ICosmosClientWrapper.cs b/src/EFCore.Cosmos/Storage/Internal/ICosmosClientWrapper.cs index 149fc7ad2f7..fa8ba51f089 100644 --- a/src/EFCore.Cosmos/Storage/Internal/ICosmosClientWrapper.cs +++ b/src/EFCore.Cosmos/Storage/Internal/ICosmosClientWrapper.cs @@ -135,7 +135,7 @@ Task DeleteItemAsync( /// 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. /// - FeedIterator CreateQuery(string containerId, string? partitionKey, CosmosSqlQuery query); + FeedIterator CreateQuery(string containerId, PartitionKey partitionKeyValue, CosmosSqlQuery query); /// /// This is an internal API that supports the Entity Framework Core infrastructure and not subject to @@ -145,7 +145,7 @@ Task DeleteItemAsync( /// JObject? ExecuteReadItem( string containerId, - string? partitionKey, + PartitionKey partitionKeyValue, string resourceId); /// @@ -156,7 +156,7 @@ Task DeleteItemAsync( /// Task ExecuteReadItemAsync( string containerId, - string? partitionKey, + PartitionKey partitionKeyValue, string resourceId, CancellationToken cancellationToken = default); @@ -168,7 +168,7 @@ Task DeleteItemAsync( /// IEnumerable ExecuteSqlQuery( string containerId, - string? partitionKey, + PartitionKey partitionKeyValue, CosmosSqlQuery query); /// @@ -179,6 +179,6 @@ IEnumerable ExecuteSqlQuery( /// IAsyncEnumerable ExecuteSqlQueryAsync( string containerId, - string? partitionKey, + PartitionKey partitionKeyValue, CosmosSqlQuery query); } diff --git a/src/EFCore.Cosmos/ValueGeneration/Internal/IdValueGenerator.cs b/src/EFCore.Cosmos/ValueGeneration/Internal/IdValueGenerator.cs index 70bb2c43bc1..4b7725d55d2 100644 --- a/src/EFCore.Cosmos/ValueGeneration/Internal/IdValueGenerator.cs +++ b/src/EFCore.Cosmos/ValueGeneration/Internal/IdValueGenerator.cs @@ -52,10 +52,10 @@ protected override object NextValue(EntityEntry entry) builder.Append('|'); } - var partitionKey = entityType.GetPartitionKeyPropertyName(); + var partitionKeyNames = entityType.GetPartitionKeyPropertyNames(); foreach (var property in primaryKey.Properties) { - if (property.Name == partitionKey + if (partitionKeyNames.Contains(property.Name) && primaryKey.Properties.Count > 1) { continue; diff --git a/src/Shared/ExpressionExtensions.cs b/src/Shared/ExpressionExtensions.cs index aa46cfaa56e..0835ed7eb3f 100644 --- a/src/Shared/ExpressionExtensions.cs +++ b/src/Shared/ExpressionExtensions.cs @@ -46,7 +46,7 @@ private static Expression RemoveConvert(Expression expression) : expression; public static T GetConstantValue(this Expression expression) - => expression switch + => RemoveConvert(expression) switch { ConstantExpression constantExpression => (T)constantExpression.Value!, #pragma warning disable EF9100 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. diff --git a/test/EFCore.Cosmos.FunctionalTests/BuiltInDataTypesCosmosTest.cs b/test/EFCore.Cosmos.FunctionalTests/BuiltInDataTypesCosmosTest.cs index 3f495ae7291..ed27624a809 100644 --- a/test/EFCore.Cosmos.FunctionalTests/BuiltInDataTypesCosmosTest.cs +++ b/test/EFCore.Cosmos.FunctionalTests/BuiltInDataTypesCosmosTest.cs @@ -92,6 +92,10 @@ public override DateTime DefaultDateTime public override bool PreservesDateTimeKind => true; + public override DbContextOptionsBuilder AddOptions(DbContextOptionsBuilder builder) + => base.AddOptions(builder).ConfigureWarnings( + w => w.Ignore(CosmosEventId.NoPartitionKeyDefined)); + protected override void OnModelCreating(ModelBuilder modelBuilder, DbContext context) { base.OnModelCreating(modelBuilder, context); diff --git a/test/EFCore.Cosmos.FunctionalTests/ConcurrencyDetectorDisabledCosmosTest.cs b/test/EFCore.Cosmos.FunctionalTests/ConcurrencyDetectorDisabledCosmosTest.cs index 24b7cc8f91e..d118974f945 100644 --- a/test/EFCore.Cosmos.FunctionalTests/ConcurrencyDetectorDisabledCosmosTest.cs +++ b/test/EFCore.Cosmos.FunctionalTests/ConcurrencyDetectorDisabledCosmosTest.cs @@ -43,6 +43,7 @@ public TestSqlLoggerFactory TestSqlLoggerFactory => (TestSqlLoggerFactory)ListLoggerFactory; public override DbContextOptionsBuilder AddOptions(DbContextOptionsBuilder builder) - => builder.EnableThreadSafetyChecks(enableChecks: false); + => base.AddOptions(builder.EnableThreadSafetyChecks(enableChecks: false)) + .ConfigureWarnings(w => w.Ignore(CosmosEventId.NoPartitionKeyDefined)); } } diff --git a/test/EFCore.Cosmos.FunctionalTests/ConcurrencyDetectorEnabledCosmosTest.cs b/test/EFCore.Cosmos.FunctionalTests/ConcurrencyDetectorEnabledCosmosTest.cs index 44afb345745..03c35306ac1 100644 --- a/test/EFCore.Cosmos.FunctionalTests/ConcurrencyDetectorEnabledCosmosTest.cs +++ b/test/EFCore.Cosmos.FunctionalTests/ConcurrencyDetectorEnabledCosmosTest.cs @@ -19,5 +19,8 @@ protected override ITestStoreFactory TestStoreFactory public TestSqlLoggerFactory TestSqlLoggerFactory => (TestSqlLoggerFactory)ListLoggerFactory; + + public override DbContextOptionsBuilder AddOptions(DbContextOptionsBuilder builder) + => base.AddOptions(builder).ConfigureWarnings(w => w.Ignore(CosmosEventId.NoPartitionKeyDefined)); } } diff --git a/test/EFCore.Cosmos.FunctionalTests/ConfigPatternsCosmosTest.cs b/test/EFCore.Cosmos.FunctionalTests/ConfigPatternsCosmosTest.cs index 344cbbe1f50..c369bdbfeab 100644 --- a/test/EFCore.Cosmos.FunctionalTests/ConfigPatternsCosmosTest.cs +++ b/test/EFCore.Cosmos.FunctionalTests/ConfigPatternsCosmosTest.cs @@ -148,6 +148,9 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) public class CosmosFixture : ServiceProviderFixtureBase { + public override DbContextOptionsBuilder AddOptions(DbContextOptionsBuilder builder) + => base.AddOptions(builder).ConfigureWarnings(w => w.Ignore(CosmosEventId.NoPartitionKeyDefined)); + protected override ITestStoreFactory TestStoreFactory => CosmosTestStoreFactory.Instance; } diff --git a/test/EFCore.Cosmos.FunctionalTests/CosmosConcurrencyTest.cs b/test/EFCore.Cosmos.FunctionalTests/CosmosConcurrencyTest.cs index 5e04d803e0c..0c67b0c6e25 100644 --- a/test/EFCore.Cosmos.FunctionalTests/CosmosConcurrencyTest.cs +++ b/test/EFCore.Cosmos.FunctionalTests/CosmosConcurrencyTest.cs @@ -199,6 +199,7 @@ protected override void OnModelCreating(ModelBuilder builder) b.HasKey(c => c.Id); b.Property(c => c.ETag).IsETagConcurrency(); b.OwnsMany(x => x.Children); + b.HasPartitionKey(c => c.Id); }); } diff --git a/test/EFCore.Cosmos.FunctionalTests/CustomConvertersCosmosTest.cs b/test/EFCore.Cosmos.FunctionalTests/CustomConvertersCosmosTest.cs index d1c24275fa3..cd96d45af64 100644 --- a/test/EFCore.Cosmos.FunctionalTests/CustomConvertersCosmosTest.cs +++ b/test/EFCore.Cosmos.FunctionalTests/CustomConvertersCosmosTest.cs @@ -177,6 +177,9 @@ public override bool PreservesDateTimeKind public TestSqlLoggerFactory TestSqlLoggerFactory => (TestSqlLoggerFactory)ListLoggerFactory; + public override DbContextOptionsBuilder AddOptions(DbContextOptionsBuilder builder) + => base.AddOptions(builder).ConfigureWarnings(w => w.Ignore(CosmosEventId.NoPartitionKeyDefined)); + protected override void OnModelCreating(ModelBuilder modelBuilder, DbContext context) { base.OnModelCreating(modelBuilder, context); diff --git a/test/EFCore.Cosmos.FunctionalTests/EmbeddedDocumentsTest.cs b/test/EFCore.Cosmos.FunctionalTests/EmbeddedDocumentsTest.cs index bd9f333f820..c316e339b06 100644 --- a/test/EFCore.Cosmos.FunctionalTests/EmbeddedDocumentsTest.cs +++ b/test/EFCore.Cosmos.FunctionalTests/EmbeddedDocumentsTest.cs @@ -705,6 +705,9 @@ await TestStore.InitializeAsync( protected override void OnModelCreating(ModelBuilder modelBuilder, DbContext context) => ((EmbeddedTransportationContext)context).Options.OnModelCreating?.Invoke(modelBuilder); + public override DbContextOptionsBuilder AddOptions(DbContextOptionsBuilder builder) + => base.AddOptions(builder).ConfigureWarnings(w => w.Ignore(CosmosEventId.NoPartitionKeyDefined)); + protected override object GetAdditionalModelCacheKey(DbContext context) { var options = ((EmbeddedTransportationContext)context).Options; diff --git a/test/EFCore.Cosmos.FunctionalTests/EndToEndCosmosTest.cs b/test/EFCore.Cosmos.FunctionalTests/EndToEndCosmosTest.cs index 5f5a6627b0e..99e997bc69f 100644 --- a/test/EFCore.Cosmos.FunctionalTests/EndToEndCosmosTest.cs +++ b/test/EFCore.Cosmos.FunctionalTests/EndToEndCosmosTest.cs @@ -19,7 +19,7 @@ public async Task Can_add_update_delete_end_to_end() var contextFactory = await InitializeAsync( b => b.Entity(), shouldLogCategory: _ => true, - onConfiguring: o => o.ConfigureWarnings(w => w.Log(CosmosEventId.SyncNotSupported))); + onConfiguring: o => o.ConfigureWarnings(w => w.Log(CosmosEventId.SyncNotSupported, CosmosEventId.NoPartitionKeyDefined))); var customer = new Customer { Id = 42, Name = "Theon" }; @@ -104,7 +104,7 @@ public async Task Can_add_update_delete_end_to_end_async() var contextFactory = await InitializeAsync( b => b.Entity(), shouldLogCategory: _ => true, - onConfiguring: o => o.ConfigureWarnings(w => w.Log(CosmosEventId.SyncNotSupported))); + onConfiguring: o => o.ConfigureWarnings(w => w.Log(CosmosEventId.SyncNotSupported, CosmosEventId.NoPartitionKeyDefined))); var customer = new Customer { Id = 42, Name = "Theon" }; @@ -182,7 +182,7 @@ public async Task Can_add_update_delete_detached_entity_end_to_end_async() var contextFactory = await InitializeAsync( b => b.Entity(), shouldLogCategory: _ => true, - onConfiguring: o => o.ConfigureWarnings(w => w.Log(CosmosEventId.SyncNotSupported))); + onConfiguring: o => o.ConfigureWarnings(w => w.Log(CosmosEventId.SyncNotSupported, CosmosEventId.NoPartitionKeyDefined))); var customer = new Customer { Id = 42, Name = "Theon" }; string storeId = null; @@ -261,7 +261,7 @@ public async Task Can_add_update_untracked_properties() var contextFactory = await InitializeAsync( b => b.Entity(), shouldLogCategory: _ => true, - onConfiguring: o => o.ConfigureWarnings(w => w.Log(CosmosEventId.SyncNotSupported))); + onConfiguring: o => o.ConfigureWarnings(w => w.Log(CosmosEventId.SyncNotSupported, CosmosEventId.NoPartitionKeyDefined))); var customer = new Customer { Id = 42, Name = "Theon" }; @@ -357,7 +357,7 @@ public async Task Can_add_update_untracked_properties_async() var contextFactory = await InitializeAsync( b => b.Entity(), shouldLogCategory: _ => true, - onConfiguring: o => o.ConfigureWarnings(w => w.Log(CosmosEventId.SyncNotSupported))); + onConfiguring: o => o.ConfigureWarnings(w => w.Log(CosmosEventId.SyncNotSupported, CosmosEventId.NoPartitionKeyDefined))); var customer = new Customer { Id = 42, Name = "Theon" }; @@ -588,14 +588,17 @@ private class Customer { public int Id { get; set; } public string Name { get; set; } - public int PartitionKey { get; set; } + public int PartitionKey1 { get; set; } + public bool PartitionKey3 { get; set; } + public string PartitionKey2 { get; set; } } private class CustomerWithResourceId { public string id { get; set; } public string Name { get; set; } - public int PartitionKey { get; set; } + public int PartitionKey1 { get; set; } + public decimal PartitionKey2 { get; set; } } private class CustomerGuid @@ -625,7 +628,7 @@ public async Task Can_add_update_delete_with_dateTime_string_end_to_end_async() var contextFactory = await InitializeAsync( b => b.Entity(), shouldLogCategory: _ => true, - onConfiguring: o => o.ConfigureWarnings(w => w.Log(CosmosEventId.SyncNotSupported))); + onConfiguring: o => o.ConfigureWarnings(w => w.Log(CosmosEventId.SyncNotSupported, CosmosEventId.NoPartitionKeyDefined))); var customer = new Customer { Id = 42, Name = "2021-08-23T06:23:40+00:00" }; @@ -686,7 +689,7 @@ public async Task Entities_with_null_PK_can_be_added_with_normal_use_of_DbContex var contextFactory = await InitializeAsync( usePooling: false, shouldLogCategory: _ => true, - onConfiguring: o => o.ConfigureWarnings(w => w.Log(CosmosEventId.SyncNotSupported))); + onConfiguring: o => o.ConfigureWarnings(w => w.Log(CosmosEventId.SyncNotSupported, CosmosEventId.NoPartitionKeyDefined))); var context = contextFactory.CreateContext(); var item = new GItem(); @@ -711,7 +714,7 @@ public async Task var contextFactory = await InitializeAsync( usePooling: false, shouldLogCategory: _ => true, - onConfiguring: o => o.ConfigureWarnings(w => w.Log(CosmosEventId.SyncNotSupported))); + onConfiguring: o => o.ConfigureWarnings(w => w.Log(CosmosEventId.SyncNotSupported, CosmosEventId.NoPartitionKeyDefined))); var context = contextFactory.CreateContext(); @@ -940,7 +943,7 @@ private async Task Can_add_update_delete_with_collection( var contextFactory = await InitializeAsync>( shouldLogCategory: _ => true, onModelCreating: onModelBuilder, - onConfiguring: o => o.ConfigureWarnings(w => w.Log(CosmosEventId.SyncNotSupported))); + onConfiguring: o => o.ConfigureWarnings(w => w.Log(CosmosEventId.SyncNotSupported, CosmosEventId.NoPartitionKeyDefined))); var customer = new CustomerWithCollection { @@ -1022,7 +1025,8 @@ public async Task Can_read_with_find_with_resource_id_async() { id = "42", Name = "Theon", - PartitionKey = pk1 + PartitionKey1 = pk1, + PartitionKey2 = 3.15m }; await using (var context = contextFactory.CreateContext()) @@ -1039,7 +1043,8 @@ await context.AddAsync( { id = "42", Name = "Theon Twin", - PartitionKey = pk2 + PartitionKey1 = pk2, + PartitionKey2 = 3.15m }); await context.SaveChangesAsync(); @@ -1048,12 +1053,13 @@ await context.AddAsync( await using (var context = contextFactory.CreateContext()) { var customerFromStore = await context.Set() - .FindAsync(pk1, "42"); + .FindAsync(pk1, 3.15m, "42"); Assert.Equal("42", customerFromStore.id); Assert.Equal("Theon", customerFromStore.Name); - Assert.Equal(pk1, customerFromStore.PartitionKey); - AssertSql(context, @"ReadItem(1, 42)"); + Assert.Equal(pk1, customerFromStore.PartitionKey1); + Assert.Equal(3.15m, customerFromStore.PartitionKey2); + AssertSql(context, """ReadItem([1.0,3.15], 42)"""); customerFromStore.Name = "Theon Greyjoy"; @@ -1063,12 +1069,13 @@ await context.AddAsync( await using (var context = contextFactory.CreateContext()) { var customerFromStore = await context.Set() - .WithPartitionKey(partitionKey: pk1.ToString()) + .WithPartitionKey(pk1, 3.15m) .FirstAsync(); Assert.Equal("42", customerFromStore.id); Assert.Equal("Theon Greyjoy", customerFromStore.Name); - Assert.Equal(pk1, customerFromStore.PartitionKey); + Assert.Equal(pk1, customerFromStore.PartitionKey1); + Assert.Equal(3.15m, customerFromStore.PartitionKey2); } } @@ -1086,7 +1093,8 @@ public async Task Can_read_with_find_with_resource_id() { id = "42", Name = "Theon", - PartitionKey = pk1 + PartitionKey1 = pk1, + PartitionKey2 = 3.15m }; using (var context = contextFactory.CreateContext()) @@ -1099,7 +1107,8 @@ public async Task Can_read_with_find_with_resource_id() { id = "42", Name = "Theon Twin", - PartitionKey = pk2 + PartitionKey1 = pk2, + PartitionKey2 = 3.15m }); context.SaveChanges(); @@ -1108,12 +1117,13 @@ public async Task Can_read_with_find_with_resource_id() using (var context = contextFactory.CreateContext()) { var customerFromStore = context.Set() - .Find(pk1, "42"); + .Find(pk1, 3.15m, "42"); Assert.Equal("42", customerFromStore.id); Assert.Equal("Theon", customerFromStore.Name); - Assert.Equal(pk1, customerFromStore.PartitionKey); - AssertSql(context, @"ReadItem(1, 42)"); + Assert.Equal(pk1, customerFromStore.PartitionKey1); + Assert.Equal(3.15m, customerFromStore.PartitionKey2); + AssertSql(context, """ReadItem([1.0,3.15], 42)"""); customerFromStore.Name = "Theon Greyjoy"; @@ -1123,12 +1133,13 @@ public async Task Can_read_with_find_with_resource_id() using (var context = contextFactory.CreateContext()) { var customerFromStore = context.Set() - .WithPartitionKey(partitionKey: pk1.ToString()) + .WithPartitionKey(pk1, 3.15m) .First(); Assert.Equal("42", customerFromStore.id); Assert.Equal("Theon Greyjoy", customerFromStore.Name); - Assert.Equal(pk1, customerFromStore.PartitionKey); + Assert.Equal(pk1, customerFromStore.PartitionKey1); + Assert.Equal(3.15m, customerFromStore.PartitionKey2); } } @@ -1145,7 +1156,7 @@ public async Task Find_with_empty_resource_id_throws() Assert.Equal( CosmosStrings.InvalidResourceId, - Assert.Throws(() => context.Set().Find(1, "")).Message); + Assert.Throws(() => context.Set().Find(1, 3.15m, "")).Message); } } @@ -1163,7 +1174,9 @@ public async Task Can_read_with_find_with_partition_key_and_value_generator_asyn { Id = 42, Name = "Theon", - PartitionKey = pk1 + PartitionKey1 = pk1, + PartitionKey2 = "One", + PartitionKey3 = true }; await using (var context = contextFactory.CreateContext()) @@ -1176,7 +1189,9 @@ await context.AddAsync( { Id = 42, Name = "Theon Twin", - PartitionKey = pk2 + PartitionKey1 = pk2, + PartitionKey2 = "Two", + PartitionKey3 = false }); await context.SaveChangesAsync(); @@ -1185,11 +1200,13 @@ await context.AddAsync( await using (var context = contextFactory.CreateContext()) { var customerFromStore = await context.Set() - .FindAsync(pk1, 42); + .FindAsync(pk1, 42, "One", true); Assert.Equal(42, customerFromStore.Id); Assert.Equal("Theon", customerFromStore.Name); - Assert.Equal(pk1, customerFromStore.PartitionKey); + Assert.Equal(pk1, customerFromStore.PartitionKey1); + Assert.Equal("One", customerFromStore.PartitionKey2); + Assert.True(customerFromStore.PartitionKey3); customerFromStore.Name = "Theon Greyjoy"; @@ -1199,12 +1216,14 @@ await context.AddAsync( await using (var context = contextFactory.CreateContext()) { var customerFromStore = await context.Set() - .WithPartitionKey(partitionKey: pk1.ToString()) + .WithPartitionKey(pk1, "One", true) .FirstAsync(); Assert.Equal(42, customerFromStore.Id); Assert.Equal("Theon Greyjoy", customerFromStore.Name); - Assert.Equal(pk1, customerFromStore.PartitionKey); + Assert.Equal(pk1, customerFromStore.PartitionKey1); + Assert.Equal("One", customerFromStore.PartitionKey2); + Assert.True(customerFromStore.PartitionKey3); } } @@ -1222,7 +1241,9 @@ public async Task Can_read_with_find_with_partition_key_and_value_generator() { Id = 42, Name = "Theon", - PartitionKey = pk1 + PartitionKey1 = pk1, + PartitionKey2 = "One", + PartitionKey3 = true }; using (var context = contextFactory.CreateContext()) @@ -1235,7 +1256,9 @@ public async Task Can_read_with_find_with_partition_key_and_value_generator() { Id = 42, Name = "Theon Twin", - PartitionKey = pk2 + PartitionKey1 = pk2, + PartitionKey2 = "Two", + PartitionKey3 = false }); context.SaveChanges(); @@ -1244,12 +1267,14 @@ public async Task Can_read_with_find_with_partition_key_and_value_generator() using (var context = contextFactory.CreateContext()) { var customerFromStore = context.Set() - .Find(pk1, 42); + .Find(pk1, 42, "One", true); Assert.Equal(42, customerFromStore.Id); Assert.Equal("Theon", customerFromStore.Name); - Assert.Equal(pk1, customerFromStore.PartitionKey); - AssertSql(context, @"ReadItem(1, Customer-42)"); + Assert.Equal(pk1, customerFromStore.PartitionKey1); + Assert.Equal("One", customerFromStore.PartitionKey2); + Assert.True(customerFromStore.PartitionKey3); + AssertSql(context, """ReadItem([1.0,"One",true], Customer-42)"""); customerFromStore.Name = "Theon Greyjoy"; @@ -1259,12 +1284,14 @@ public async Task Can_read_with_find_with_partition_key_and_value_generator() using (var context = contextFactory.CreateContext()) { var customerFromStore = context.Set() - .WithPartitionKey(partitionKey: pk1.ToString()) + .WithPartitionKey(pk1, "One", true) .First(); Assert.Equal(42, customerFromStore.Id); Assert.Equal("Theon Greyjoy", customerFromStore.Name); - Assert.Equal(pk1, customerFromStore.PartitionKey); + Assert.Equal(pk1, customerFromStore.PartitionKey1); + Assert.Equal("One", customerFromStore.PartitionKey2); + Assert.True(customerFromStore.PartitionKey3); } } @@ -1281,7 +1308,9 @@ public async Task Can_read_with_find_with_partition_key_without_value_generator( { Id = 42, Name = "Theon", - PartitionKey = pk1 + PartitionKey1 = pk1, + PartitionKey2 = "One", + PartitionKey3 = true }; using (var context = contextFactory.CreateContext()) @@ -1298,19 +1327,21 @@ public async Task Can_read_with_find_with_partition_key_without_value_generator( using (var context = contextFactory.CreateContext()) { var customerFromStore = context.Set() - .Find(pk1, 42); + .Find(pk1, "One", true, 42); Assert.Equal(42, customerFromStore.Id); Assert.Equal("Theon", customerFromStore.Name); - Assert.Equal(pk1, customerFromStore.PartitionKey); + Assert.Equal(pk1, customerFromStore.PartitionKey1); + Assert.Equal("One", customerFromStore.PartitionKey2); + Assert.True(customerFromStore.PartitionKey3); AssertSql( context, """ -@__p_1='42' +@__p_3='42' SELECT c FROM root c -WHERE ((c["Discriminator"] = "Customer") AND (c["Id"] = @__p_1)) +WHERE ((c["Discriminator"] = "Customer") AND (c["Id"] = @__p_3)) OFFSET 0 LIMIT 1 """); @@ -1322,12 +1353,14 @@ OFFSET 0 LIMIT 1 using (var context = contextFactory.CreateContext()) { var customerFromStore = context.Set() - .WithPartitionKey(partitionKey: pk1.ToString()) + .WithPartitionKey(pk1, "One", true) .First(); Assert.Equal(42, customerFromStore.Id); Assert.Equal("Theon Greyjoy", customerFromStore.Name); - Assert.Equal(pk1, customerFromStore.PartitionKey); + Assert.Equal(pk1, customerFromStore.PartitionKey1); + Assert.Equal("One", customerFromStore.PartitionKey2); + Assert.True(customerFromStore.PartitionKey3); } } @@ -1336,13 +1369,15 @@ public async Task Can_read_with_find_with_partition_key_not_part_of_primary_key( { var contextFactory = await InitializeAsync( shouldLogCategory: _ => true, - onConfiguring: o => o.ConfigureWarnings(w => w.Log(CosmosEventId.SyncNotSupported))); + onConfiguring: o => o.ConfigureWarnings(w => w.Log(CosmosEventId.SyncNotSupported, CosmosEventId.NoPartitionKeyDefined))); var customer = new Customer { Id = 42, Name = "Theon", - PartitionKey = 1 + PartitionKey1 = 1, + PartitionKey2 = "One", + PartitionKey3 = true }; using (var context = contextFactory.CreateContext()) @@ -1360,7 +1395,7 @@ public async Task Can_read_with_find_with_partition_key_not_part_of_primary_key( Assert.Equal(42, customerFromStore.Id); Assert.Equal("Theon", customerFromStore.Name); - AssertSql(context, "ReadItem(, Customer|42)"); + AssertSql(context, """ReadItem(None, Customer|42)"""); } } @@ -1369,7 +1404,7 @@ public async Task Can_read_with_find_without_partition_key() { var contextFactory = await InitializeAsync( shouldLogCategory: _ => true, - onConfiguring: o => o.ConfigureWarnings(w => w.Log(CosmosEventId.SyncNotSupported))); + onConfiguring: o => o.ConfigureWarnings(w => w.Log(CosmosEventId.SyncNotSupported, CosmosEventId.NoPartitionKeyDefined))); var customer = new CustomerNoPartitionKey { Id = 42, Name = "Theon" }; @@ -1388,7 +1423,7 @@ public async Task Can_read_with_find_without_partition_key() Assert.Equal(42, customerFromStore.Id); Assert.Equal("Theon", customerFromStore.Name); - AssertSql(context, @"ReadItem(, CustomerNoPartitionKey|42)"); + AssertSql(context, @"ReadItem(None, CustomerNoPartitionKey|42)"); } } @@ -1416,7 +1451,7 @@ public async Task Can_read_with_find_with_PK_partition_key() Assert.Equal(customer.Id, customerFromStore.Id); Assert.Equal("Theon", customerFromStore.Name); - AssertSql(context, @$"ReadItem({customer.Id}, {customer.Id})"); + AssertSql(context, @$"ReadItem([""{customer.Id}""], {customer.Id})"); } } @@ -1463,9 +1498,8 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) => modelBuilder.Entity( cb => { - cb.HasPartitionKey(c => c.PartitionKey); - cb.Property(c => c.PartitionKey).HasConversion(); - cb.HasKey(c => new { c.Id, c.PartitionKey }); + cb.HasPartitionKey(c => new { c.PartitionKey1, c.PartitionKey2, c.PartitionKey3 }); + cb.HasKey(c => new { c.Id, c.PartitionKey1, c.PartitionKey2, c.PartitionKey3 }); }); } @@ -1484,10 +1518,8 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) cb.Property(StoreKeyConvention.DefaultIdPropertyName) .HasValueGeneratorFactory(typeof(CustomPartitionKeyIdValueGeneratorFactory)); - cb.Property(c => c.PartitionKey).HasConversion(); - - cb.HasPartitionKey(c => c.PartitionKey); - cb.HasKey(c => new { c.PartitionKey, c.Id }); + cb.HasPartitionKey(c => new { c.PartitionKey1, c.PartitionKey2, c.PartitionKey3 }); + cb.HasKey(c => new { c.PartitionKey1, c.Id, c.PartitionKey2, c.PartitionKey3 }); }); } @@ -1499,10 +1531,8 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) { cb.Property(StoreKeyConvention.DefaultIdPropertyName).HasValueGenerator((Type)null); - cb.Property(c => c.PartitionKey).HasConversion(); - - cb.HasPartitionKey(c => c.PartitionKey); - cb.HasKey(c => new { c.PartitionKey, c.Id }); + cb.HasPartitionKey(c => new { c.PartitionKey1, c.PartitionKey2, c.PartitionKey3 }); + cb.HasKey(c => new { c.PartitionKey1, c.PartitionKey2, c.PartitionKey3, c.Id }); }); } @@ -1529,8 +1559,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) => modelBuilder.Entity( cb => { - cb.HasPartitionKey(c => c.PartitionKey); - cb.Property(c => c.PartitionKey).HasConversion(); + cb.HasPartitionKey(c => new { c.PartitionKey1, c.PartitionKey2 } ); cb.Property(c => c.id).HasConversion(); cb.HasKey(c => new { c.id }); }); @@ -1542,9 +1571,8 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) => modelBuilder.Entity( cb => { - cb.HasPartitionKey(c => c.PartitionKey); - cb.Property(c => c.PartitionKey).HasConversion(); - cb.HasKey(c => new { c.PartitionKey, c.id }); + cb.HasPartitionKey(c => new { c.PartitionKey1, c.PartitionKey2 } ); + cb.HasKey(c => new { c.PartitionKey1, c.PartitionKey2, c.id }); }); } @@ -1553,7 +1581,7 @@ public async Task Can_use_detached_entities_without_discriminators() { var contextFactory = await InitializeAsync( shouldLogCategory: _ => true, - onConfiguring: o => o.ConfigureWarnings(w => w.Log(CosmosEventId.SyncNotSupported))); + onConfiguring: o => o.ConfigureWarnings(w => w.Log(CosmosEventId.SyncNotSupported, CosmosEventId.NoPartitionKeyDefined))); var customer = new Customer { Id = 42, Name = "Theon" }; @@ -1604,7 +1632,7 @@ public async Task Can_update_unmapped_properties() { var contextFactory = await InitializeAsync( shouldLogCategory: _ => true, - onConfiguring: o => o.ConfigureWarnings(w => w.Log(CosmosEventId.SyncNotSupported))); + onConfiguring: o => o.ConfigureWarnings(w => w.Log(CosmosEventId.SyncNotSupported, CosmosEventId.NoPartitionKeyDefined))); var customer = new Customer { Id = 42, Name = "Theon" }; @@ -1665,7 +1693,7 @@ public async Task Can_use_non_persisted_properties() { var contextFactory = await InitializeAsync( shouldLogCategory: _ => true, - onConfiguring: o => o.ConfigureWarnings(w => w.Log(CosmosEventId.SyncNotSupported))); + onConfiguring: o => o.ConfigureWarnings(w => w.Log(CosmosEventId.SyncNotSupported, CosmosEventId.NoPartitionKeyDefined))); var customer = new Customer { Id = 42, Name = "Theon" }; @@ -1787,7 +1815,7 @@ public async Task Can_add_update_delete_end_to_end_with_conflicting_id() { var contextFactory = await InitializeAsync( shouldLogCategory: _ => true, - onConfiguring: o => o.ConfigureWarnings(w => w.Log(CosmosEventId.SyncNotSupported))); + onConfiguring: o => o.ConfigureWarnings(w => w.Log(CosmosEventId.SyncNotSupported, CosmosEventId.NoPartitionKeyDefined))); var entity = new ConflictingId { id = "42", Name = "Theon" }; @@ -1870,7 +1898,7 @@ public async Task Can_have_non_string_property_named_Discriminator(bool useDiscr b.Entity(); } }, - onConfiguring: o => o.ConfigureWarnings(w => w.Log(CosmosEventId.SyncNotSupported))); + onConfiguring: o => o.ConfigureWarnings(w => w.Log(CosmosEventId.SyncNotSupported, CosmosEventId.NoPartitionKeyDefined))); using var context = contextFactory.CreateContext(); context.Database.EnsureCreated(); diff --git a/test/EFCore.Cosmos.FunctionalTests/F1CosmosFixture.cs b/test/EFCore.Cosmos.FunctionalTests/F1CosmosFixture.cs index 6e4167c5cce..804a3eda4ac 100644 --- a/test/EFCore.Cosmos.FunctionalTests/F1CosmosFixture.cs +++ b/test/EFCore.Cosmos.FunctionalTests/F1CosmosFixture.cs @@ -16,6 +16,9 @@ protected override ITestStoreFactory TestStoreFactory public override TestHelpers TestHelpers => CosmosTestHelpers.Instance; + public override DbContextOptionsBuilder AddOptions(DbContextOptionsBuilder builder) + => base.AddOptions(builder).ConfigureWarnings(w => w.Ignore(CosmosEventId.NoPartitionKeyDefined)); + protected override void BuildModelExternal(ModelBuilder modelBuilder) { base.BuildModelExternal(modelBuilder); diff --git a/test/EFCore.Cosmos.FunctionalTests/FindCosmosTest.cs b/test/EFCore.Cosmos.FunctionalTests/FindCosmosTest.cs index 2bfef6105d8..3897e3be08d 100644 --- a/test/EFCore.Cosmos.FunctionalTests/FindCosmosTest.cs +++ b/test/EFCore.Cosmos.FunctionalTests/FindCosmosTest.cs @@ -92,6 +92,9 @@ public class FindCosmosFixture : FindFixtureBase public TestSqlLoggerFactory TestSqlLoggerFactory => (TestSqlLoggerFactory)ListLoggerFactory; + public override DbContextOptionsBuilder AddOptions(DbContextOptionsBuilder builder) + => base.AddOptions(builder).ConfigureWarnings(w => w.Ignore(CosmosEventId.NoPartitionKeyDefined)); + protected override ITestStoreFactory TestStoreFactory => CosmosTestStoreFactory.Instance; } diff --git a/test/EFCore.Cosmos.FunctionalTests/HierarchicalPartitionKeyTest.cs b/test/EFCore.Cosmos.FunctionalTests/HierarchicalPartitionKeyTest.cs new file mode 100644 index 00000000000..1292167d7d5 --- /dev/null +++ b/test/EFCore.Cosmos.FunctionalTests/HierarchicalPartitionKeyTest.cs @@ -0,0 +1,293 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +namespace Microsoft.EntityFrameworkCore; + +public class HierarchicalPartitionKeyTest : IClassFixture +{ + private const string DatabaseName = nameof(HierarchicalPartitionKeyTest); + + private void AssertSql(params string[] expected) + => Fixture.TestSqlLoggerFactory.AssertBaseline(expected); + + protected void ClearLog() + => Fixture.TestSqlLoggerFactory.Clear(); + + protected CosmosHierarchicalPartitionKeyFixture Fixture { get; } + + public HierarchicalPartitionKeyTest(CosmosHierarchicalPartitionKeyFixture fixture) + { + Fixture = fixture; + ClearLog(); + } + + [ConditionalFact] + public virtual async Task Can_add_update_delete_end_to_end_with_partition_key() + { + const string read1Sql = + """ +SELECT c +FROM root c +WHERE (c["Discriminator"] = "Customer") +ORDER BY c["PartitionKey1"] +OFFSET 0 LIMIT 1 +"""; + + const string read2Sql = + """ +@__p_0='1' + +SELECT c +FROM root c +WHERE (c["Discriminator"] = "Customer") +ORDER BY c["PartitionKey1"] +OFFSET @__p_0 LIMIT 1 +"""; + + await PartitionKeyTestAsync( + ctx => ctx.Customers.OrderBy(c => c.PartitionKey1).FirstAsync(), + read1Sql, + ctx => ctx.Customers.OrderBy(c => c.PartitionKey1).Skip(1).FirstAsync(), + read2Sql, + ctx => ctx.Customers.OrderBy(c => c.PartitionKey1).LastAsync(), + ctx => ctx.Customers.OrderBy(c => c.PartitionKey1).ToListAsync(), + 2); + } + + [ConditionalFact] + public virtual async Task Can_add_update_delete_end_to_end_with_with_partition_key_extension() + { + const string readSql = + """ +SELECT c +FROM root c +WHERE (c["Discriminator"] = "Customer") +OFFSET 0 LIMIT 1 +"""; + + await PartitionKeyTestAsync( + ctx => ctx.Customers.WithPartitionKey("A", 1.1, true).FirstAsync(), + readSql, + ctx => ctx.Customers.WithPartitionKey("B", 2.1, false).FirstAsync(), + readSql, + ctx => ctx.Customers.WithPartitionKey("B", 2.1, false).LastAsync(), + ctx => ctx.Customers.WithPartitionKey("B", 2.1, false).ToListAsync(), + 1); + } + + [ConditionalFact] + public async Task Can_query_with_implicit_partition_key_filter() + { + const string readSql = + """ +SELECT c +FROM root c +WHERE (c["Discriminator"] = "Customer") +OFFSET 0 LIMIT 1 +"""; + + await PartitionKeyTestAsync( + ctx => ctx.Customers + .Where( + b => (b.Id == 42 || b.Name == "John Snow") + && b.PartitionKey1 == "A" + && b.PartitionKey2 == 1.1 + && b.PartitionKey3) + .FirstAsync(), + readSql, + ctx => ctx.Customers + .Where( + b => (b.Id == 42 || b.Name == "John Snow") + && b.PartitionKey1 == "B" + && b.PartitionKey2 == 2.1 + && !b.PartitionKey3) + .FirstAsync(), + readSql, + ctx => ctx.Customers.WithPartitionKey("B", 2.1, false).LastAsync(), + ctx => ctx.Customers + .Where( + b => b.Id == 42 + && ((b.PartitionKey1 == "A" && b.PartitionKey2 == 1.1 && b.PartitionKey3) + || (b.PartitionKey1 == "B" && b.PartitionKey2 == 2.1 && !b.PartitionKey3))) + .ToListAsync(), + 2); + } + + protected virtual async Task PartitionKeyTestAsync( + Func> read1SingleTask, + string read1Sql, + Func> read2SingleTask, + string read2Sql, + Func> readLastTask, + Func>> readListTask, + int listCount) + { + var customer1 = new Customer + { + Id = 42, + Name = "Theon", + PartitionKey1 = "A", + PartitionKey2 = 1.1, + PartitionKey3 = true, + }; + + var customer2 = new Customer + { + Id = 42, + Name = "Theon Twin", + PartitionKey1 = "B", + PartitionKey2 = 2.1, + PartitionKey3 = false, + }; + + await using (var innerContext = CreateContext()) + { + await innerContext.Database.EnsureCreatedAsync(); + + await innerContext.AddAsync(customer1); + await innerContext.AddAsync(customer2); + await innerContext.SaveChangesAsync(); + } + + // Read & update in first partition + await using (var innerContext = CreateContext()) + { + var customerFromStore = await read1SingleTask(innerContext); + + AssertSql(read1Sql); + + Assert.Equal(42, customerFromStore.Id); + Assert.Equal("Theon", customerFromStore.Name); + Assert.Equal("A", customerFromStore.PartitionKey1); + Assert.Equal(1.1, customerFromStore.PartitionKey2); + Assert.True(customerFromStore.PartitionKey3); + + customerFromStore.Name = "Theon Greyjoy"; + + await innerContext.SaveChangesAsync(); + } + + // Read & update in second partition + await using (var innerContext = CreateContext()) + { + var customerFromStore = await read2SingleTask(innerContext); + + AssertSql(read2Sql); + + Assert.Equal(42, customerFromStore.Id); + Assert.Equal("Theon Twin", customerFromStore.Name); + Assert.Equal("B", customerFromStore.PartitionKey1); + Assert.Equal(2.1, customerFromStore.PartitionKey2); + Assert.False(customerFromStore.PartitionKey3); + + customerFromStore.Name = "Theon Bluejoy"; + + await innerContext.SaveChangesAsync(); + } + + // Read list from all partitions + await using (var innerContext = CreateContext()) + { + var customerFromStore = await readListTask(innerContext); + + Assert.Equal(listCount, customerFromStore.Count); + } + + // Test exceptions + await using (var innerContext = CreateContext()) + { + var customerFromStore = await read1SingleTask(innerContext); + customerFromStore.PartitionKey1 = "C"; + + Assert.Equal( + CoreStrings.KeyReadOnly(nameof(Customer.PartitionKey1), nameof(Customer)), + Assert.Throws(() => innerContext.SaveChanges()).Message); + } + + await using (var innerContext = CreateContext()) + { + var customerFromStore = await read1SingleTask(innerContext); + customerFromStore.PartitionKey2 = 2.1; + + Assert.Equal( + CoreStrings.KeyReadOnly(nameof(Customer.PartitionKey2), nameof(Customer)), + Assert.Throws(() => innerContext.SaveChanges()).Message); + } + + await using (var innerContext = CreateContext()) + { + var customerFromStore = await read1SingleTask(innerContext); + customerFromStore.PartitionKey3 = false; + + Assert.Equal( + CoreStrings.KeyReadOnly(nameof(Customer.PartitionKey3), nameof(Customer)), + Assert.Throws(() => innerContext.SaveChanges()).Message); + } + + // Read update & delete + await using (var innerContext = CreateContext()) + { + var customerFromStore = await read1SingleTask(innerContext); + + Assert.Equal(42, customerFromStore.Id); + Assert.Equal("Theon Greyjoy", customerFromStore.Name); + Assert.Equal("A", customerFromStore.PartitionKey1); + Assert.Equal(1.1, customerFromStore.PartitionKey2); + Assert.True(customerFromStore.PartitionKey3); + + innerContext.Remove(customerFromStore); + + var lastTask = await readLastTask(innerContext); + + innerContext.Remove(lastTask); + + await innerContext.SaveChangesAsync(); + } + + await using (var innerContext = CreateContext()) + { + Assert.Empty(await readListTask(innerContext)); + } + } + + protected HierarchicalPartitionKeyContext CreateContext() + => Fixture.CreateContext(); + + public class CosmosHierarchicalPartitionKeyFixture : SharedStoreFixtureBase + { + protected override string StoreName + => DatabaseName; + + protected override bool UsePooling + => false; + + protected override ITestStoreFactory TestStoreFactory + => CosmosTestStoreFactory.Instance; + + public TestSqlLoggerFactory TestSqlLoggerFactory + => (TestSqlLoggerFactory)ServiceProvider.GetRequiredService(); + } + + public class HierarchicalPartitionKeyContext(DbContextOptions dbContextOptions) : DbContext(dbContextOptions) + { + public virtual DbSet Customers + => Set(); + + protected override void OnModelCreating(ModelBuilder modelBuilder) + => modelBuilder.Entity( + cb => + { + cb.HasPartitionKey(c => new { c.PartitionKey1, c.PartitionKey2, c.PartitionKey3 }); + cb.HasKey(c => new { c.Id, c.PartitionKey1, c.PartitionKey2, c.PartitionKey3 }); + }); + } + + public class Customer + { + public int Id { get; set; } + public string? Name { get; set; } + public string? PartitionKey1 { get; set; } + public double PartitionKey2 { get; set; } + public bool PartitionKey3 { get; set; } + } +} diff --git a/test/EFCore.Cosmos.FunctionalTests/KeysWithConvertersCosmosTest.cs b/test/EFCore.Cosmos.FunctionalTests/KeysWithConvertersCosmosTest.cs index 29140b79416..c06af99c669 100644 --- a/test/EFCore.Cosmos.FunctionalTests/KeysWithConvertersCosmosTest.cs +++ b/test/EFCore.Cosmos.FunctionalTests/KeysWithConvertersCosmosTest.cs @@ -545,6 +545,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder, DbContext con } public override DbContextOptionsBuilder AddOptions(DbContextOptionsBuilder builder) - => base.AddOptions(builder.ConfigureWarnings(w => w.Ignore(CoreEventId.MappedEntityTypeIgnoredWarning))); + => base.AddOptions(builder.ConfigureWarnings( + w => w.Ignore(CoreEventId.MappedEntityTypeIgnoredWarning, CosmosEventId.NoPartitionKeyDefined))); } } diff --git a/test/EFCore.Cosmos.FunctionalTests/MaterializationInterceptionCosmosTest.cs b/test/EFCore.Cosmos.FunctionalTests/MaterializationInterceptionCosmosTest.cs index b58c881d792..c94bf70fc5f 100644 --- a/test/EFCore.Cosmos.FunctionalTests/MaterializationInterceptionCosmosTest.cs +++ b/test/EFCore.Cosmos.FunctionalTests/MaterializationInterceptionCosmosTest.cs @@ -20,7 +20,28 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) { base.OnModelCreating(modelBuilder); - modelBuilder.Entity(); + modelBuilder.Entity( + b => + { + b.Property(e => e.Id).ValueGeneratedOnAdd(); + b.HasPartitionKey(e => e.Title); + b.HasKey(e => new { e.Id, e.Title }); + }); + + modelBuilder.Entity( + b => + { + b.Property(e => e.Id).ValueGeneratedOnAdd(); + b.HasPartitionKey(e => e.Title); + b.HasKey(e => new { e.Id, e.Title }); + }); + + modelBuilder.Entity( + b => + { + b.HasPartitionKey(e => e.Title); + b.HasKey(e => new { e.Id, e.Title }); + }); } } diff --git a/test/EFCore.Cosmos.FunctionalTests/ModelBuilding/CosmosModelBuilderGenericTest.cs b/test/EFCore.Cosmos.FunctionalTests/ModelBuilding/CosmosModelBuilderGenericTest.cs index 8c0fb56dbf7..4b609fa503e 100644 --- a/test/EFCore.Cosmos.FunctionalTests/ModelBuilding/CosmosModelBuilderGenericTest.cs +++ b/test/EFCore.Cosmos.FunctionalTests/ModelBuilding/CosmosModelBuilderGenericTest.cs @@ -92,6 +92,59 @@ public virtual void Partition_key_is_added_to_the_keys() Assert.NotNull(idProperty.GetValueGeneratorFactory()); } + [ConditionalFact] + public virtual void Hierarchical_partition_key_is_added_to_the_keys() + { + var modelBuilder = CreateModelBuilder(); + + modelBuilder.Entity() + .Ignore(b => b.Details) + .Ignore(b => b.Orders) + .HasPartitionKey(b => new { b.Title, b.Name }); + + var model = modelBuilder.FinalizeModel(); + + var entity = model.FindEntityType(typeof(Customer))!; + + Assert.Equal( + new[] { nameof(Customer.Title), nameof(Customer.Name) }, + entity.GetPartitionKeyProperties().Select(p => p.Name)); + Assert.Equal( + new[] { StoreKeyConvention.DefaultIdPropertyName, nameof(Customer.Title), nameof(Customer.Name) }, + entity.GetKeys().First(k => k != entity.FindPrimaryKey()).Properties.Select(p => p.Name)); + + var idProperty = entity.FindProperty(StoreKeyConvention.DefaultIdPropertyName)!; + Assert.Single(idProperty.GetContainingKeys()); + Assert.NotNull(idProperty.GetValueGeneratorFactory()); + } + + [ConditionalFact] + public virtual void Three_level_hierarchical_partition_key_is_added_to_the_keys() + { + var modelBuilder = CreateModelBuilder(); + + modelBuilder.Entity() + .Ignore(b => b.Details) + .Ignore(b => b.Orders) + .HasPartitionKey(b => new { b.Title, b.Name, b.AlternateKey }) + .Property(b => b.AlternateKey).HasConversion(); + + var model = modelBuilder.FinalizeModel(); + + var entity = model.FindEntityType(typeof(Customer))!; + + Assert.Equal( + new[] { nameof(Customer.Title), nameof(Customer.Name), nameof(Customer.AlternateKey) }, + entity.GetPartitionKeyProperties().Select(p => p.Name)); + Assert.Equal( + new[] { StoreKeyConvention.DefaultIdPropertyName, nameof(Customer.Title), nameof(Customer.Name), nameof(Customer.AlternateKey) }, + entity.GetKeys().First(k => k != entity.FindPrimaryKey()).Properties.Select(p => p.Name)); + + var idProperty = entity.FindProperty(StoreKeyConvention.DefaultIdPropertyName)!; + Assert.Single(idProperty.GetContainingKeys()); + Assert.NotNull(idProperty.GetValueGeneratorFactory()); + } + [ConditionalFact] public virtual void Partition_key_is_added_to_the_alternate_key_if_primary_key_contains_id() { @@ -116,6 +169,45 @@ public virtual void Partition_key_is_added_to_the_alternate_key_if_primary_key_c entity.GetKeys().First(k => k != entity.FindPrimaryKey()).Properties.Select(p => p.Name)); } + [ConditionalFact] + public virtual void Hierarchical_partition_key_is_added_to_the_alternate_key_if_primary_key_contains_id() + { + var modelBuilder = CreateModelBuilder(); + + modelBuilder.Entity().HasKey(StoreKeyConvention.DefaultIdPropertyName); + modelBuilder.Entity() + .Ignore(b => b.Details) + .Ignore(b => b.Orders) + .HasPartitionKey( + b => new + { + b.AlternateKey, + b.Name, + b.Title + }) + .Property(b => b.AlternateKey).HasConversion(); + + var model = modelBuilder.FinalizeModel(); + + var entity = model.FindEntityType(typeof(Customer))!; + + Assert.Equal( + new[] { nameof(Customer.AlternateKey), nameof(Customer.Name), nameof(Customer.Title) }, + entity.GetPartitionKeyProperties().Select(p => p.Name)); + Assert.Equal( + new[] { StoreKeyConvention.DefaultIdPropertyName }, + entity.FindPrimaryKey()!.Properties.Select(p => p.Name)); + Assert.Equal( + new[] + { + StoreKeyConvention.DefaultIdPropertyName, + nameof(Customer.AlternateKey), + nameof(Customer.Name), + nameof(Customer.Title) + }, + entity.GetKeys().First(k => k != entity.FindPrimaryKey()).Properties.Select(p => p.Name)); + } + [ConditionalFact] public virtual void No_id_property_created_if_another_property_mapped_to_id() { @@ -214,81 +306,67 @@ public virtual void No_alternate_key_is_created_if_primary_key_contains_id_and_p } [ConditionalFact] - public virtual void No_alternate_key_is_created_if_id_is_partition_key() + public virtual void No_alternate_key_is_created_if_primary_key_contains_id_and_hierarchical_partition_key() { var modelBuilder = CreateModelBuilder(); - modelBuilder.Entity().HasKey(nameof(Customer.AlternateKey)); + modelBuilder.Entity().HasKey( + nameof(Customer.AlternateKey), + nameof(Customer.Name), + nameof(Customer.Title), + StoreKeyConvention.DefaultIdPropertyName); modelBuilder.Entity() .Ignore(b => b.Details) .Ignore(b => b.Orders) - .HasPartitionKey(b => b.AlternateKey) - .Property(b => b.AlternateKey).HasConversion().ToJsonProperty("id"); + .HasPartitionKey( + b => new + { + b.AlternateKey, + b.Name, + b.Title + }) + .Property(b => b.AlternateKey).HasConversion(); var model = modelBuilder.FinalizeModel(); var entity = model.FindEntityType(typeof(Customer))!; Assert.Equal( - new[] { nameof(Customer.AlternateKey) }, - entity.FindPrimaryKey()!.Properties.Select(p => p.Name)); - Assert.Empty(entity.GetKeys().Where(k => k != entity.FindPrimaryKey())); - } - - protected override TestModelBuilder CreateModelBuilder(Action? configure = null) - => new GenericTestModelBuilder(Fixture, configure); - } - - public class CosmosGenericComplexType(CosmosModelBuilderFixture fixture) : ComplexTypeTestBase(fixture), IClassFixture - { - public override void Properties_can_have_custom_type_value_converter_type_set() - => Properties_can_have_custom_type_value_converter_type_set(); + new[] { nameof(Customer.AlternateKey), nameof(Customer.Name), nameof(Customer.Title) }, + entity.GetPartitionKeyProperties().Select(p => p.Name)); - public override void Properties_can_have_non_generic_value_converter_set() - => Properties_can_have_non_generic_value_converter_set(); - - public override void Properties_can_have_provider_type_set() - => Properties_can_have_provider_type_set(); - - public override void Can_set_complex_property_annotation() - { - var modelBuilder = CreateModelBuilder(); - - var complexPropertyBuilder = modelBuilder - .Ignore() - .Entity() - .ComplexProperty(e => e.Customer) - .HasTypeAnnotation("foo", "bar") - .HasPropertyAnnotation("foo2", "bar2") - .Ignore(c => c.Details) - .Ignore(c => c.Orders); - - var model = modelBuilder.FinalizeModel(); - var complexProperty = model.FindEntityType(typeof(ComplexProperties))!.GetComplexProperties().Single(); - - Assert.Equal("bar", complexProperty.ComplexType["foo"]); - Assert.Equal("bar2", complexProperty["foo2"]); - Assert.Equal(typeof(Customer).Name, complexProperty.Name); Assert.Equal( - @"Customer (Customer) Required - ComplexType: ComplexProperties.Customer#Customer - Properties: " - + @" - AlternateKey (Guid) Required - Id (int) Required - Name (string) - Notes (List) Element type: string Required", complexProperty.ToDebugString(), ignoreLineEndingDifferences: true); + new[] + { + nameof(Customer.AlternateKey), + nameof(Customer.Name), + nameof(Customer.Title), + StoreKeyConvention.DefaultIdPropertyName + }, + entity.FindPrimaryKey()!.Properties.Select(p => p.Name)); + Assert.Empty(entity.GetKeys().Where(k => k != entity.FindPrimaryKey())); } [ConditionalFact] - public virtual void Partition_key_is_added_to_the_keys() + public virtual void No_alternate_key_is_created_if_primary_key_contains_id_and_hierarchical_partition_key_in_different_order() { var modelBuilder = CreateModelBuilder(); + modelBuilder.Entity().HasKey( + nameof(Customer.Title), + nameof(Customer.Name), + nameof(Customer.AlternateKey), + StoreKeyConvention.DefaultIdPropertyName); modelBuilder.Entity() .Ignore(b => b.Details) .Ignore(b => b.Orders) - .HasPartitionKey(b => b.AlternateKey) + .HasPartitionKey( + b => new + { + b.AlternateKey, + b.Name, + b.Title + }) .Property(b => b.AlternateKey).HasConversion(); var model = modelBuilder.FinalizeModel(); @@ -296,27 +374,41 @@ public virtual void Partition_key_is_added_to_the_keys() var entity = model.FindEntityType(typeof(Customer))!; Assert.Equal( - new[] { nameof(Customer.Id), nameof(Customer.AlternateKey) }, - entity.FindPrimaryKey()!.Properties.Select(p => p.Name)); - Assert.Equal( - new[] { StoreKeyConvention.DefaultIdPropertyName, nameof(Customer.AlternateKey) }, - entity.GetKeys().First(k => k != entity.FindPrimaryKey()).Properties.Select(p => p.Name)); + new[] { nameof(Customer.AlternateKey), nameof(Customer.Name), nameof(Customer.Title) }, + entity.GetPartitionKeyProperties().Select(p => p.Name)); - var idProperty = entity.FindProperty(StoreKeyConvention.DefaultIdPropertyName)!; - Assert.Single(idProperty.GetContainingKeys()); - Assert.NotNull(idProperty.GetValueGeneratorFactory()); + Assert.Equal( + new[] + { + nameof(Customer.Title), + nameof(Customer.Name), + nameof(Customer.AlternateKey), + StoreKeyConvention.DefaultIdPropertyName + }, + entity.FindPrimaryKey()!.Properties.Select(p => p.Name)); + Assert.Empty(entity.GetKeys().Where(k => k != entity.FindPrimaryKey())); } [ConditionalFact] - public virtual void Partition_key_is_added_to_the_alternate_key_if_primary_key_contains_id() + public virtual void Hierarchical_partition_key_is_added_to_the_alternate_key_if_primary_key_contains_part_of_partition_key() { var modelBuilder = CreateModelBuilder(); - modelBuilder.Entity().HasKey(StoreKeyConvention.DefaultIdPropertyName); + modelBuilder.Entity().HasKey( + nameof(Customer.Title), + nameof(Customer.AlternateKey), + StoreKeyConvention.DefaultIdPropertyName); + modelBuilder.Entity() .Ignore(b => b.Details) .Ignore(b => b.Orders) - .HasPartitionKey(b => b.AlternateKey) + .HasPartitionKey( + b => new + { + b.Title, + b.AlternateKey, + b.Name + }) .Property(b => b.AlternateKey).HasConversion(); var model = modelBuilder.FinalizeModel(); @@ -324,130 +416,117 @@ public virtual void Partition_key_is_added_to_the_alternate_key_if_primary_key_c var entity = model.FindEntityType(typeof(Customer))!; Assert.Equal( - new[] { StoreKeyConvention.DefaultIdPropertyName }, + new[] { nameof(Customer.Title), nameof(Customer.AlternateKey), nameof(Customer.Name) }, + entity.GetPartitionKeyProperties().Select(p => p.Name)); + + Assert.Equal( + new[] + { + nameof(Customer.Title), + nameof(Customer.AlternateKey), + StoreKeyConvention.DefaultIdPropertyName + }, entity.FindPrimaryKey()!.Properties.Select(p => p.Name)); + Assert.Equal( - new[] { StoreKeyConvention.DefaultIdPropertyName, nameof(Customer.AlternateKey) }, + new[] + { + StoreKeyConvention.DefaultIdPropertyName, + nameof(Customer.Title), + nameof(Customer.AlternateKey), + nameof(Customer.Name) + }, entity.GetKeys().First(k => k != entity.FindPrimaryKey()).Properties.Select(p => p.Name)); } [ConditionalFact] - public virtual void No_id_property_created_if_another_property_mapped_to_id() + public virtual void No_alternate_key_is_created_if_id_is_partition_key() { var modelBuilder = CreateModelBuilder(); - modelBuilder.Entity() - .Property(c => c.Name) - .ToJsonProperty(StoreKeyConvention.IdPropertyJsonName); + modelBuilder.Entity().HasKey(nameof(Customer.AlternateKey)); modelBuilder.Entity() .Ignore(b => b.Details) - .Ignore(b => b.Orders); - - var model = modelBuilder.FinalizeModel(); - - var entity = model.FindEntityType(typeof(Customer))!; - - Assert.Null(entity.FindProperty(StoreKeyConvention.DefaultIdPropertyName)); - Assert.Single(entity.GetKeys().Where(k => k != entity.FindPrimaryKey())); - - var idProperty = entity.GetDeclaredProperties() - .Single(p => p.GetJsonPropertyName() == StoreKeyConvention.IdPropertyJsonName); - Assert.Single(idProperty.GetContainingKeys()); - Assert.NotNull(idProperty.GetValueGeneratorFactory()); - } - - [ConditionalFact] - public virtual void No_id_property_created_if_another_property_mapped_to_id_in_pk() - { - var modelBuilder = CreateModelBuilder(); - - modelBuilder.Entity() - .Property(c => c.Name) - .ToJsonProperty(StoreKeyConvention.IdPropertyJsonName); - modelBuilder.Entity() - .Ignore(c => c.Details) - .Ignore(c => c.Orders) - .HasKey(c => c.Name); + .Ignore(b => b.Orders) + .HasPartitionKey(b => b.AlternateKey) + .Property(b => b.AlternateKey).HasConversion().ToJsonProperty("id"); var model = modelBuilder.FinalizeModel(); var entity = model.FindEntityType(typeof(Customer))!; - Assert.Null(entity.FindProperty(StoreKeyConvention.DefaultIdPropertyName)); + Assert.Equal( + new[] { nameof(Customer.AlternateKey) }, + entity.FindPrimaryKey()!.Properties.Select(p => p.Name)); Assert.Empty(entity.GetKeys().Where(k => k != entity.FindPrimaryKey())); - - var idProperty = entity.GetDeclaredProperties() - .Single(p => p.GetJsonPropertyName() == StoreKeyConvention.IdPropertyJsonName); - Assert.Single(idProperty.GetContainingKeys()); - Assert.Null(idProperty.GetValueGeneratorFactory()); } [ConditionalFact] - public virtual void No_alternate_key_is_created_if_primary_key_contains_id() + public virtual void No_alternate_key_is_created_if_id_is_hierarchical_partition_key() { var modelBuilder = CreateModelBuilder(); - modelBuilder.Entity().HasKey(StoreKeyConvention.DefaultIdPropertyName); + modelBuilder.Entity().HasKey(e => new { e.Name, e.AlternateKey, e.Title }); modelBuilder.Entity() .Ignore(b => b.Details) - .Ignore(b => b.Orders); + .Ignore(b => b.Orders) + .HasPartitionKey(b => new { b.Name, b.AlternateKey, b.Title }) + .Property(b => b.AlternateKey).HasConversion().ToJsonProperty("id"); var model = modelBuilder.FinalizeModel(); var entity = model.FindEntityType(typeof(Customer))!; Assert.Equal( - new[] { StoreKeyConvention.DefaultIdPropertyName }, + new[] { nameof(Customer.Name), nameof(Customer.AlternateKey), nameof(Customer.Title) }, entity.FindPrimaryKey()!.Properties.Select(p => p.Name)); Assert.Empty(entity.GetKeys().Where(k => k != entity.FindPrimaryKey())); - - var idProperty = entity.FindProperty(StoreKeyConvention.DefaultIdPropertyName)!; - Assert.Single(idProperty.GetContainingKeys()); - Assert.Null(idProperty.GetValueGeneratorFactory()); } - [ConditionalFact] - public virtual void No_alternate_key_is_created_if_primary_key_contains_id_and_partition_key() - { - var modelBuilder = CreateModelBuilder(); - - modelBuilder.Entity().HasKey(nameof(Customer.AlternateKey), StoreKeyConvention.DefaultIdPropertyName); - modelBuilder.Entity() - .Ignore(b => b.Details) - .Ignore(b => b.Orders) - .HasPartitionKey(b => b.AlternateKey) - .Property(b => b.AlternateKey).HasConversion(); + protected override TestModelBuilder CreateModelBuilder(Action? configure = null) + => new GenericTestModelBuilder(Fixture, configure); + } - var model = modelBuilder.FinalizeModel(); + public class CosmosGenericComplexType(CosmosModelBuilderFixture fixture) : ComplexTypeTestBase(fixture), IClassFixture + { + public override void Properties_can_have_custom_type_value_converter_type_set() + => Properties_can_have_custom_type_value_converter_type_set(); - var entity = model.FindEntityType(typeof(Customer))!; + public override void Properties_can_have_non_generic_value_converter_set() + => Properties_can_have_non_generic_value_converter_set(); - Assert.Equal( - new[] { nameof(Customer.AlternateKey), StoreKeyConvention.DefaultIdPropertyName }, - entity.FindPrimaryKey()!.Properties.Select(p => p.Name)); - Assert.Empty(entity.GetKeys().Where(k => k != entity.FindPrimaryKey())); - } + public override void Properties_can_have_provider_type_set() + => Properties_can_have_provider_type_set(); - [ConditionalFact] - public virtual void No_alternate_key_is_created_if_id_is_partition_key() + public override void Can_set_complex_property_annotation() { var modelBuilder = CreateModelBuilder(); - modelBuilder.Entity().HasKey(nameof(Customer.AlternateKey)); - modelBuilder.Entity() - .Ignore(b => b.Details) - .Ignore(b => b.Orders) - .HasPartitionKey(b => b.AlternateKey) - .Property(b => b.AlternateKey).HasConversion().ToJsonProperty("id"); + var complexPropertyBuilder = modelBuilder + .Ignore() + .Entity() + .ComplexProperty(e => e.Customer) + .HasTypeAnnotation("foo", "bar") + .HasPropertyAnnotation("foo2", "bar2") + .Ignore(c => c.Details) + .Ignore(c => c.Orders); var model = modelBuilder.FinalizeModel(); + var complexProperty = model.FindEntityType(typeof(ComplexProperties))!.GetComplexProperties().Single(); - var entity = model.FindEntityType(typeof(Customer))!; - + Assert.Equal("bar", complexProperty.ComplexType["foo"]); + Assert.Equal("bar2", complexProperty["foo2"]); + Assert.Equal(typeof(Customer).Name, complexProperty.Name); Assert.Equal( - new[] { nameof(Customer.AlternateKey) }, - entity.FindPrimaryKey()!.Properties.Select(p => p.Name)); - Assert.Empty(entity.GetKeys().Where(k => k != entity.FindPrimaryKey())); + @"Customer (Customer) Required + ComplexType: ComplexProperties.Customer#Customer + Properties: " + + @" + AlternateKey (Guid) Required + Id (int) Required + Name (string) + Notes (List) Element type: string Required + Title (string) Required", complexProperty.ToDebugString(), ignoreLineEndingDifferences: true); } protected override TestModelBuilder CreateModelBuilder(Action? configure = null) @@ -586,8 +665,76 @@ public virtual void Can_use_shared_type_as_join_entity_with_partition_keys() Assert.Equal(3, joinType.FindPrimaryKey()!.Properties.Count); Assert.Equal(6, joinType.GetProperties().Count()); Assert.Equal("DbContext", joinType.GetContainer()); - Assert.Equal("PartitionId", joinType.GetPartitionKeyPropertyName()); + Assert.Equal(["PartitionId"], joinType.GetPartitionKeyPropertyNames()); Assert.Equal("PartitionId", joinType.FindPrimaryKey()!.Properties.Last().Name); + +#pragma warning disable CS0618 // Type or member is obsolete + Assert.Equal("PartitionId", joinType.GetPartitionKeyPropertyName()); +#pragma warning restore CS0618 // Type or member is obsolete + } + + [ConditionalFact] + public virtual void Can_use_shared_type_as_join_entity_with_hierarchical_partition_keys() + { + var modelBuilder = CreateModelBuilder(); + + modelBuilder.Ignore(); + modelBuilder.Ignore(); + + modelBuilder.Entity( + mb => + { + mb.Property("PartitionId1"); + mb.Property("PartitionId2"); + mb.Property("PartitionId3"); + mb.HasPartitionKey("PartitionId1", "PartitionId2", "PartitionId3"); + }); + + modelBuilder.Entity( + mb => + { + mb.Property("PartitionId1"); + mb.Property("PartitionId2"); + mb.Property("PartitionId3"); + mb.HasPartitionKey("PartitionId1", "PartitionId2", "PartitionId3"); + }); + + modelBuilder.Entity() + .HasMany(e => e.Dependents) + .WithMany(e => e.ManyToManyPrincipals) + .UsingEntity>( + "JoinType", + e => e.HasOne().WithMany().HasAnnotation("Right", "Foo"), + e => e.HasOne().WithMany().HasAnnotation("Left", "Bar")); + + modelBuilder.Entity() + .HasMany(e => e.Dependents) + .WithMany(e => e.ManyToManyPrincipals) + .UsingEntity>( + "JoinType", + e => e.HasOne().WithMany().HasForeignKey("DependentId", "PartitionId1", "PartitionId2", "PartitionId3"), + e => e.HasOne().WithMany().HasForeignKey("PrincipalId", "PartitionId1", "PartitionId2", "PartitionId3"), + e => e.HasPartitionKey("PartitionId1", "PartitionId2", "PartitionId3")); + + var model = modelBuilder.FinalizeModel(); + + var joinType = model.FindEntityType("JoinType")!; + Assert.NotNull(joinType); + Assert.Collection(joinType.GetForeignKeys(), + fk => Assert.Equal("Foo", fk["Right"]), + fk => Assert.Equal("Bar", fk["Left"])); + + Assert.Equal( + new[] { "PartitionId1", "PartitionId2", "PartitionId3" }, + joinType.GetPartitionKeyProperties().Select(p => p.Name)); + + Assert.Equal( + new[] { "DependentId", "PrincipalId", "PartitionId1", "PartitionId2", "PartitionId3" }, + joinType.FindPrimaryKey()!.Properties.Select(p => p.Name)); + + Assert.Equal( + new[] { "__id", "PartitionId1", "PartitionId2", "PartitionId3" }, + joinType.GetKeys().Single(k => k != joinType.FindPrimaryKey()).Properties.Select(p => p.Name)); } [ConditionalFact] @@ -625,8 +772,67 @@ public virtual void Can_use_implicit_join_entity_with_partition_keys() Assert.Equal(3, joinType.FindPrimaryKey()!.Properties.Count); Assert.Equal(6, joinType.GetProperties().Count()); Assert.Equal("DbContext", joinType.GetContainer()); - Assert.Equal("PartitionId", joinType.GetPartitionKeyPropertyName()); + Assert.Equal(["PartitionId"], joinType.GetPartitionKeyPropertyNames()); Assert.Equal("PartitionId", joinType.FindPrimaryKey()!.Properties.Last().Name); + +#pragma warning disable CS0618 // Type or member is obsolete + Assert.Equal("PartitionId", joinType.GetPartitionKeyPropertyName()); +#pragma warning restore CS0618 // Type or member is obsolete + } + + [ConditionalFact] + public virtual void Can_use_implicit_join_entity_with_hierarchical_partition_keys() + { + var modelBuilder = CreateModelBuilder(); + + modelBuilder.Ignore(); + modelBuilder.Ignore(); + + modelBuilder.Entity( + mb => + { + mb.Ignore(e => e.Dependents); + mb.Property("PartitionId1"); + mb.Property("PartitionId2"); + mb.Property("PartitionId3"); + mb.HasPartitionKey("PartitionId1", "PartitionId2", "PartitionId3"); + }); + + modelBuilder.Entity( + mb => + { + mb.Property("PartitionId1"); + mb.Property("PartitionId2"); + mb.Property("PartitionId3"); + mb.HasPartitionKey("PartitionId1", "PartitionId2", "PartitionId3"); + }); + + modelBuilder.Entity() + .HasMany(e => e.Dependents) + .WithMany(e => e.ManyToManyPrincipals); + + var model = modelBuilder.FinalizeModel(); + + var joinType = model.FindEntityType("ManyToManyNavPrincipalNavDependent"); + Assert.NotNull(joinType); + + Assert.Equal( + new[] { "PartitionId1", "PartitionId2", "PartitionId3" }, + joinType.GetPartitionKeyProperties().Select(p => p.Name)); + + Assert.Equal( + new[] { "Id", "Id1", "PartitionId1", "PartitionId2", "PartitionId3" }, + joinType.FindPrimaryKey()!.Properties.Select(p => p.Name)); + + Assert.Equal( + new[] { "__id", "PartitionId1", "PartitionId2", "PartitionId3" }, + joinType.GetKeys().Single(k => k != joinType.FindPrimaryKey()).Properties.Select(p => p.Name)); + + + Assert.Equal(2, joinType.GetForeignKeys().Count()); + Assert.Equal(5, joinType.FindPrimaryKey()!.Properties.Count); + Assert.Equal(8, joinType.GetProperties().Count()); + Assert.Equal("DbContext", joinType.GetContainer()); } [ConditionalFact] @@ -673,8 +879,12 @@ public virtual void Can_use_implicit_join_entity_with_partition_keys_changed() Assert.Equal(3, joinType.FindPrimaryKey()!.Properties.Count); Assert.Equal(6, joinType.GetProperties().Count()); Assert.Equal("DbContext", joinType.GetContainer()); - Assert.Equal("Partition2Id", joinType.GetPartitionKeyPropertyName()); + Assert.Equal(["Partition2Id"], joinType.GetPartitionKeyPropertyNames()); Assert.Equal("Partition2Id", joinType.FindPrimaryKey()!.Properties.Last().Name); + +#pragma warning disable CS0618 // Type or member is obsolete + Assert.Equal("Partition2Id", joinType.GetPartitionKeyPropertyName()); +#pragma warning restore CS0618 // Type or member is obsolete } public override void Join_type_is_automatically_configured_by_convention() diff --git a/test/EFCore.Cosmos.FunctionalTests/ModelBuilding/CosmosTestModelBuilderExtensions.cs b/test/EFCore.Cosmos.FunctionalTests/ModelBuilding/CosmosTestModelBuilderExtensions.cs index 02f6e01bdad..ac71f179084 100644 --- a/test/EFCore.Cosmos.FunctionalTests/ModelBuilding/CosmosTestModelBuilderExtensions.cs +++ b/test/EFCore.Cosmos.FunctionalTests/ModelBuilding/CosmosTestModelBuilderExtensions.cs @@ -18,8 +18,8 @@ public static ModelBuilderTest.TestEntityTypeBuilder HasPartitionKey nonGenericBuilder: - var memberInfo = propertyExpression.GetMemberAccess(); - nonGenericBuilder.Instance.HasPartitionKey(memberInfo.Name); + var names = propertyExpression.GetMemberAccessList().Select(e => e.GetSimpleMemberName()).ToList(); + nonGenericBuilder.Instance.HasPartitionKey(names.FirstOrDefault(), names.Count > 1 ? names.Skip(1).ToArray() : []); break; } @@ -28,16 +28,17 @@ public static ModelBuilderTest.TestEntityTypeBuilder HasPartitionKey HasPartitionKey( this ModelBuilderTest.TestEntityTypeBuilder builder, - string name) + string name, + params string[] additionalPropertyNames) where TEntity : class { switch (builder) { case IInfrastructure> genericBuilder: - genericBuilder.Instance.HasPartitionKey(name); + genericBuilder.Instance.HasPartitionKey(name, additionalPropertyNames); break; case IInfrastructure nonGenericBuilder: - nonGenericBuilder.Instance.HasPartitionKey(name); + nonGenericBuilder.Instance.HasPartitionKey(name, additionalPropertyNames); break; } diff --git a/test/EFCore.Cosmos.FunctionalTests/OverzealousInitializationCosmosTest.cs b/test/EFCore.Cosmos.FunctionalTests/OverzealousInitializationCosmosTest.cs index 095f877ed0a..f0b85ef9408 100644 --- a/test/EFCore.Cosmos.FunctionalTests/OverzealousInitializationCosmosTest.cs +++ b/test/EFCore.Cosmos.FunctionalTests/OverzealousInitializationCosmosTest.cs @@ -15,6 +15,10 @@ public override void Fixup_ignores_eagerly_initialized_reference_navs() public class OverzealousInitializationCosmosFixture : OverzealousInitializationFixtureBase { + public override DbContextOptionsBuilder AddOptions(DbContextOptionsBuilder builder) + => base.AddOptions(builder.ConfigureWarnings( + w => w.Ignore(CosmosEventId.NoPartitionKeyDefined))); + protected override ITestStoreFactory TestStoreFactory => CosmosTestStoreFactory.Instance; } diff --git a/test/EFCore.Cosmos.FunctionalTests/Query/InheritanceQueryCosmosFixture.cs b/test/EFCore.Cosmos.FunctionalTests/Query/InheritanceQueryCosmosFixture.cs index d1e8a045de6..a446aa89dee 100644 --- a/test/EFCore.Cosmos.FunctionalTests/Query/InheritanceQueryCosmosFixture.cs +++ b/test/EFCore.Cosmos.FunctionalTests/Query/InheritanceQueryCosmosFixture.cs @@ -21,4 +21,8 @@ public override bool EnableComplexTypes public Task NoSyncTest(bool async, Func testCode) => CosmosTestHelpers.Instance.NoSyncTest(async, testCode); + + public override DbContextOptionsBuilder AddOptions(DbContextOptionsBuilder builder) + => base.AddOptions(builder.ConfigureWarnings( + w => w.Ignore(CoreEventId.MappedEntityTypeIgnoredWarning, CosmosEventId.NoPartitionKeyDefined))); } diff --git a/test/EFCore.Cosmos.FunctionalTests/Query/NorthwindQueryCosmosFixture.cs b/test/EFCore.Cosmos.FunctionalTests/Query/NorthwindQueryCosmosFixture.cs index 8e928c2d234..748a0c8eb5f 100644 --- a/test/EFCore.Cosmos.FunctionalTests/Query/NorthwindQueryCosmosFixture.cs +++ b/test/EFCore.Cosmos.FunctionalTests/Query/NorthwindQueryCosmosFixture.cs @@ -28,6 +28,10 @@ public Task NoSyncTest(bool async, Func testCode) public void NoSyncTest(Action testCode) => CosmosTestHelpers.Instance.NoSyncTest(testCode); + public override DbContextOptionsBuilder AddOptions(DbContextOptionsBuilder builder) + => base.AddOptions(builder.ConfigureWarnings( + w => w.Ignore(CosmosEventId.NoPartitionKeyDefined))); + protected override void OnModelCreating(ModelBuilder modelBuilder, DbContext context) { base.OnModelCreating(modelBuilder, context); diff --git a/test/EFCore.Cosmos.FunctionalTests/Query/OwnedQueryCosmosTest.cs b/test/EFCore.Cosmos.FunctionalTests/Query/OwnedQueryCosmosTest.cs index 5e8cf8886aa..2b1155b1400 100644 --- a/test/EFCore.Cosmos.FunctionalTests/Query/OwnedQueryCosmosTest.cs +++ b/test/EFCore.Cosmos.FunctionalTests/Query/OwnedQueryCosmosTest.cs @@ -741,6 +741,10 @@ protected override ITestStoreFactory TestStoreFactory public TestSqlLoggerFactory TestSqlLoggerFactory => (TestSqlLoggerFactory)ServiceProvider.GetRequiredService(); + public override DbContextOptionsBuilder AddOptions(DbContextOptionsBuilder builder) + => base.AddOptions(builder.ConfigureWarnings( + w => w.Ignore(CosmosEventId.NoPartitionKeyDefined))); + protected override void OnModelCreating(ModelBuilder modelBuilder, DbContext context) { modelBuilder.Entity( diff --git a/test/EFCore.Cosmos.FunctionalTests/Query/QueryLoggingCosmosTestBase.cs b/test/EFCore.Cosmos.FunctionalTests/Query/QueryLoggingCosmosTestBase.cs index 180f222cccf..f7b0aba7adb 100644 --- a/test/EFCore.Cosmos.FunctionalTests/Query/QueryLoggingCosmosTestBase.cs +++ b/test/EFCore.Cosmos.FunctionalTests/Query/QueryLoggingCosmosTestBase.cs @@ -43,7 +43,7 @@ public virtual async Task Queryable_simple() { Assert.Equal( CosmosResources.LogExecutingSqlQuery(new TestLogger()).GenerateMessage( - "NorthwindContext", "(null)", "", Environment.NewLine, + "NorthwindContext", "None", "", Environment.NewLine, """ SELECT c FROM root c @@ -89,7 +89,7 @@ public virtual async Task Queryable_with_parameter_outputs_parameter_value_loggi { Assert.Equal( CosmosResources.LogExecutingSqlQuery(new TestLogger()).GenerateMessage( - "NorthwindContext", "(null)", "@__city_0='Redmond'", Environment.NewLine, + "NorthwindContext", "None", "@__city_0='Redmond'", Environment.NewLine, """ SELECT c FROM root c diff --git a/test/EFCore.Cosmos.FunctionalTests/QueryExpressionInterceptionWithDiagnosticsCosmosTest.cs b/test/EFCore.Cosmos.FunctionalTests/QueryExpressionInterceptionWithDiagnosticsCosmosTest.cs index 02638ce97f9..b75a2e4645b 100644 --- a/test/EFCore.Cosmos.FunctionalTests/QueryExpressionInterceptionWithDiagnosticsCosmosTest.cs +++ b/test/EFCore.Cosmos.FunctionalTests/QueryExpressionInterceptionWithDiagnosticsCosmosTest.cs @@ -24,6 +24,9 @@ public class InterceptionCosmosFixture : InterceptionFixtureBase protected override ITestStoreFactory TestStoreFactory => CosmosTestStoreFactory.Instance; + public override DbContextOptionsBuilder AddOptions(DbContextOptionsBuilder builder) + => base.AddOptions(builder).ConfigureWarnings(w => w.Ignore(CosmosEventId.NoPartitionKeyDefined)); + protected override IServiceCollection InjectInterceptors( IServiceCollection serviceCollection, IEnumerable injectedInterceptors) diff --git a/test/EFCore.Cosmos.FunctionalTests/Scaffolding/Baselines/Basic_cosmos_model/DataEntityType.cs b/test/EFCore.Cosmos.FunctionalTests/Scaffolding/Baselines/Basic_cosmos_model/DataEntityType.cs index 87e38aadf10..3822e069ea0 100644 --- a/test/EFCore.Cosmos.FunctionalTests/Scaffolding/Baselines/Basic_cosmos_model/DataEntityType.cs +++ b/test/EFCore.Cosmos.FunctionalTests/Scaffolding/Baselines/Basic_cosmos_model/DataEntityType.cs @@ -78,15 +78,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas partitionId.TypeMapping = CosmosTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), converter: new ValueConverter( (long v) => string.Format(CultureInfo.InvariantCulture, "{0}", (object)v), @@ -127,19 +127,25 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas storeGenerationIndex: -1); blob.TypeMapping = CosmosTypeMapping.Default.Clone( comparer: new ValueComparer( - (byte[] v1, byte[] v2) => v1 == null ? v2 == null : v2 != null && v1.Length == v2.Length && v1 == v2 || v1.Zip(v2, (byte v1, byte v2) => v1 == v2).All((bool v) => v), - (byte[] v) => v.Aggregate(new HashCode(), (HashCode h, byte e) => ValueComparer.Add(h, (int)e), (HashCode h) => h.ToHashCode()), - (byte[] v) => v.Select((byte v) => v).ToArray()), - keyComparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), - (byte[] v) => StructuralComparisons.StructuralEqualityComparer.GetHashCode((object)v), - (byte[] source) => source.ToArray()), - providerValueComparer: new ValueComparer( + (byte[] v) => ((object)v).GetHashCode(), + (byte[] v) => v), + keyComparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), (byte[] v) => StructuralComparisons.StructuralEqualityComparer.GetHashCode((object)v), (byte[] source) => source.ToArray()), - clrType: typeof(byte[]), - jsonValueReaderWriter: JsonByteArrayReaderWriter.Instance); + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new ValueConverter( + (byte[] v) => Convert.ToBase64String(v), + (string v) => Convert.FromBase64String(v)), + jsonValueReaderWriter: new JsonConvertedValueReaderWriter( + JsonStringReaderWriter.Instance, + new ValueConverter( + (byte[] v) => Convert.ToBase64String(v), + (string v) => Convert.FromBase64String(v)))); blob.AddAnnotation("Cosmos:PropertyName", "JsonBlob"); blob.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("DataEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_Data_Blob", "TestNamespace") }); @@ -157,15 +163,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas __id.TypeMapping = CosmosTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), clrType: typeof(string), jsonValueReaderWriter: JsonStringReaderWriter.Instance); @@ -188,15 +194,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas __jObject.TypeMapping = CosmosTypeMapping.Default.Clone( comparer: new ValueComparer( (JObject v1, JObject v2) => object.Equals(v1, v2), - (JObject v) => v.GetHashCode(), + (JObject v) => ((object)v).GetHashCode(), (JObject v) => v), keyComparer: new ValueComparer( (JObject v1, JObject v2) => object.Equals(v1, v2), - (JObject v) => v.GetHashCode(), + (JObject v) => ((object)v).GetHashCode(), (JObject v) => v), providerValueComparer: new ValueComparer( (JObject v1, JObject v2) => object.Equals(v1, v2), - (JObject v) => v.GetHashCode(), + (JObject v) => ((object)v).GetHashCode(), (JObject v) => v), clrType: typeof(JObject)); __jObject.AddAnnotation("Cosmos:PropertyName", ""); @@ -218,15 +224,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas _etag.TypeMapping = CosmosTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), clrType: typeof(string), jsonValueReaderWriter: JsonStringReaderWriter.Instance); @@ -253,10 +259,10 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (CompiledModelTestBase.Data)source.Entity; - return (ISnapshot)new Snapshot, byte[], string, JObject, string>(((ValueComparer)id.GetValueComparer()).Snapshot(source.GetCurrentValue(id)), source.GetCurrentValue>(partitionId) == null ? null : ((ValueComparer>)partitionId.GetValueComparer()).Snapshot(source.GetCurrentValue>(partitionId)), source.GetCurrentValue(blob) == null ? null : ((ValueComparer)blob.GetValueComparer()).Snapshot(source.GetCurrentValue(blob)), source.GetCurrentValue(__id) == null ? null : ((ValueComparer)__id.GetValueComparer()).Snapshot(source.GetCurrentValue(__id)), source.GetCurrentValue(__jObject) == null ? null : ((ValueComparer)__jObject.GetValueComparer()).Snapshot(source.GetCurrentValue(__jObject)), source.GetCurrentValue(_etag) == null ? null : ((ValueComparer)_etag.GetValueComparer()).Snapshot(source.GetCurrentValue(_etag))); + return (ISnapshot)new Snapshot, byte[], string, JObject, string>(((ValueComparer)((IProperty)id).GetValueComparer()).Snapshot(source.GetCurrentValue(id)), source.GetCurrentValue>(partitionId) == null ? null : ((ValueComparer>)((IProperty)partitionId).GetValueComparer()).Snapshot(source.GetCurrentValue>(partitionId)), source.GetCurrentValue(blob) == null ? null : ((ValueComparer)((IProperty)blob).GetValueComparer()).Snapshot(source.GetCurrentValue(blob)), source.GetCurrentValue(__id) == null ? null : ((ValueComparer)((IProperty)__id).GetValueComparer()).Snapshot(source.GetCurrentValue(__id)), source.GetCurrentValue(__jObject) == null ? null : ((ValueComparer)((IProperty)__jObject).GetValueComparer()).Snapshot(source.GetCurrentValue(__jObject)), source.GetCurrentValue(_etag) == null ? null : ((ValueComparer)((IProperty)_etag).GetValueComparer()).Snapshot(source.GetCurrentValue(_etag))); }); runtimeEntityType.SetStoreGeneratedValuesFactory( - () => (ISnapshot)new Snapshot(default(JObject) == null ? null : ((ValueComparer)__jObject.GetValueComparer()).Snapshot(default(JObject)), default(string) == null ? null : ((ValueComparer)_etag.GetValueComparer()).Snapshot(default(string)))); + () => (ISnapshot)new Snapshot(default(JObject) == null ? null : ((ValueComparer)((IProperty)__jObject).GetValueComparer()).Snapshot(default(JObject)), default(string) == null ? null : ((ValueComparer)((IProperty)_etag).GetValueComparer()).Snapshot(default(string)))); runtimeEntityType.SetTemporaryValuesFactory( (InternalEntityEntry source) => (ISnapshot)new Snapshot(default(JObject), default(string))); runtimeEntityType.SetShadowValuesFactory( @@ -267,7 +273,7 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (CompiledModelTestBase.Data)source.Entity; - return (ISnapshot)new Snapshot, string>(((ValueComparer)id.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(id)), source.GetCurrentValue>(partitionId) == null ? null : ((ValueComparer>)partitionId.GetKeyValueComparer()).Snapshot(source.GetCurrentValue>(partitionId)), source.GetCurrentValue(__id) == null ? null : ((ValueComparer)__id.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(__id))); + return (ISnapshot)new Snapshot, string>(((ValueComparer)((IProperty)id).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(id)), source.GetCurrentValue>(partitionId) == null ? null : ((ValueComparer>)((IProperty)partitionId).GetKeyValueComparer()).Snapshot(source.GetCurrentValue>(partitionId)), source.GetCurrentValue(__id) == null ? null : ((ValueComparer)((IProperty)__id).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(__id))); }); runtimeEntityType.Counts = new PropertyCounts( propertyCount: 6, @@ -279,7 +285,7 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) storeGeneratedCount: 2); runtimeEntityType.AddAnnotation("Cosmos:ContainerName", "DataContainer"); runtimeEntityType.AddAnnotation("Cosmos:ETagName", "_etag"); - runtimeEntityType.AddAnnotation("Cosmos:PartitionKeyName", "PartitionId"); + runtimeEntityType.AddAnnotation("Cosmos:PartitionKeyNames", new List { "PartitionId" }); Customize(runtimeEntityType); } diff --git a/test/EFCore.Cosmos.FunctionalTests/Scaffolding/Baselines/SimpleModel/DependentDerivedEntityType.cs b/test/EFCore.Cosmos.FunctionalTests/Scaffolding/Baselines/SimpleModel/DependentDerivedEntityType.cs index c0d771cec6d..3db6887eba4 100644 --- a/test/EFCore.Cosmos.FunctionalTests/Scaffolding/Baselines/SimpleModel/DependentDerivedEntityType.cs +++ b/test/EFCore.Cosmos.FunctionalTests/Scaffolding/Baselines/SimpleModel/DependentDerivedEntityType.cs @@ -111,15 +111,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas data.TypeMapping = CosmosTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), clrType: typeof(string), jsonValueReaderWriter: JsonStringReaderWriter.Instance); @@ -139,15 +139,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas discriminator.TypeMapping = CosmosTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), clrType: typeof(string), jsonValueReaderWriter: JsonStringReaderWriter.Instance); @@ -166,15 +166,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas __id.TypeMapping = CosmosTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), clrType: typeof(string), jsonValueReaderWriter: JsonStringReaderWriter.Instance); @@ -197,15 +197,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas __jObject.TypeMapping = CosmosTypeMapping.Default.Clone( comparer: new ValueComparer( (JObject v1, JObject v2) => object.Equals(v1, v2), - (JObject v) => v.GetHashCode(), + (JObject v) => ((object)v).GetHashCode(), (JObject v) => v), keyComparer: new ValueComparer( (JObject v1, JObject v2) => object.Equals(v1, v2), - (JObject v) => v.GetHashCode(), + (JObject v) => ((object)v).GetHashCode(), (JObject v) => v), providerValueComparer: new ValueComparer( (JObject v1, JObject v2) => object.Equals(v1, v2), - (JObject v) => v.GetHashCode(), + (JObject v) => ((object)v).GetHashCode(), (JObject v) => v), clrType: typeof(JObject)); __jObject.AddAnnotation("Cosmos:PropertyName", ""); @@ -231,10 +231,10 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (CompiledModelTestBase.DependentDerived)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)id.GetValueComparer()).Snapshot(source.GetCurrentValue(id)), source.GetCurrentValue(data) == null ? null : ((ValueComparer)data.GetValueComparer()).Snapshot(source.GetCurrentValue(data)), source.GetCurrentValue(discriminator) == null ? null : ((ValueComparer)discriminator.GetValueComparer()).Snapshot(source.GetCurrentValue(discriminator)), source.GetCurrentValue(__id) == null ? null : ((ValueComparer)__id.GetValueComparer()).Snapshot(source.GetCurrentValue(__id)), source.GetCurrentValue(__jObject) == null ? null : ((ValueComparer)__jObject.GetValueComparer()).Snapshot(source.GetCurrentValue(__jObject))); + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetValueComparer()).Snapshot(source.GetCurrentValue(id)), source.GetCurrentValue(data) == null ? null : ((ValueComparer)((IProperty)data).GetValueComparer()).Snapshot(source.GetCurrentValue(data)), source.GetCurrentValue(discriminator) == null ? null : ((ValueComparer)((IProperty)discriminator).GetValueComparer()).Snapshot(source.GetCurrentValue(discriminator)), source.GetCurrentValue(__id) == null ? null : ((ValueComparer)((IProperty)__id).GetValueComparer()).Snapshot(source.GetCurrentValue(__id)), source.GetCurrentValue(__jObject) == null ? null : ((ValueComparer)((IProperty)__jObject).GetValueComparer()).Snapshot(source.GetCurrentValue(__jObject))); }); runtimeEntityType.SetStoreGeneratedValuesFactory( - () => (ISnapshot)new Snapshot(default(JObject) == null ? null : ((ValueComparer)__jObject.GetValueComparer()).Snapshot(default(JObject)))); + () => (ISnapshot)new Snapshot(default(JObject) == null ? null : ((ValueComparer)((IProperty)__jObject).GetValueComparer()).Snapshot(default(JObject)))); runtimeEntityType.SetTemporaryValuesFactory( (InternalEntityEntry source) => (ISnapshot)new Snapshot(default(JObject))); runtimeEntityType.SetShadowValuesFactory( @@ -245,7 +245,7 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (CompiledModelTestBase.DependentDerived)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)id.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(id)), source.GetCurrentValue(__id) == null ? null : ((ValueComparer)__id.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(__id))); + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(id)), source.GetCurrentValue(__id) == null ? null : ((ValueComparer)((IProperty)__id).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(__id))); }); runtimeEntityType.Counts = new PropertyCounts( propertyCount: 5, diff --git a/test/EFCore.Cosmos.FunctionalTests/Scaffolding/CompiledModelCosmosTest.cs b/test/EFCore.Cosmos.FunctionalTests/Scaffolding/CompiledModelCosmosTest.cs index 7f568252209..72d63b646a8 100644 --- a/test/EFCore.Cosmos.FunctionalTests/Scaffolding/CompiledModelCosmosTest.cs +++ b/test/EFCore.Cosmos.FunctionalTests/Scaffolding/CompiledModelCosmosTest.cs @@ -13,7 +13,7 @@ namespace Microsoft.EntityFrameworkCore.Scaffolding; public class CompiledModelCosmosTest : CompiledModelTestBase { [ConditionalFact] - public virtual void Basic_cosmos_model() + public virtual Task Basic_cosmos_model() => Test( modelBuilder => { @@ -147,14 +147,12 @@ public virtual void Basic_cosmos_model() }); // Primitive collections not supported yet - public override void BigModel() - { - } + public override Task BigModel() + => Task.CompletedTask; // Primitive collections not supported yet - public override void ComplexTypes() - { - } + public override Task ComplexTypes() + => Task.CompletedTask; protected override TestHelpers TestHelpers => CosmosTestHelpers.Instance; protected override ITestStoreFactory TestStoreFactory => CosmosTestStoreFactory.Instance; @@ -166,4 +164,34 @@ protected override BuildSource AddReferences(BuildSource build, [CallerFilePath] build.References.Add(BuildReference.ByName("Newtonsoft.Json")); return build; } + + protected override Task<(TContext?, IModel?)> Test( + Action? onModelCreating = null, + Action? assertModel = null, + Func? useContext = null, + Action? onConfiguring = null, + CompiledModelCodeGenerationOptions? options = null, + Func? addServices = null, + Func? addDesignTimeServices = null, + IEnumerable? additionalSourceFiles = null, + Action? assertAssembly = null, + string? expectedExceptionMessage = null, + [CallerMemberName] string testName = "") + where TContext : class + => base.Test( + onModelCreating, + assertModel, + useContext, + b => + { + onConfiguring?.Invoke(b); + b.ConfigureWarnings(w => w.Ignore(CosmosEventId.NoPartitionKeyDefined)); + }, + options, + addServices, + addDesignTimeServices, + additionalSourceFiles, + assertAssembly, + expectedExceptionMessage, + testName); } diff --git a/test/EFCore.Cosmos.FunctionalTests/TestUtilities/CosmosTestHelpers.cs b/test/EFCore.Cosmos.FunctionalTests/TestUtilities/CosmosTestHelpers.cs index e8f5a343940..77c7531b5bf 100644 --- a/test/EFCore.Cosmos.FunctionalTests/TestUtilities/CosmosTestHelpers.cs +++ b/test/EFCore.Cosmos.FunctionalTests/TestUtilities/CosmosTestHelpers.cs @@ -33,6 +33,8 @@ private static readonly string SyncMessage CosmosResources.LogSyncNotSupported(new TestLogger()).GenerateMessage(), "CosmosEventId.SyncNotSupported"); + public override LoggingDefinitions LoggingDefinitions { get; } = new CosmosLoggingDefinitions(); + public async Task NoSyncTest(bool async, Func testCode) { try diff --git a/test/EFCore.Cosmos.FunctionalTests/TestUtilities/CosmosTestStore.cs b/test/EFCore.Cosmos.FunctionalTests/TestUtilities/CosmosTestStore.cs index 8e44164411e..ac6e1e53c66 100644 --- a/test/EFCore.Cosmos.FunctionalTests/TestUtilities/CosmosTestStore.cs +++ b/test/EFCore.Cosmos.FunctionalTests/TestUtilities/CosmosTestStore.cs @@ -239,24 +239,35 @@ public override async Task CleanAsync(DbContext context) foreach (var containerProperties in await containerIterator.ReadNextAsync()) { var container = database.GetContainer(containerProperties.Id); - var partitionKey = containerProperties.PartitionKeyPath[1..]; + var partitionKeys = containerProperties.PartitionKeyPaths.Select(p => p[1..]).ToList(); var itemIterator = container.GetItemQueryIterator( new QueryDefinition("SELECT * FROM c")); - var items = new List<(string Id, string PartitionKey)>(); + var items = new List<(string Id, PartitionKey PartitionKeyValue)>(); while (itemIterator.HasMoreResults) { foreach (var item in await itemIterator.ReadNextAsync()) { - items.Add((item["id"]!.ToString(), item[partitionKey]?.ToString()!)); + var partitionKeyValue = PartitionKey.None; + if (partitionKeys.Count >= 1 + && item[partitionKeys[0]] is not null) + { + var builder = new PartitionKeyBuilder(); + foreach (var partitionKey in partitionKeys) + { + builder.Add((string?)item[partitionKey]); + } + + partitionKeyValue = builder.Build(); + } + + items.Add((item["id"]!.ToString(), partitionKeyValue)); } } foreach (var item in items) { - await container.DeleteItemAsync( - item.Id, - item.PartitionKey == null ? PartitionKey.None : new PartitionKey(item.PartitionKey)); + await container.DeleteItemAsync(item.Id, item.PartitionKeyValue); } } } diff --git a/test/EFCore.Cosmos.FunctionalTests/TestUtilities/CustomPartitionKeyIdGenerator.cs b/test/EFCore.Cosmos.FunctionalTests/TestUtilities/CustomPartitionKeyIdGenerator.cs index f229fc9e0c4..11dd9703290 100644 --- a/test/EFCore.Cosmos.FunctionalTests/TestUtilities/CustomPartitionKeyIdGenerator.cs +++ b/test/EFCore.Cosmos.FunctionalTests/TestUtilities/CustomPartitionKeyIdGenerator.cs @@ -29,10 +29,10 @@ protected override object NextValue(EntityEntry entry) builder.Append("-"); } - var partitionKey = entityType.GetPartitionKeyPropertyName(); + var partitionKeyNames = entityType.GetPartitionKeyPropertyNames(); foreach (var property in primaryKey.Properties) { - if (property.Name == partitionKey + if (partitionKeyNames.Contains(property.Name) || property.GetJsonPropertyName() == StoreKeyConvention.IdPropertyJsonName) { continue; diff --git a/test/EFCore.Cosmos.FunctionalTests/ValueConvertersEndToEndCosmosTest.cs b/test/EFCore.Cosmos.FunctionalTests/ValueConvertersEndToEndCosmosTest.cs index b3b711d5c06..c4c50a518d7 100644 --- a/test/EFCore.Cosmos.FunctionalTests/ValueConvertersEndToEndCosmosTest.cs +++ b/test/EFCore.Cosmos.FunctionalTests/ValueConvertersEndToEndCosmosTest.cs @@ -13,6 +13,9 @@ public class ValueConvertersEndToEndCosmosFixture : ValueConvertersEndToEndFixtu protected override ITestStoreFactory TestStoreFactory => CosmosTestStoreFactory.Instance; + public override DbContextOptionsBuilder AddOptions(DbContextOptionsBuilder builder) + => base.AddOptions(builder).ConfigureWarnings(w => w.Ignore(CosmosEventId.NoPartitionKeyDefined)); + protected override void OnModelCreating(ModelBuilder modelBuilder, DbContext context) { base.OnModelCreating(modelBuilder, context); diff --git a/test/EFCore.Cosmos.Tests/Diagnostics/CosmosEventIdTest.cs b/test/EFCore.Cosmos.Tests/Diagnostics/CosmosEventIdTest.cs index 847c3b37bff..6b8bbae1800 100644 --- a/test/EFCore.Cosmos.Tests/Diagnostics/CosmosEventIdTest.cs +++ b/test/EFCore.Cosmos.Tests/Diagnostics/CosmosEventIdTest.cs @@ -3,6 +3,7 @@ using Microsoft.EntityFrameworkCore.Cosmos.Diagnostics.Internal; using Microsoft.EntityFrameworkCore.Cosmos.Storage.Internal; +using Microsoft.EntityFrameworkCore.Metadata.Internal; // ReSharper disable InconsistentNaming namespace Microsoft.EntityFrameworkCore.Cosmos.Diagnostics; @@ -12,8 +13,12 @@ public class CosmosEventIdTest : EventIdTestBase [ConditionalFact] public void Every_eventId_has_a_logger_method_and_logs_when_level_enabled() { + var model = new Model(); + var entityType = model.AddEntityType(typeof(object), owned: false, ConfigurationSource.Convention); + var fakeFactories = new Dictionary> { + { typeof(IEntityType), () => entityType }, { typeof(CosmosSqlQuery), () => new CosmosSqlQuery( "Some SQL...", diff --git a/test/EFCore.Cosmos.Tests/Extensions/CosmosBuilderExtensionsTest.cs b/test/EFCore.Cosmos.Tests/Extensions/CosmosBuilderExtensionsTest.cs index d022cb7f914..090a5088faa 100644 --- a/test/EFCore.Cosmos.Tests/Extensions/CosmosBuilderExtensionsTest.cs +++ b/test/EFCore.Cosmos.Tests/Extensions/CosmosBuilderExtensionsTest.cs @@ -35,23 +35,76 @@ public void Can_get_and_set_partition_key_name() var entityTypeBuilder = modelBuilder.Entity(); var entityType = entityTypeBuilder.Metadata; + ((IConventionEntityType)entityType).Builder.HasPartitionKey(["pk"]); + Assert.Equal("pk", entityType.GetPartitionKeyPropertyNames().Single()); + Assert.Equal( + ConfigurationSource.Convention, + ((IConventionEntityType)entityType).GetPartitionKeyPropertyNamesConfigurationSource()); + +#pragma warning disable CS0618 // Type or member is obsolete ((IConventionEntityType)entityType).Builder.HasPartitionKey("pk"); Assert.Equal("pk", entityType.GetPartitionKeyPropertyName()); Assert.Equal( ConfigurationSource.Convention, ((IConventionEntityType)entityType).GetPartitionKeyPropertyNameConfigurationSource()); +#pragma warning restore CS0618 // Type or member is obsolete entityTypeBuilder.HasPartitionKey("pk"); + + Assert.Equal("pk", entityType.GetPartitionKeyPropertyNames().Single()); + Assert.Equal( + ConfigurationSource.Explicit, + ((IConventionEntityType)entityType).GetPartitionKeyPropertyNamesConfigurationSource()); + + Assert.False(((IConventionEntityType)entityType).Builder.CanSetPartitionKey(["partition"])); + +#pragma warning disable CS0618 // Type or member is obsolete Assert.Equal("pk", entityType.GetPartitionKeyPropertyName()); Assert.Equal( ConfigurationSource.Explicit, ((IConventionEntityType)entityType).GetPartitionKeyPropertyNameConfigurationSource()); Assert.False(((IConventionEntityType)entityType).Builder.CanSetPartitionKey("partition")); +#pragma warning restore CS0618 // Type or member is obsolete entityTypeBuilder.HasPartitionKey(null); + + Assert.Empty(entityType.GetPartitionKeyPropertyNames()); + Assert.Null(((IConventionEntityType)entityType).GetPartitionKeyPropertyNamesConfigurationSource()); + +#pragma warning disable CS0618 // Type or member is obsolete Assert.Null(entityType.GetPartitionKeyPropertyName()); Assert.Null(((IConventionEntityType)entityType).GetPartitionKeyPropertyNameConfigurationSource()); +#pragma warning restore CS0618 // Type or member is obsolete + } + + [ConditionalFact] + public void Can_get_and_set_hierarchical_partition_key_name() + { + var modelBuilder = CreateConventionModelBuilder(); + + var entityTypeBuilder = modelBuilder.Entity(); + var entityType = entityTypeBuilder.Metadata; + + ((IConventionEntityType)entityType).Builder.HasPartitionKey(["pk1", "pk2", "pk3", "pk4", "pk5"]); + Assert.Equal(["pk1", "pk2", "pk3", "pk4", "pk5"], entityType.GetPartitionKeyPropertyNames()); + Assert.Equal( + ConfigurationSource.Convention, + ((IConventionEntityType)entityType).GetPartitionKeyPropertyNamesConfigurationSource()); + + entityTypeBuilder.HasPartitionKey("pk1", "pk2", "pk3", "pk4", "pk5"); + + Assert.Equal(["pk1", "pk2", "pk3", "pk4", "pk5"], entityType.GetPartitionKeyPropertyNames()); + Assert.Equal( + ConfigurationSource.Explicit, + ((IConventionEntityType)entityType).GetPartitionKeyPropertyNamesConfigurationSource()); + + Assert.False(((IConventionEntityType)entityType).Builder.CanSetPartitionKey(["partition", "p2", "p3"])); + + entityTypeBuilder.HasPartitionKey(null); + + Assert.Empty(entityType.GetPartitionKeyPropertyNames()); + Assert.Null(((IConventionEntityType)entityType).GetPartitionKeyPropertyNamesConfigurationSource()); } [ConditionalFact] @@ -62,7 +115,7 @@ public void Default_container_name_is_used_if_not_set() modelBuilder .Entity(); - var entityType = modelBuilder.Model.FindEntityType(typeof(Customer)); + var entityType = modelBuilder.Model.FindEntityType(typeof(Customer))!; modelBuilder.HasDefaultContainer(null); Assert.Equal(nameof(Customer), entityType.GetContainer()); @@ -87,9 +140,9 @@ public void Default_discriminator_can_be_removed() modelBuilder.Entity(); - var entityType = modelBuilder.Model.FindEntityType(typeof(Customer)); + var entityType = modelBuilder.Model.FindEntityType(typeof(Customer))!; - Assert.Equal("Discriminator", entityType.FindDiscriminatorProperty().Name); + Assert.Equal("Discriminator", entityType.FindDiscriminatorProperty()!.Name); Assert.Equal(nameof(Customer), entityType.GetDiscriminatorValue()); modelBuilder.Entity().HasNoDiscriminator(); @@ -99,7 +152,7 @@ public void Default_discriminator_can_be_removed() modelBuilder.Entity().HasBaseType(); - Assert.Equal("Discriminator", entityType.FindDiscriminatorProperty().Name); + Assert.Equal("Discriminator", entityType.FindDiscriminatorProperty()!.Name); Assert.Equal(nameof(Customer), entityType.GetDiscriminatorValue()); modelBuilder.Entity().HasBaseType((string)null); @@ -114,7 +167,7 @@ public void Can_set_etag_concurrency_entity() modelBuilder.Entity().UseETagConcurrency(); var model = modelBuilder.Model; - var etagProperty = model.FindEntityType(typeof(Customer).FullName).FindProperty("_etag"); + var etagProperty = model.FindEntityType(typeof(Customer).FullName!)!.FindProperty("_etag"); Assert.NotNull(etagProperty); Assert.Equal(ValueGenerated.OnAddOrUpdate, etagProperty.ValueGenerated); Assert.True(etagProperty.IsConcurrencyToken); @@ -127,7 +180,7 @@ public void Can_set_etag_concurrency_property() modelBuilder.Entity().Property(x => x.ETag).IsETagConcurrency(); var model = modelBuilder.Model; - var etagProperty = model.FindEntityType(typeof(Customer).FullName).FindProperty("ETag"); + var etagProperty = model.FindEntityType(typeof(Customer).FullName!)!.FindProperty("ETag"); Assert.NotNull(etagProperty); Assert.Equal(ValueGenerated.OnAddOrUpdate, etagProperty.ValueGenerated); Assert.True(etagProperty.IsConcurrencyToken); diff --git a/test/EFCore.Cosmos.Tests/Extensions/CosmosMetadataExtensionsTest.cs b/test/EFCore.Cosmos.Tests/Extensions/CosmosMetadataExtensionsTest.cs index 49bad673be4..e9cb25f25f9 100644 --- a/test/EFCore.Cosmos.Tests/Extensions/CosmosMetadataExtensionsTest.cs +++ b/test/EFCore.Cosmos.Tests/Extensions/CosmosMetadataExtensionsTest.cs @@ -41,6 +41,32 @@ public void Can_get_and_set_partition_key_name() var entityType = modelBuilder .Entity().Metadata; + Assert.Empty(entityType.GetPartitionKeyPropertyNames()); + + ((IConventionEntityType)entityType).SetPartitionKeyPropertyNames(["pk"]); + Assert.Equal("pk", entityType.GetPartitionKeyPropertyNames().Single()); + Assert.Equal( + ConfigurationSource.Convention, ((IConventionEntityType)entityType).GetPartitionKeyPropertyNamesConfigurationSource()); + + entityType.SetPartitionKeyPropertyNames(["pk"]); + Assert.Equal("pk", entityType.GetPartitionKeyPropertyNames().Single()); + Assert.Equal( + ConfigurationSource.Explicit, ((IConventionEntityType)entityType).GetPartitionKeyPropertyNamesConfigurationSource()); + + entityType.SetPartitionKeyPropertyNames(null); + Assert.Empty(entityType.GetPartitionKeyPropertyNames()); + Assert.Null(((IConventionEntityType)entityType).GetPartitionKeyPropertyNamesConfigurationSource()); + } + + [ConditionalFact] + public void Can_get_and_set_partition_key_name_obsolete() + { + var modelBuilder = CreateModelBuilder(); + + var entityType = modelBuilder + .Entity().Metadata; + +#pragma warning disable CS0618 // Type or member is obsolete Assert.Null(entityType.GetPartitionKeyPropertyName()); ((IConventionEntityType)entityType).SetPartitionKeyPropertyName("pk"); @@ -56,9 +82,35 @@ public void Can_get_and_set_partition_key_name() entityType.SetPartitionKeyPropertyName(null); Assert.Null(entityType.GetPartitionKeyPropertyName()); Assert.Null(((IConventionEntityType)entityType).GetPartitionKeyPropertyNameConfigurationSource()); +#pragma warning restore CS0618 // Type or member is obsolete } [ConditionalFact] + public void Can_get_and_set_hierarchical_partition_key_name() + { + var modelBuilder = CreateModelBuilder(); + + var entityType = modelBuilder + .Entity().Metadata; + + Assert.Empty(entityType.GetPartitionKeyPropertyNames()); + + ((IConventionEntityType)entityType).SetPartitionKeyPropertyNames(["pk1", "pk2", "pk3"]); + Assert.Equal(["pk1", "pk2", "pk3"], entityType.GetPartitionKeyPropertyNames()); + Assert.Equal( + ConfigurationSource.Convention, ((IConventionEntityType)entityType).GetPartitionKeyPropertyNamesConfigurationSource()); + + entityType.SetPartitionKeyPropertyNames(["pk1", "pk2", "pk3"]); + Assert.Equal(["pk1", "pk2", "pk3"], entityType.GetPartitionKeyPropertyNames()); + Assert.Equal( + ConfigurationSource.Explicit, ((IConventionEntityType)entityType).GetPartitionKeyPropertyNamesConfigurationSource()); + + entityType.SetPartitionKeyPropertyNames(null); + Assert.Empty(entityType.GetPartitionKeyPropertyNames()); + Assert.Null(((IConventionEntityType)entityType).GetPartitionKeyPropertyNamesConfigurationSource()); + } + + [ConditionalFact] public void Can_get_and_set_etag_name() { var modelBuilder = CreateModelBuilder(); diff --git a/test/EFCore.Cosmos.Tests/Extensions/PartitionKeyBuilderExtensionsTest.cs b/test/EFCore.Cosmos.Tests/Extensions/PartitionKeyBuilderExtensionsTest.cs new file mode 100644 index 00000000000..f44b785bb44 --- /dev/null +++ b/test/EFCore.Cosmos.Tests/Extensions/PartitionKeyBuilderExtensionsTest.cs @@ -0,0 +1,165 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +#nullable enable + +using Microsoft.Azure.Cosmos; +using Microsoft.EntityFrameworkCore.Cosmos.Internal; +using Microsoft.EntityFrameworkCore.Internal; + +namespace Microsoft.EntityFrameworkCore.Cosmos; + +public class PartitionKeyBuilderExtensionsTest +{ + [ConditionalFact] + public void Add_expected_value_types() + { + using var context = new PartitionKeyContext(); + + var builder = new PartitionKeyBuilder(); + + builder.Add("1", FindProperty(context, typeof(Customer1), nameof(Customer1.String))); + builder.Add(1.1, FindProperty(context, typeof(Customer1), nameof(Customer1.Double))); + builder.Add(1, FindProperty(context, typeof(Customer1), nameof(Customer1.Int))); + builder.Add(true, FindProperty(context, typeof(Customer2), nameof(Customer2.Bool))); + builder.Add("1.1", FindProperty(context, typeof(Customer2), nameof(Customer2.NullableString))); + builder.Add(1.1, FindProperty(context, typeof(Customer2), nameof(Customer2.NullableDouble))); + builder.Add(true, FindProperty(context, typeof(Customer3), nameof(Customer3.NullableBool))); + builder.Add(1, FindProperty(context, typeof(Customer3), nameof(Customer3.NullableInt))); + builder.Add(Guid.NewGuid(), FindProperty(context, typeof(Customer3), nameof(Customer3.Guid))); + builder.Add(Guid.NewGuid(), FindProperty(context, typeof(Customer4), nameof(Customer4.NullableGuid))); + builder.Add(1, FindProperty(context, typeof(Customer4), nameof(Customer4.Long))); + builder.Add(1, FindProperty(context, typeof(Customer4), nameof(Customer4.NullableLong))); + + builder.Add((double?)1.1, FindProperty(context, typeof(Customer2), nameof(Customer2.NullableDouble))); + builder.Add((bool?)true, FindProperty(context, typeof(Customer3), nameof(Customer3.NullableBool))); + builder.Add((int?)1, FindProperty(context, typeof(Customer3), nameof(Customer3.NullableInt))); + builder.Add((Guid?)Guid.NewGuid(), FindProperty(context, typeof(Customer4), nameof(Customer4.NullableGuid))); + builder.Add((int?)1, FindProperty(context, typeof(Customer4), nameof(Customer4.NullableLong))); + + builder.Add(null, FindProperty(context, typeof(Customer2), nameof(Customer2.NullableDouble))); + builder.Add(null, FindProperty(context, typeof(Customer3), nameof(Customer3.NullableBool))); + builder.Add(null, FindProperty(context, typeof(Customer3), nameof(Customer3.NullableInt))); + builder.Add(null, FindProperty(context, typeof(Customer4), nameof(Customer4.NullableGuid))); + builder.Add(null, FindProperty(context, typeof(Customer4), nameof(Customer4.NullableLong))); + } + + [ConditionalFact] + public void Throw_for_unexpected_types() + { + using var context = new PartitionKeyContext(); + + var builder = new PartitionKeyBuilder(); + + Assert.Equal( + CosmosStrings.PartitionKeyBadValueType("string", nameof(Customer1), nameof(Customer1.String), "int"), + Assert.Throws( + () => builder.Add(1, FindProperty(context, typeof(Customer1), nameof(Customer1.String)))).Message); + + Assert.Equal( + CosmosStrings.PartitionKeyBadValueType("bool", nameof(Customer2), nameof(Customer2.Bool), "int"), + Assert.Throws( + () => builder.Add(1, FindProperty(context, typeof(Customer2), nameof(Customer2.Bool)))).Message); + + Assert.Equal( + CosmosStrings.PartitionKeyBadValueType("double", nameof(Customer1), nameof(Customer1.Double), "string"), + Assert.Throws( + () => builder.Add("1", FindProperty(context, typeof(Customer1), nameof(Customer1.Double)))).Message); + + Assert.Equal( + CosmosStrings.PartitionKeyBadValueType("int", nameof(Customer1), nameof(Customer1.Int), "string"), + Assert.Throws( + () => builder.Add("1", FindProperty(context, typeof(Customer1), nameof(Customer1.Int)))).Message); + } + + private static IProperty FindProperty(PartitionKeyContext context, Type type, string name) + => context.Model.FindEntityType(type)!.FindProperty(name)!; + + private class PartitionKeyContext : DbContext + { + protected override void OnModelCreating(ModelBuilder modelBuilder) + { + modelBuilder.Entity( + cb => + { + cb.ToContainer("C1"); + cb.HasPartitionKey( + c => new + { + PartitionKey1 = c.String, + PartitionKey2 = c.Double, + PartitionKey3 = c.Int + }); + }); + + modelBuilder.Entity( + cb => + { + cb.ToContainer("C2"); + cb.HasPartitionKey( + c => new + { + PartitionKey4 = c.Bool, + PartitionKey5 = c.NullableString, + PartitionKey6 = c.NullableDouble + }); + }); + + modelBuilder.Entity( + cb => + { + cb.ToContainer("C3"); + cb.HasPartitionKey( + c => new + { + PartitionKey7 = c.NullableInt, + PartitionKey8 = c.NullableBool, + PartitionKey9 = c.Guid + }); + }); + + modelBuilder.Entity( + cb => + { + cb.ToContainer("C4"); + cb.HasPartitionKey(c => new { PartitionKey7 = c.NullableGuid }); + }); + } + + protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) + => optionsBuilder.UseCosmos("localhost", "_", "_"); + } + + public class Customer1 + { + public int Id { get; set; } + + public string String { get; set; } = null!; + public double Double { get; set; } + public int Int { get; set; } + } + + public class Customer2 + { + public int Id { get; set; } + public bool Bool { get; set; } + public string? NullableString { get; set; } + public double? NullableDouble { get; set; } + } + + public class Customer3 + { + public int Id { get; set; } + public int? NullableInt { get; set; } + public bool? NullableBool { get; set; } + public Guid Guid { get; set; } + } + + public class Customer4 + { + public int Id { get; set; } + public Guid? NullableGuid { get; set; } + public long Long { get; set; } + public long? NullableLong { get; set; } + } +} diff --git a/test/EFCore.Cosmos.Tests/Infrastructure/CosmosModelValidatorTest.cs b/test/EFCore.Cosmos.Tests/Infrastructure/CosmosModelValidatorTest.cs index 2199963c4a7..b305ec44de1 100644 --- a/test/EFCore.Cosmos.Tests/Infrastructure/CosmosModelValidatorTest.cs +++ b/test/EFCore.Cosmos.Tests/Infrastructure/CosmosModelValidatorTest.cs @@ -141,7 +141,7 @@ public virtual void Detects_missing_partition_key_property() modelBuilder.Entity(); modelBuilder.Entity().HasPartitionKey("PartitionKey"); - VerifyError(CosmosStrings.PartitionKeyMissingProperty(typeof(Order).Name, "PartitionKey"), modelBuilder); + VerifyError(CosmosStrings.PartitionKeyMissingProperty(nameof(Order), "PartitionKey"), modelBuilder); } [ConditionalFact] @@ -151,7 +151,7 @@ public virtual void Detects_missing_partition_key_on_first_type() modelBuilder.Entity().ToContainer("Orders"); modelBuilder.Entity().ToContainer("Orders").HasPartitionKey(c => c.PartitionId); - VerifyError(CosmosStrings.NoPartitionKey(typeof(Customer).Name, "Orders"), modelBuilder); + VerifyError(CosmosStrings.NoPartitionKey(nameof(Customer), "", nameof(Order), "PartitionId", "Orders"), modelBuilder); } [ConditionalFact] @@ -161,7 +161,43 @@ public virtual void Detects_missing_partition_keys_one_last_type() modelBuilder.Entity().ToContainer("Orders").HasPartitionKey(c => c.PartitionId); modelBuilder.Entity().ToContainer("Orders"); - VerifyError(CosmosStrings.NoPartitionKey(typeof(Order).Name, "Orders"), modelBuilder); + VerifyError(CosmosStrings.NoPartitionKey(nameof(Customer), "PartitionId", nameof(Order), "", "Orders"), modelBuilder); + } + + [ConditionalFact] + public virtual void Detects_missing_partition_key_properties_composite_less_first() + { + var modelBuilder = CreateConventionModelBuilder(); + modelBuilder.Entity().ToContainer("Orders").HasPartitionKey(c => new { c.PartitionId, c.Id, c.Name }); + modelBuilder.Entity().ToContainer("Orders").HasPartitionKey(c => new { c.PartitionId, c.Id }); + + VerifyError(CosmosStrings.NoPartitionKey(nameof(Customer), "PartitionId,Id,Name", nameof(Order), "PartitionId,Id", "Orders"), modelBuilder); + } + + [ConditionalFact] + public virtual void Detects_missing_partition_key_properties_composite_less_last() + { + var modelBuilder = CreateConventionModelBuilder(); + modelBuilder.Entity().ToContainer("Orders").HasPartitionKey(c => new { c.PartitionId }); + modelBuilder.Entity().ToContainer("Orders").HasPartitionKey(c => new { c.PartitionId, c.Id }); + + VerifyError(CosmosStrings.NoPartitionKey(nameof(Customer), "PartitionId", nameof(Order), "PartitionId,Id", "Orders"), modelBuilder); + } + + [ConditionalFact] + public virtual void Detects_missing_partition_key_properties_composite_three() + { + var modelBuilder = CreateConventionModelBuilder(); + modelBuilder.Entity().ToContainer("Orders").HasPartitionKey(c => new { c.PartitionId, c.Id }); + modelBuilder.Entity().ToContainer("Orders").HasPartitionKey(c => new { c.PartitionId, c.Id }); + modelBuilder.Entity( + b => + { + b.HasKey(e => e.OrderId); + b.ToContainer("Orders").HasPartitionKey(c => new { c.OrderId }); + }); + + VerifyError(CosmosStrings.NoPartitionKey(nameof(Customer), "PartitionId,Id", nameof(OrderProduct), "OrderId", "Orders"), modelBuilder); } [ConditionalFact] @@ -178,19 +214,6 @@ public virtual void Detects_partition_keys_mapped_to_different_properties() nameof(Order.PartitionId)), modelBuilder); } - [ConditionalFact] - public virtual void Detects_partition_key_of_different_type() - { - var modelBuilder = CreateConventionModelBuilder(); - modelBuilder.Entity().ToContainer("Orders").HasPartitionKey(c => c.PartitionId); - modelBuilder.Entity().ToContainer("Orders").HasPartitionKey(o => o.PartitionId) - .Property(c => c.PartitionId).HasConversion(); - - VerifyError( - CosmosStrings.PartitionKeyNonStringStoreType( - nameof(Customer.PartitionId), typeof(Order).Name, "int"), modelBuilder); - } - [ConditionalFact] public virtual void Detects_conflicting_analytical_ttl() { diff --git a/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/ComplexTypes/PrincipalBaseEntityType.cs b/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/ComplexTypes/PrincipalBaseEntityType.cs index 3d5a84002c0..15f876dbc3d 100644 --- a/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/ComplexTypes/PrincipalBaseEntityType.cs +++ b/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/ComplexTypes/PrincipalBaseEntityType.cs @@ -72,15 +72,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas id.TypeMapping = InMemoryTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable)), providerValueComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable)), clrType: typeof(long), jsonValueReaderWriter: JsonInt64ReaderWriter.Instance); @@ -101,15 +101,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas discriminator.TypeMapping = InMemoryTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), clrType: typeof(string), jsonValueReaderWriter: JsonStringReaderWriter.Instance); @@ -144,15 +144,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum1.TypeMapping = InMemoryTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.AnEnum v1, CompiledModelTestBase.AnEnum v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.AnEnum v) => v.GetHashCode(), + (CompiledModelTestBase.AnEnum v) => ((object)v).GetHashCode(), (CompiledModelTestBase.AnEnum v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.AnEnum v1, CompiledModelTestBase.AnEnum v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.AnEnum v) => v.GetHashCode(), + (CompiledModelTestBase.AnEnum v) => ((object)v).GetHashCode(), (CompiledModelTestBase.AnEnum v) => v), providerValueComparer: new ValueComparer( (CompiledModelTestBase.AnEnum v1, CompiledModelTestBase.AnEnum v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.AnEnum v) => v.GetHashCode(), + (CompiledModelTestBase.AnEnum v) => ((object)v).GetHashCode(), (CompiledModelTestBase.AnEnum v) => v), clrType: typeof(CompiledModelTestBase.AnEnum), jsonValueReaderWriter: JsonSignedEnumReaderWriter.Instance); @@ -188,15 +188,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum2.TypeMapping = InMemoryTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.AnEnum)v1, (object)(CompiledModelTestBase.AnEnum)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.AnEnum)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.AnEnum)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.AnEnum)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.AnEnum)v1, (object)(CompiledModelTestBase.AnEnum)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.AnEnum)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.AnEnum)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.AnEnum)v : default(Nullable)), providerValueComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.AnEnum)v1, (object)(CompiledModelTestBase.AnEnum)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.AnEnum)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.AnEnum)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.AnEnum)v : default(Nullable)), clrType: typeof(CompiledModelTestBase.AnEnum), jsonValueReaderWriter: JsonSignedEnumReaderWriter.Instance); @@ -232,15 +232,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas flagsEnum1.TypeMapping = InMemoryTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.AFlagsEnum v1, CompiledModelTestBase.AFlagsEnum v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.AFlagsEnum v) => v.GetHashCode(), + (CompiledModelTestBase.AFlagsEnum v) => ((object)v).GetHashCode(), (CompiledModelTestBase.AFlagsEnum v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.AFlagsEnum v1, CompiledModelTestBase.AFlagsEnum v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.AFlagsEnum v) => v.GetHashCode(), + (CompiledModelTestBase.AFlagsEnum v) => ((object)v).GetHashCode(), (CompiledModelTestBase.AFlagsEnum v) => v), providerValueComparer: new ValueComparer( (CompiledModelTestBase.AFlagsEnum v1, CompiledModelTestBase.AFlagsEnum v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.AFlagsEnum v) => v.GetHashCode(), + (CompiledModelTestBase.AFlagsEnum v) => ((object)v).GetHashCode(), (CompiledModelTestBase.AFlagsEnum v) => v), clrType: typeof(CompiledModelTestBase.AFlagsEnum), jsonValueReaderWriter: JsonSignedEnumReaderWriter.Instance); @@ -276,15 +276,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas flagsEnum2.TypeMapping = InMemoryTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.AFlagsEnum v1, CompiledModelTestBase.AFlagsEnum v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.AFlagsEnum v) => v.GetHashCode(), + (CompiledModelTestBase.AFlagsEnum v) => ((object)v).GetHashCode(), (CompiledModelTestBase.AFlagsEnum v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.AFlagsEnum v1, CompiledModelTestBase.AFlagsEnum v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.AFlagsEnum v) => v.GetHashCode(), + (CompiledModelTestBase.AFlagsEnum v) => ((object)v).GetHashCode(), (CompiledModelTestBase.AFlagsEnum v) => v), providerValueComparer: new ValueComparer( (CompiledModelTestBase.AFlagsEnum v1, CompiledModelTestBase.AFlagsEnum v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.AFlagsEnum v) => v.GetHashCode(), + (CompiledModelTestBase.AFlagsEnum v) => ((object)v).GetHashCode(), (CompiledModelTestBase.AFlagsEnum v) => v), clrType: typeof(CompiledModelTestBase.AFlagsEnum), jsonValueReaderWriter: JsonSignedEnumReaderWriter.Instance); @@ -303,15 +303,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas principalBaseId.TypeMapping = InMemoryTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable)), providerValueComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable)), clrType: typeof(long), jsonValueReaderWriter: JsonInt64ReaderWriter.Instance); @@ -345,50 +345,50 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas relationshipIndex: -1, storeGenerationIndex: -1); refTypeArray.TypeMapping = InMemoryTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfReferenceTypesComparer(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)))), elementMapping: InMemoryTypeMapping.Default.Clone( comparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), keyComparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), converter: new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))); refTypeArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("PrincipalBaseEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalBase_RefTypeArray", "TestNamespace") }); @@ -420,34 +420,34 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas relationshipIndex: -1, storeGenerationIndex: -1); refTypeEnumerable.TypeMapping = InMemoryTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfReferenceTypesComparer, string>(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfReferenceTypesComparer, string>(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, string>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter, string>( JsonStringReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, string>( + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter, string>( JsonStringReaderWriter.Instance), elementMapping: InMemoryTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), clrType: typeof(string), jsonValueReaderWriter: JsonStringReaderWriter.Instance)); @@ -481,34 +481,34 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas relationshipIndex: -1, storeGenerationIndex: -1); refTypeIList.TypeMapping = InMemoryTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfReferenceTypesComparer, string>(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfReferenceTypesComparer, string>(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, string>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter, string>( JsonStringReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, string>( + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter, string>( JsonStringReaderWriter.Instance), elementMapping: InMemoryTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), clrType: typeof(string), jsonValueReaderWriter: JsonStringReaderWriter.Instance)); @@ -542,50 +542,50 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas relationshipIndex: -1, storeGenerationIndex: -1); refTypeList.TypeMapping = InMemoryTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfReferenceTypesComparer, IPAddress>(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfReferenceTypesComparer, IPAddress>(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, IPAddress>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter, IPAddress>( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, IPAddress>( + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter, IPAddress>( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)))), elementMapping: InMemoryTypeMapping.Default.Clone( comparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), keyComparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), converter: new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))); refTypeList.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("PrincipalBaseEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalBase_RefTypeList", "TestNamespace") }); @@ -617,34 +617,34 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas relationshipIndex: -1, storeGenerationIndex: -1); valueTypeArray.TypeMapping = InMemoryTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer(new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer(new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( JsonDateTimeReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( JsonDateTimeReaderWriter.Instance), elementMapping: InMemoryTypeMapping.Default.Clone( comparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v), keyComparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v), providerValueComparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v), clrType: typeof(DateTime), jsonValueReaderWriter: JsonDateTimeReaderWriter.Instance)); @@ -678,21 +678,21 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas relationshipIndex: -1, storeGenerationIndex: -1); valueTypeEnumerable.TypeMapping = InMemoryTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer, byte>(new ValueComparer( (byte v1, byte v2) => v1 == v2, (byte v) => (int)v, (byte v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer, byte>(new ValueComparer( (byte v1, byte v2) => v1 == v2, (byte v) => (int)v, (byte v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, byte>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter, byte>( JsonByteReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, byte>( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, byte>( JsonByteReaderWriter.Instance), elementMapping: InMemoryTypeMapping.Default.Clone( comparer: new ValueComparer( @@ -739,21 +739,21 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas relationshipIndex: -1, storeGenerationIndex: -1); valueTypeIList.TypeMapping = InMemoryTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer, byte>(new ValueComparer( (byte v1, byte v2) => v1 == v2, (byte v) => (int)v, (byte v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer, byte>(new ValueComparer( (byte v1, byte v2) => v1 == v2, (byte v) => (int)v, (byte v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, byte>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter, byte>( JsonByteReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, byte>( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, byte>( JsonByteReaderWriter.Instance), elementMapping: InMemoryTypeMapping.Default.Clone( comparer: new ValueComparer( @@ -800,21 +800,21 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas relationshipIndex: -1, storeGenerationIndex: -1); valueTypeList.TypeMapping = InMemoryTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer, short>(new ValueComparer( (short v1, short v2) => v1 == v2, (short v) => (int)v, (short v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer, short>(new ValueComparer( (short v1, short v2) => v1 == v2, (short v) => (int)v, (short v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, short>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter, short>( JsonInt16ReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, short>( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, short>( JsonInt16ReaderWriter.Instance), elementMapping: InMemoryTypeMapping.Default.Clone( comparer: new ValueComparer( @@ -929,15 +929,15 @@ public static RuntimeComplexProperty Create(RuntimeEntityType declaringType) details.TypeMapping = InMemoryTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), clrType: typeof(string), jsonValueReaderWriter: JsonStringReaderWriter.Instance); @@ -1032,50 +1032,50 @@ public static RuntimeComplexProperty Create(RuntimeEntityType declaringType) relationshipIndex: -1, storeGenerationIndex: -1); refTypeArray.TypeMapping = InMemoryTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfReferenceTypesComparer(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)))), elementMapping: InMemoryTypeMapping.Default.Clone( comparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), keyComparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), converter: new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))); refTypeArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("PrincipalBaseEntityType.Owned.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_OwnedType__refTypeArray", "TestNamespace") }); @@ -1115,34 +1115,34 @@ public static RuntimeComplexProperty Create(RuntimeEntityType declaringType) relationshipIndex: -1, storeGenerationIndex: -1); refTypeEnumerable.TypeMapping = InMemoryTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfReferenceTypesComparer, string>(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfReferenceTypesComparer, string>(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, string>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter, string>( JsonStringReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, string>( + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter, string>( JsonStringReaderWriter.Instance), elementMapping: InMemoryTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), clrType: typeof(string), jsonValueReaderWriter: JsonStringReaderWriter.Instance)); @@ -1184,34 +1184,34 @@ public static RuntimeComplexProperty Create(RuntimeEntityType declaringType) relationshipIndex: -1, storeGenerationIndex: -1); refTypeIList.TypeMapping = InMemoryTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfReferenceTypesComparer, string>(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfReferenceTypesComparer, string>(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, string>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter, string>( JsonStringReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, string>( + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter, string>( JsonStringReaderWriter.Instance), elementMapping: InMemoryTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), clrType: typeof(string), jsonValueReaderWriter: JsonStringReaderWriter.Instance)); @@ -1253,50 +1253,50 @@ public static RuntimeComplexProperty Create(RuntimeEntityType declaringType) relationshipIndex: -1, storeGenerationIndex: -1); refTypeList.TypeMapping = InMemoryTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfReferenceTypesComparer, IPAddress>(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfReferenceTypesComparer, IPAddress>(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, IPAddress>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter, IPAddress>( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, IPAddress>( + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter, IPAddress>( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)))), elementMapping: InMemoryTypeMapping.Default.Clone( comparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), keyComparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), converter: new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))); refTypeList.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("PrincipalBaseEntityType.Owned.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_OwnedType__refTypeList", "TestNamespace") }); @@ -1336,34 +1336,34 @@ public static RuntimeComplexProperty Create(RuntimeEntityType declaringType) relationshipIndex: -1, storeGenerationIndex: -1); valueTypeArray.TypeMapping = InMemoryTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer(new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer(new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( JsonDateTimeReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( JsonDateTimeReaderWriter.Instance), elementMapping: InMemoryTypeMapping.Default.Clone( comparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v), keyComparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v), providerValueComparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v), clrType: typeof(DateTime), jsonValueReaderWriter: JsonDateTimeReaderWriter.Instance)); @@ -1405,21 +1405,21 @@ public static RuntimeComplexProperty Create(RuntimeEntityType declaringType) relationshipIndex: -1, storeGenerationIndex: -1); valueTypeEnumerable.TypeMapping = InMemoryTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer, byte>(new ValueComparer( (byte v1, byte v2) => v1 == v2, (byte v) => (int)v, (byte v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer, byte>(new ValueComparer( (byte v1, byte v2) => v1 == v2, (byte v) => (int)v, (byte v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, byte>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter, byte>( JsonByteReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, byte>( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, byte>( JsonByteReaderWriter.Instance), elementMapping: InMemoryTypeMapping.Default.Clone( comparer: new ValueComparer( @@ -1474,21 +1474,21 @@ public static RuntimeComplexProperty Create(RuntimeEntityType declaringType) relationshipIndex: -1, storeGenerationIndex: -1); valueTypeIList.TypeMapping = InMemoryTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer, byte>(new ValueComparer( (byte v1, byte v2) => v1 == v2, (byte v) => (int)v, (byte v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer, byte>(new ValueComparer( (byte v1, byte v2) => v1 == v2, (byte v) => (int)v, (byte v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, byte>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter, byte>( JsonByteReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, byte>( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, byte>( JsonByteReaderWriter.Instance), elementMapping: InMemoryTypeMapping.Default.Clone( comparer: new ValueComparer( @@ -1543,21 +1543,21 @@ public static RuntimeComplexProperty Create(RuntimeEntityType declaringType) relationshipIndex: -1, storeGenerationIndex: -1); valueTypeList.TypeMapping = InMemoryTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer, short>(new ValueComparer( (short v1, short v2) => v1 == v2, (short v) => (int)v, (short v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer, short>(new ValueComparer( (short v1, short v2) => v1 == v2, (short v) => (int)v, (short v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, short>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter, short>( JsonInt16ReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, short>( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, short>( JsonInt16ReaderWriter.Instance), elementMapping: InMemoryTypeMapping.Default.Clone( comparer: new ValueComparer( @@ -1664,15 +1664,15 @@ public static RuntimeComplexProperty Create(RuntimeComplexType declaringType) alternateId.TypeMapping = InMemoryTypeMapping.Default.Clone( comparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), keyComparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), providerValueComparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), clrType: typeof(Guid), jsonValueReaderWriter: JsonGuidReaderWriter.Instance); @@ -1717,15 +1717,15 @@ public static RuntimeComplexProperty Create(RuntimeComplexType declaringType) enum1.TypeMapping = InMemoryTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.AnEnum v1, CompiledModelTestBase.AnEnum v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.AnEnum v) => v.GetHashCode(), + (CompiledModelTestBase.AnEnum v) => ((object)v).GetHashCode(), (CompiledModelTestBase.AnEnum v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.AnEnum v1, CompiledModelTestBase.AnEnum v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.AnEnum v) => v.GetHashCode(), + (CompiledModelTestBase.AnEnum v) => ((object)v).GetHashCode(), (CompiledModelTestBase.AnEnum v) => v), providerValueComparer: new ValueComparer( (CompiledModelTestBase.AnEnum v1, CompiledModelTestBase.AnEnum v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.AnEnum v) => v.GetHashCode(), + (CompiledModelTestBase.AnEnum v) => ((object)v).GetHashCode(), (CompiledModelTestBase.AnEnum v) => v), clrType: typeof(CompiledModelTestBase.AnEnum), jsonValueReaderWriter: JsonSignedEnumReaderWriter.Instance); @@ -1771,15 +1771,15 @@ public static RuntimeComplexProperty Create(RuntimeComplexType declaringType) enum2.TypeMapping = InMemoryTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.AnEnum)v1, (object)(CompiledModelTestBase.AnEnum)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.AnEnum)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.AnEnum)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.AnEnum)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.AnEnum)v1, (object)(CompiledModelTestBase.AnEnum)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.AnEnum)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.AnEnum)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.AnEnum)v : default(Nullable)), providerValueComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.AnEnum)v1, (object)(CompiledModelTestBase.AnEnum)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.AnEnum)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.AnEnum)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.AnEnum)v : default(Nullable)), clrType: typeof(CompiledModelTestBase.AnEnum), jsonValueReaderWriter: JsonSignedEnumReaderWriter.Instance); @@ -1825,15 +1825,15 @@ public static RuntimeComplexProperty Create(RuntimeComplexType declaringType) flagsEnum1.TypeMapping = InMemoryTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.AFlagsEnum v1, CompiledModelTestBase.AFlagsEnum v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.AFlagsEnum v) => v.GetHashCode(), + (CompiledModelTestBase.AFlagsEnum v) => ((object)v).GetHashCode(), (CompiledModelTestBase.AFlagsEnum v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.AFlagsEnum v1, CompiledModelTestBase.AFlagsEnum v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.AFlagsEnum v) => v.GetHashCode(), + (CompiledModelTestBase.AFlagsEnum v) => ((object)v).GetHashCode(), (CompiledModelTestBase.AFlagsEnum v) => v), providerValueComparer: new ValueComparer( (CompiledModelTestBase.AFlagsEnum v1, CompiledModelTestBase.AFlagsEnum v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.AFlagsEnum v) => v.GetHashCode(), + (CompiledModelTestBase.AFlagsEnum v) => ((object)v).GetHashCode(), (CompiledModelTestBase.AFlagsEnum v) => v), clrType: typeof(CompiledModelTestBase.AFlagsEnum), jsonValueReaderWriter: JsonSignedEnumReaderWriter.Instance); @@ -1879,15 +1879,15 @@ public static RuntimeComplexProperty Create(RuntimeComplexType declaringType) flagsEnum2.TypeMapping = InMemoryTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.AFlagsEnum v1, CompiledModelTestBase.AFlagsEnum v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.AFlagsEnum v) => v.GetHashCode(), + (CompiledModelTestBase.AFlagsEnum v) => ((object)v).GetHashCode(), (CompiledModelTestBase.AFlagsEnum v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.AFlagsEnum v1, CompiledModelTestBase.AFlagsEnum v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.AFlagsEnum v) => v.GetHashCode(), + (CompiledModelTestBase.AFlagsEnum v) => ((object)v).GetHashCode(), (CompiledModelTestBase.AFlagsEnum v) => v), providerValueComparer: new ValueComparer( (CompiledModelTestBase.AFlagsEnum v1, CompiledModelTestBase.AFlagsEnum v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.AFlagsEnum v) => v.GetHashCode(), + (CompiledModelTestBase.AFlagsEnum v) => ((object)v).GetHashCode(), (CompiledModelTestBase.AFlagsEnum v) => v), clrType: typeof(CompiledModelTestBase.AFlagsEnum), jsonValueReaderWriter: JsonSignedEnumReaderWriter.Instance); @@ -1933,15 +1933,15 @@ public static RuntimeComplexProperty Create(RuntimeComplexType declaringType) id.TypeMapping = InMemoryTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable)), providerValueComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable)), clrType: typeof(long), jsonValueReaderWriter: JsonInt64ReaderWriter.Instance); @@ -1985,50 +1985,50 @@ public static RuntimeComplexProperty Create(RuntimeComplexType declaringType) relationshipIndex: -1, storeGenerationIndex: -1); refTypeArray.TypeMapping = InMemoryTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfReferenceTypesComparer(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)))), elementMapping: InMemoryTypeMapping.Default.Clone( comparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), keyComparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), converter: new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))); refTypeArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("PrincipalBaseEntityType.Owned.Principal.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalBase_RefTypeArray", "TestNamespace") }); @@ -2070,34 +2070,34 @@ public static RuntimeComplexProperty Create(RuntimeComplexType declaringType) relationshipIndex: -1, storeGenerationIndex: -1); refTypeEnumerable.TypeMapping = InMemoryTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfReferenceTypesComparer, string>(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfReferenceTypesComparer, string>(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, string>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter, string>( JsonStringReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, string>( + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter, string>( JsonStringReaderWriter.Instance), elementMapping: InMemoryTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), clrType: typeof(string), jsonValueReaderWriter: JsonStringReaderWriter.Instance)); @@ -2141,34 +2141,34 @@ public static RuntimeComplexProperty Create(RuntimeComplexType declaringType) relationshipIndex: -1, storeGenerationIndex: -1); refTypeIList.TypeMapping = InMemoryTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfReferenceTypesComparer, string>(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfReferenceTypesComparer, string>(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, string>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter, string>( JsonStringReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, string>( + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter, string>( JsonStringReaderWriter.Instance), elementMapping: InMemoryTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), clrType: typeof(string), jsonValueReaderWriter: JsonStringReaderWriter.Instance)); @@ -2212,50 +2212,50 @@ public static RuntimeComplexProperty Create(RuntimeComplexType declaringType) relationshipIndex: -1, storeGenerationIndex: -1); refTypeList.TypeMapping = InMemoryTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfReferenceTypesComparer, IPAddress>(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfReferenceTypesComparer, IPAddress>(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, IPAddress>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter, IPAddress>( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, IPAddress>( + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter, IPAddress>( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)))), elementMapping: InMemoryTypeMapping.Default.Clone( comparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), keyComparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), converter: new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))); refTypeList.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("PrincipalBaseEntityType.Owned.Principal.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalBase_RefTypeList", "TestNamespace") }); @@ -2297,34 +2297,34 @@ public static RuntimeComplexProperty Create(RuntimeComplexType declaringType) relationshipIndex: -1, storeGenerationIndex: -1); valueTypeArray.TypeMapping = InMemoryTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer(new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer(new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( JsonDateTimeReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( JsonDateTimeReaderWriter.Instance), elementMapping: InMemoryTypeMapping.Default.Clone( comparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v), keyComparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v), providerValueComparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v), clrType: typeof(DateTime), jsonValueReaderWriter: JsonDateTimeReaderWriter.Instance)); @@ -2368,21 +2368,21 @@ public static RuntimeComplexProperty Create(RuntimeComplexType declaringType) relationshipIndex: -1, storeGenerationIndex: -1); valueTypeEnumerable.TypeMapping = InMemoryTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer, byte>(new ValueComparer( (byte v1, byte v2) => v1 == v2, (byte v) => (int)v, (byte v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer, byte>(new ValueComparer( (byte v1, byte v2) => v1 == v2, (byte v) => (int)v, (byte v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, byte>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter, byte>( JsonByteReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, byte>( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, byte>( JsonByteReaderWriter.Instance), elementMapping: InMemoryTypeMapping.Default.Clone( comparer: new ValueComparer( @@ -2439,21 +2439,21 @@ public static RuntimeComplexProperty Create(RuntimeComplexType declaringType) relationshipIndex: -1, storeGenerationIndex: -1); valueTypeIList.TypeMapping = InMemoryTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer, byte>(new ValueComparer( (byte v1, byte v2) => v1 == v2, (byte v) => (int)v, (byte v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer, byte>(new ValueComparer( (byte v1, byte v2) => v1 == v2, (byte v) => (int)v, (byte v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, byte>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter, byte>( JsonByteReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, byte>( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, byte>( JsonByteReaderWriter.Instance), elementMapping: InMemoryTypeMapping.Default.Clone( comparer: new ValueComparer( @@ -2510,21 +2510,21 @@ public static RuntimeComplexProperty Create(RuntimeComplexType declaringType) relationshipIndex: -1, storeGenerationIndex: -1); valueTypeList.TypeMapping = InMemoryTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer, short>(new ValueComparer( (short v1, short v2) => v1 == v2, (short v) => (int)v, (short v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer, short>(new ValueComparer( (short v1, short v2) => v1 == v2, (short v) => (int)v, (short v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, short>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter, short>( JsonInt16ReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, short>( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, short>( JsonInt16ReaderWriter.Instance), elementMapping: InMemoryTypeMapping.Default.Clone( comparer: new ValueComparer( @@ -2717,12 +2717,12 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (CompiledModelTestBase.PrincipalBase)source.Entity; - var liftedArg = (ISnapshot)new Snapshot, string, CompiledModelTestBase.AnEnum, Nullable, CompiledModelTestBase.AFlagsEnum, CompiledModelTestBase.AFlagsEnum, Nullable, IPAddress[], IEnumerable, IList, List, DateTime[], IEnumerable, IList, List, string, int, IPAddress[], IEnumerable, IList, List, DateTime[], IEnumerable, IList, List, Guid, CompiledModelTestBase.AnEnum, Nullable, CompiledModelTestBase.AFlagsEnum, CompiledModelTestBase.AFlagsEnum>(source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)id.GetValueComparer()).Snapshot(source.GetCurrentValue>(id)), source.GetCurrentValue(discriminator) == null ? null : ((ValueComparer)discriminator.GetValueComparer()).Snapshot(source.GetCurrentValue(discriminator)), ((ValueComparer)enum1.GetValueComparer()).Snapshot(source.GetCurrentValue(enum1)), source.GetCurrentValue>(enum2) == null ? null : ((ValueComparer>)enum2.GetValueComparer()).Snapshot(source.GetCurrentValue>(enum2)), ((ValueComparer)flagsEnum1.GetValueComparer()).Snapshot(source.GetCurrentValue(flagsEnum1)), ((ValueComparer)flagsEnum2.GetValueComparer()).Snapshot(source.GetCurrentValue(flagsEnum2)), source.GetCurrentValue>(principalBaseId) == null ? null : ((ValueComparer>)principalBaseId.GetValueComparer()).Snapshot(source.GetCurrentValue>(principalBaseId)), (IEnumerable)source.GetCurrentValue(refTypeArray) == null ? null : (IPAddress[])((ValueComparer>)refTypeArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(refTypeArray)), source.GetCurrentValue>(refTypeEnumerable) == null ? null : ((ValueComparer>)refTypeEnumerable.GetValueComparer()).Snapshot(source.GetCurrentValue>(refTypeEnumerable)), (IEnumerable)source.GetCurrentValue>(refTypeIList) == null ? null : (IList)((ValueComparer>)refTypeIList.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(refTypeIList)), (IEnumerable)source.GetCurrentValue>(refTypeList) == null ? null : (List)((ValueComparer>)refTypeList.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(refTypeList)), (IEnumerable)source.GetCurrentValue(valueTypeArray) == null ? null : (DateTime[])((ValueComparer>)valueTypeArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(valueTypeArray)), source.GetCurrentValue>(valueTypeEnumerable) == null ? null : ((ValueComparer>)valueTypeEnumerable.GetValueComparer()).Snapshot(source.GetCurrentValue>(valueTypeEnumerable)), (IEnumerable)source.GetCurrentValue>(valueTypeIList) == null ? null : (IList)((ValueComparer>)valueTypeIList.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeIList)), (IEnumerable)source.GetCurrentValue>(valueTypeList) == null ? null : (List)((ValueComparer>)valueTypeList.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeList)), source.GetCurrentValue(details) == null ? null : ((ValueComparer)details.GetValueComparer()).Snapshot(source.GetCurrentValue(details)), ((ValueComparer)number.GetValueComparer()).Snapshot(source.GetCurrentValue(number)), (IEnumerable)source.GetCurrentValue(refTypeArray0) == null ? null : (IPAddress[])((ValueComparer>)refTypeArray0.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(refTypeArray0)), source.GetCurrentValue>(refTypeEnumerable0) == null ? null : ((ValueComparer>)refTypeEnumerable0.GetValueComparer()).Snapshot(source.GetCurrentValue>(refTypeEnumerable0)), (IEnumerable)source.GetCurrentValue>(refTypeIList0) == null ? null : (IList)((ValueComparer>)refTypeIList0.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(refTypeIList0)), (IEnumerable)source.GetCurrentValue>(refTypeList0) == null ? null : (List)((ValueComparer>)refTypeList0.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(refTypeList0)), (IEnumerable)source.GetCurrentValue(valueTypeArray0) == null ? null : (DateTime[])((ValueComparer>)valueTypeArray0.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(valueTypeArray0)), source.GetCurrentValue>(valueTypeEnumerable0) == null ? null : ((ValueComparer>)valueTypeEnumerable0.GetValueComparer()).Snapshot(source.GetCurrentValue>(valueTypeEnumerable0)), (IEnumerable)source.GetCurrentValue>(valueTypeIList0) == null ? null : (IList)((ValueComparer>)valueTypeIList0.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeIList0)), (IEnumerable)source.GetCurrentValue>(valueTypeList0) == null ? null : (List)((ValueComparer>)valueTypeList0.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeList0)), ((ValueComparer)alternateId.GetValueComparer()).Snapshot(source.GetCurrentValue(alternateId)), ((ValueComparer)enum10.GetValueComparer()).Snapshot(source.GetCurrentValue(enum10)), source.GetCurrentValue>(enum20) == null ? null : ((ValueComparer>)enum20.GetValueComparer()).Snapshot(source.GetCurrentValue>(enum20)), ((ValueComparer)flagsEnum10.GetValueComparer()).Snapshot(source.GetCurrentValue(flagsEnum10)), ((ValueComparer)flagsEnum20.GetValueComparer()).Snapshot(source.GetCurrentValue(flagsEnum20))); + var liftedArg = (ISnapshot)new Snapshot, string, CompiledModelTestBase.AnEnum, Nullable, CompiledModelTestBase.AFlagsEnum, CompiledModelTestBase.AFlagsEnum, Nullable, IPAddress[], IEnumerable, IList, List, DateTime[], IEnumerable, IList, List, string, int, IPAddress[], IEnumerable, IList, List, DateTime[], IEnumerable, IList, List, Guid, CompiledModelTestBase.AnEnum, Nullable, CompiledModelTestBase.AFlagsEnum, CompiledModelTestBase.AFlagsEnum>(source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)((IProperty)id).GetValueComparer()).Snapshot(source.GetCurrentValue>(id)), source.GetCurrentValue(discriminator) == null ? null : ((ValueComparer)((IProperty)discriminator).GetValueComparer()).Snapshot(source.GetCurrentValue(discriminator)), ((ValueComparer)((IProperty)enum1).GetValueComparer()).Snapshot(source.GetCurrentValue(enum1)), source.GetCurrentValue>(enum2) == null ? null : ((ValueComparer>)((IProperty)enum2).GetValueComparer()).Snapshot(source.GetCurrentValue>(enum2)), ((ValueComparer)((IProperty)flagsEnum1).GetValueComparer()).Snapshot(source.GetCurrentValue(flagsEnum1)), ((ValueComparer)((IProperty)flagsEnum2).GetValueComparer()).Snapshot(source.GetCurrentValue(flagsEnum2)), source.GetCurrentValue>(principalBaseId) == null ? null : ((ValueComparer>)((IProperty)principalBaseId).GetValueComparer()).Snapshot(source.GetCurrentValue>(principalBaseId)), (object)source.GetCurrentValue(refTypeArray) == null ? null : (IPAddress[])((ValueComparer)((IProperty)refTypeArray).GetValueComparer()).Snapshot((object)source.GetCurrentValue(refTypeArray)), (object)source.GetCurrentValue>(refTypeEnumerable) == null ? null : (IEnumerable)((ValueComparer)((IProperty)refTypeEnumerable).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeEnumerable)), (object)source.GetCurrentValue>(refTypeIList) == null ? null : (IList)((ValueComparer)((IProperty)refTypeIList).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeIList)), (object)source.GetCurrentValue>(refTypeList) == null ? null : (List)((ValueComparer)((IProperty)refTypeList).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeList)), (IEnumerable)source.GetCurrentValue(valueTypeArray) == null ? null : (DateTime[])((ValueComparer>)((IProperty)valueTypeArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(valueTypeArray)), source.GetCurrentValue>(valueTypeEnumerable) == null ? null : ((ValueComparer>)((IProperty)valueTypeEnumerable).GetValueComparer()).Snapshot(source.GetCurrentValue>(valueTypeEnumerable)), (IEnumerable)source.GetCurrentValue>(valueTypeIList) == null ? null : (IList)((ValueComparer>)((IProperty)valueTypeIList).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeIList)), (IEnumerable)source.GetCurrentValue>(valueTypeList) == null ? null : (List)((ValueComparer>)((IProperty)valueTypeList).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeList)), source.GetCurrentValue(details) == null ? null : ((ValueComparer)((IProperty)details).GetValueComparer()).Snapshot(source.GetCurrentValue(details)), ((ValueComparer)((IProperty)number).GetValueComparer()).Snapshot(source.GetCurrentValue(number)), (object)source.GetCurrentValue(refTypeArray0) == null ? null : (IPAddress[])((ValueComparer)((IProperty)refTypeArray0).GetValueComparer()).Snapshot((object)source.GetCurrentValue(refTypeArray0)), (object)source.GetCurrentValue>(refTypeEnumerable0) == null ? null : (IEnumerable)((ValueComparer)((IProperty)refTypeEnumerable0).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeEnumerable0)), (object)source.GetCurrentValue>(refTypeIList0) == null ? null : (IList)((ValueComparer)((IProperty)refTypeIList0).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeIList0)), (object)source.GetCurrentValue>(refTypeList0) == null ? null : (List)((ValueComparer)((IProperty)refTypeList0).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeList0)), (IEnumerable)source.GetCurrentValue(valueTypeArray0) == null ? null : (DateTime[])((ValueComparer>)((IProperty)valueTypeArray0).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(valueTypeArray0)), source.GetCurrentValue>(valueTypeEnumerable0) == null ? null : ((ValueComparer>)((IProperty)valueTypeEnumerable0).GetValueComparer()).Snapshot(source.GetCurrentValue>(valueTypeEnumerable0)), (IEnumerable)source.GetCurrentValue>(valueTypeIList0) == null ? null : (IList)((ValueComparer>)((IProperty)valueTypeIList0).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeIList0)), (IEnumerable)source.GetCurrentValue>(valueTypeList0) == null ? null : (List)((ValueComparer>)((IProperty)valueTypeList0).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeList0)), ((ValueComparer)((IProperty)alternateId).GetValueComparer()).Snapshot(source.GetCurrentValue(alternateId)), ((ValueComparer)((IProperty)enum10).GetValueComparer()).Snapshot(source.GetCurrentValue(enum10)), source.GetCurrentValue>(enum20) == null ? null : ((ValueComparer>)((IProperty)enum20).GetValueComparer()).Snapshot(source.GetCurrentValue>(enum20)), ((ValueComparer)((IProperty)flagsEnum10).GetValueComparer()).Snapshot(source.GetCurrentValue(flagsEnum10)), ((ValueComparer)((IProperty)flagsEnum20).GetValueComparer()).Snapshot(source.GetCurrentValue(flagsEnum20))); var entity0 = (CompiledModelTestBase.PrincipalBase)source.Entity; - return (ISnapshot)new MultiSnapshot(new ISnapshot[] { liftedArg, (ISnapshot)new Snapshot, IPAddress[], IEnumerable, IList, List, DateTime[], IEnumerable, IList, List>(source.GetCurrentValue>(id0) == null ? null : ((ValueComparer>)id0.GetValueComparer()).Snapshot(source.GetCurrentValue>(id0)), (IEnumerable)source.GetCurrentValue(refTypeArray1) == null ? null : (IPAddress[])((ValueComparer>)refTypeArray1.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(refTypeArray1)), source.GetCurrentValue>(refTypeEnumerable1) == null ? null : ((ValueComparer>)refTypeEnumerable1.GetValueComparer()).Snapshot(source.GetCurrentValue>(refTypeEnumerable1)), (IEnumerable)source.GetCurrentValue>(refTypeIList1) == null ? null : (IList)((ValueComparer>)refTypeIList1.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(refTypeIList1)), (IEnumerable)source.GetCurrentValue>(refTypeList1) == null ? null : (List)((ValueComparer>)refTypeList1.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(refTypeList1)), (IEnumerable)source.GetCurrentValue(valueTypeArray1) == null ? null : (DateTime[])((ValueComparer>)valueTypeArray1.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(valueTypeArray1)), source.GetCurrentValue>(valueTypeEnumerable1) == null ? null : ((ValueComparer>)valueTypeEnumerable1.GetValueComparer()).Snapshot(source.GetCurrentValue>(valueTypeEnumerable1)), (IEnumerable)source.GetCurrentValue>(valueTypeIList1) == null ? null : (IList)((ValueComparer>)valueTypeIList1.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeIList1)), (IEnumerable)source.GetCurrentValue>(valueTypeList1) == null ? null : (List)((ValueComparer>)valueTypeList1.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeList1))) }); + return (ISnapshot)new MultiSnapshot(new ISnapshot[] { liftedArg, (ISnapshot)new Snapshot, IPAddress[], IEnumerable, IList, List, DateTime[], IEnumerable, IList, List>(source.GetCurrentValue>(id0) == null ? null : ((ValueComparer>)((IProperty)id0).GetValueComparer()).Snapshot(source.GetCurrentValue>(id0)), (object)source.GetCurrentValue(refTypeArray1) == null ? null : (IPAddress[])((ValueComparer)((IProperty)refTypeArray1).GetValueComparer()).Snapshot((object)source.GetCurrentValue(refTypeArray1)), (object)source.GetCurrentValue>(refTypeEnumerable1) == null ? null : (IEnumerable)((ValueComparer)((IProperty)refTypeEnumerable1).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeEnumerable1)), (object)source.GetCurrentValue>(refTypeIList1) == null ? null : (IList)((ValueComparer)((IProperty)refTypeIList1).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeIList1)), (object)source.GetCurrentValue>(refTypeList1) == null ? null : (List)((ValueComparer)((IProperty)refTypeList1).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeList1)), (IEnumerable)source.GetCurrentValue(valueTypeArray1) == null ? null : (DateTime[])((ValueComparer>)((IProperty)valueTypeArray1).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(valueTypeArray1)), source.GetCurrentValue>(valueTypeEnumerable1) == null ? null : ((ValueComparer>)((IProperty)valueTypeEnumerable1).GetValueComparer()).Snapshot(source.GetCurrentValue>(valueTypeEnumerable1)), (IEnumerable)source.GetCurrentValue>(valueTypeIList1) == null ? null : (IList)((ValueComparer>)((IProperty)valueTypeIList1).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeIList1)), (IEnumerable)source.GetCurrentValue>(valueTypeList1) == null ? null : (List)((ValueComparer>)((IProperty)valueTypeList1).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeList1))) }); }); runtimeEntityType.SetStoreGeneratedValuesFactory( - () => (ISnapshot)new Snapshot, Nullable, string>(default(Nullable) == null ? null : ((ValueComparer>)id.GetValueComparer()).Snapshot(default(Nullable)), default(Nullable) == null ? null : ((ValueComparer>)principalBaseId.GetValueComparer()).Snapshot(default(Nullable)), default(string) == null ? null : ((ValueComparer)details.GetValueComparer()).Snapshot(default(string)))); + () => (ISnapshot)new Snapshot, Nullable, string>(default(Nullable) == null ? null : ((ValueComparer>)((IProperty)id).GetValueComparer()).Snapshot(default(Nullable)), default(Nullable) == null ? null : ((ValueComparer>)((IProperty)principalBaseId).GetValueComparer()).Snapshot(default(Nullable)), default(string) == null ? null : ((ValueComparer)((IProperty)details).GetValueComparer()).Snapshot(default(string)))); runtimeEntityType.SetTemporaryValuesFactory( (InternalEntityEntry source) => (ISnapshot)new Snapshot, Nullable, string>(default(Nullable), default(Nullable), default(string))); runtimeEntityType.SetShadowValuesFactory( @@ -2732,8 +2732,8 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) runtimeEntityType.SetRelationshipSnapshotFactory( (InternalEntityEntry source) => { - var entity = (CompiledModelTestBase.PrincipalBase)source.Entity; - return (ISnapshot)new Snapshot, Nullable, object>(source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)id.GetKeyValueComparer()).Snapshot(source.GetCurrentValue>(id)), source.GetCurrentValue>(principalBaseId) == null ? null : ((ValueComparer>)principalBaseId.GetKeyValueComparer()).Snapshot(source.GetCurrentValue>(principalBaseId)), SnapshotFactoryFactory.SnapshotCollection(UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalBase_Deriveds(entity))); + var entity1 = (CompiledModelTestBase.PrincipalBase)source.Entity; + return (ISnapshot)new Snapshot, Nullable, object>(source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)((IProperty)id).GetKeyValueComparer()).Snapshot(source.GetCurrentValue>(id)), source.GetCurrentValue>(principalBaseId) == null ? null : ((ValueComparer>)((IProperty)principalBaseId).GetKeyValueComparer()).Snapshot(source.GetCurrentValue>(principalBaseId)), SnapshotFactoryFactory.SnapshotCollection(UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalBase_Deriveds(entity1))); }); runtimeEntityType.Counts = new PropertyCounts( propertyCount: 39, diff --git a/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/ComplexTypes/PrincipalDerivedEntityType.cs b/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/ComplexTypes/PrincipalDerivedEntityType.cs index 7d2ed0fc3bb..8ebf1957459 100644 --- a/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/ComplexTypes/PrincipalDerivedEntityType.cs +++ b/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/ComplexTypes/PrincipalDerivedEntityType.cs @@ -81,12 +81,12 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity1 = (CompiledModelTestBase.PrincipalDerived>>)source.Entity; - var liftedArg0 = (ISnapshot)new Snapshot, string, CompiledModelTestBase.AnEnum, Nullable, CompiledModelTestBase.AFlagsEnum, CompiledModelTestBase.AFlagsEnum, Nullable, IPAddress[], IEnumerable, IList, List, DateTime[], IEnumerable, IList, List, string, int, IPAddress[], IEnumerable, IList, List, DateTime[], IEnumerable, IList, List, Guid, CompiledModelTestBase.AnEnum, Nullable, CompiledModelTestBase.AFlagsEnum, CompiledModelTestBase.AFlagsEnum>(source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)id.GetValueComparer()).Snapshot(source.GetCurrentValue>(id)), source.GetCurrentValue(discriminator) == null ? null : ((ValueComparer)discriminator.GetValueComparer()).Snapshot(source.GetCurrentValue(discriminator)), ((ValueComparer)enum1.GetValueComparer()).Snapshot(source.GetCurrentValue(enum1)), source.GetCurrentValue>(enum2) == null ? null : ((ValueComparer>)enum2.GetValueComparer()).Snapshot(source.GetCurrentValue>(enum2)), ((ValueComparer)flagsEnum1.GetValueComparer()).Snapshot(source.GetCurrentValue(flagsEnum1)), ((ValueComparer)flagsEnum2.GetValueComparer()).Snapshot(source.GetCurrentValue(flagsEnum2)), source.GetCurrentValue>(principalBaseId) == null ? null : ((ValueComparer>)principalBaseId.GetValueComparer()).Snapshot(source.GetCurrentValue>(principalBaseId)), (IEnumerable)source.GetCurrentValue(refTypeArray) == null ? null : (IPAddress[])((ValueComparer>)refTypeArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(refTypeArray)), source.GetCurrentValue>(refTypeEnumerable) == null ? null : ((ValueComparer>)refTypeEnumerable.GetValueComparer()).Snapshot(source.GetCurrentValue>(refTypeEnumerable)), (IEnumerable)source.GetCurrentValue>(refTypeIList) == null ? null : (IList)((ValueComparer>)refTypeIList.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(refTypeIList)), (IEnumerable)source.GetCurrentValue>(refTypeList) == null ? null : (List)((ValueComparer>)refTypeList.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(refTypeList)), (IEnumerable)source.GetCurrentValue(valueTypeArray) == null ? null : (DateTime[])((ValueComparer>)valueTypeArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(valueTypeArray)), source.GetCurrentValue>(valueTypeEnumerable) == null ? null : ((ValueComparer>)valueTypeEnumerable.GetValueComparer()).Snapshot(source.GetCurrentValue>(valueTypeEnumerable)), (IEnumerable)source.GetCurrentValue>(valueTypeIList) == null ? null : (IList)((ValueComparer>)valueTypeIList.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeIList)), (IEnumerable)source.GetCurrentValue>(valueTypeList) == null ? null : (List)((ValueComparer>)valueTypeList.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeList)), source.GetCurrentValue(details) == null ? null : ((ValueComparer)details.GetValueComparer()).Snapshot(source.GetCurrentValue(details)), ((ValueComparer)number.GetValueComparer()).Snapshot(source.GetCurrentValue(number)), (IEnumerable)source.GetCurrentValue(refTypeArray0) == null ? null : (IPAddress[])((ValueComparer>)refTypeArray0.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(refTypeArray0)), source.GetCurrentValue>(refTypeEnumerable0) == null ? null : ((ValueComparer>)refTypeEnumerable0.GetValueComparer()).Snapshot(source.GetCurrentValue>(refTypeEnumerable0)), (IEnumerable)source.GetCurrentValue>(refTypeIList0) == null ? null : (IList)((ValueComparer>)refTypeIList0.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(refTypeIList0)), (IEnumerable)source.GetCurrentValue>(refTypeList0) == null ? null : (List)((ValueComparer>)refTypeList0.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(refTypeList0)), (IEnumerable)source.GetCurrentValue(valueTypeArray0) == null ? null : (DateTime[])((ValueComparer>)valueTypeArray0.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(valueTypeArray0)), source.GetCurrentValue>(valueTypeEnumerable0) == null ? null : ((ValueComparer>)valueTypeEnumerable0.GetValueComparer()).Snapshot(source.GetCurrentValue>(valueTypeEnumerable0)), (IEnumerable)source.GetCurrentValue>(valueTypeIList0) == null ? null : (IList)((ValueComparer>)valueTypeIList0.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeIList0)), (IEnumerable)source.GetCurrentValue>(valueTypeList0) == null ? null : (List)((ValueComparer>)valueTypeList0.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeList0)), ((ValueComparer)alternateId.GetValueComparer()).Snapshot(source.GetCurrentValue(alternateId)), ((ValueComparer)enum10.GetValueComparer()).Snapshot(source.GetCurrentValue(enum10)), source.GetCurrentValue>(enum20) == null ? null : ((ValueComparer>)enum20.GetValueComparer()).Snapshot(source.GetCurrentValue>(enum20)), ((ValueComparer)flagsEnum10.GetValueComparer()).Snapshot(source.GetCurrentValue(flagsEnum10)), ((ValueComparer)flagsEnum20.GetValueComparer()).Snapshot(source.GetCurrentValue(flagsEnum20))); + var liftedArg0 = (ISnapshot)new Snapshot, string, CompiledModelTestBase.AnEnum, Nullable, CompiledModelTestBase.AFlagsEnum, CompiledModelTestBase.AFlagsEnum, Nullable, IPAddress[], IEnumerable, IList, List, DateTime[], IEnumerable, IList, List, string, int, IPAddress[], IEnumerable, IList, List, DateTime[], IEnumerable, IList, List, Guid, CompiledModelTestBase.AnEnum, Nullable, CompiledModelTestBase.AFlagsEnum, CompiledModelTestBase.AFlagsEnum>(source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)((IProperty)id).GetValueComparer()).Snapshot(source.GetCurrentValue>(id)), source.GetCurrentValue(discriminator) == null ? null : ((ValueComparer)((IProperty)discriminator).GetValueComparer()).Snapshot(source.GetCurrentValue(discriminator)), ((ValueComparer)((IProperty)enum1).GetValueComparer()).Snapshot(source.GetCurrentValue(enum1)), source.GetCurrentValue>(enum2) == null ? null : ((ValueComparer>)((IProperty)enum2).GetValueComparer()).Snapshot(source.GetCurrentValue>(enum2)), ((ValueComparer)((IProperty)flagsEnum1).GetValueComparer()).Snapshot(source.GetCurrentValue(flagsEnum1)), ((ValueComparer)((IProperty)flagsEnum2).GetValueComparer()).Snapshot(source.GetCurrentValue(flagsEnum2)), source.GetCurrentValue>(principalBaseId) == null ? null : ((ValueComparer>)((IProperty)principalBaseId).GetValueComparer()).Snapshot(source.GetCurrentValue>(principalBaseId)), (object)source.GetCurrentValue(refTypeArray) == null ? null : (IPAddress[])((ValueComparer)((IProperty)refTypeArray).GetValueComparer()).Snapshot((object)source.GetCurrentValue(refTypeArray)), (object)source.GetCurrentValue>(refTypeEnumerable) == null ? null : (IEnumerable)((ValueComparer)((IProperty)refTypeEnumerable).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeEnumerable)), (object)source.GetCurrentValue>(refTypeIList) == null ? null : (IList)((ValueComparer)((IProperty)refTypeIList).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeIList)), (object)source.GetCurrentValue>(refTypeList) == null ? null : (List)((ValueComparer)((IProperty)refTypeList).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeList)), (IEnumerable)source.GetCurrentValue(valueTypeArray) == null ? null : (DateTime[])((ValueComparer>)((IProperty)valueTypeArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(valueTypeArray)), source.GetCurrentValue>(valueTypeEnumerable) == null ? null : ((ValueComparer>)((IProperty)valueTypeEnumerable).GetValueComparer()).Snapshot(source.GetCurrentValue>(valueTypeEnumerable)), (IEnumerable)source.GetCurrentValue>(valueTypeIList) == null ? null : (IList)((ValueComparer>)((IProperty)valueTypeIList).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeIList)), (IEnumerable)source.GetCurrentValue>(valueTypeList) == null ? null : (List)((ValueComparer>)((IProperty)valueTypeList).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeList)), source.GetCurrentValue(details) == null ? null : ((ValueComparer)((IProperty)details).GetValueComparer()).Snapshot(source.GetCurrentValue(details)), ((ValueComparer)((IProperty)number).GetValueComparer()).Snapshot(source.GetCurrentValue(number)), (object)source.GetCurrentValue(refTypeArray0) == null ? null : (IPAddress[])((ValueComparer)((IProperty)refTypeArray0).GetValueComparer()).Snapshot((object)source.GetCurrentValue(refTypeArray0)), (object)source.GetCurrentValue>(refTypeEnumerable0) == null ? null : (IEnumerable)((ValueComparer)((IProperty)refTypeEnumerable0).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeEnumerable0)), (object)source.GetCurrentValue>(refTypeIList0) == null ? null : (IList)((ValueComparer)((IProperty)refTypeIList0).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeIList0)), (object)source.GetCurrentValue>(refTypeList0) == null ? null : (List)((ValueComparer)((IProperty)refTypeList0).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeList0)), (IEnumerable)source.GetCurrentValue(valueTypeArray0) == null ? null : (DateTime[])((ValueComparer>)((IProperty)valueTypeArray0).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(valueTypeArray0)), source.GetCurrentValue>(valueTypeEnumerable0) == null ? null : ((ValueComparer>)((IProperty)valueTypeEnumerable0).GetValueComparer()).Snapshot(source.GetCurrentValue>(valueTypeEnumerable0)), (IEnumerable)source.GetCurrentValue>(valueTypeIList0) == null ? null : (IList)((ValueComparer>)((IProperty)valueTypeIList0).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeIList0)), (IEnumerable)source.GetCurrentValue>(valueTypeList0) == null ? null : (List)((ValueComparer>)((IProperty)valueTypeList0).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeList0)), ((ValueComparer)((IProperty)alternateId).GetValueComparer()).Snapshot(source.GetCurrentValue(alternateId)), ((ValueComparer)((IProperty)enum10).GetValueComparer()).Snapshot(source.GetCurrentValue(enum10)), source.GetCurrentValue>(enum20) == null ? null : ((ValueComparer>)((IProperty)enum20).GetValueComparer()).Snapshot(source.GetCurrentValue>(enum20)), ((ValueComparer)((IProperty)flagsEnum10).GetValueComparer()).Snapshot(source.GetCurrentValue(flagsEnum10)), ((ValueComparer)((IProperty)flagsEnum20).GetValueComparer()).Snapshot(source.GetCurrentValue(flagsEnum20))); var entity2 = (CompiledModelTestBase.PrincipalDerived>>)source.Entity; - return (ISnapshot)new MultiSnapshot(new ISnapshot[] { liftedArg0, (ISnapshot)new Snapshot, IPAddress[], IEnumerable, IList, List, DateTime[], IEnumerable, IList, List>(source.GetCurrentValue>(id0) == null ? null : ((ValueComparer>)id0.GetValueComparer()).Snapshot(source.GetCurrentValue>(id0)), (IEnumerable)source.GetCurrentValue(refTypeArray1) == null ? null : (IPAddress[])((ValueComparer>)refTypeArray1.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(refTypeArray1)), source.GetCurrentValue>(refTypeEnumerable1) == null ? null : ((ValueComparer>)refTypeEnumerable1.GetValueComparer()).Snapshot(source.GetCurrentValue>(refTypeEnumerable1)), (IEnumerable)source.GetCurrentValue>(refTypeIList1) == null ? null : (IList)((ValueComparer>)refTypeIList1.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(refTypeIList1)), (IEnumerable)source.GetCurrentValue>(refTypeList1) == null ? null : (List)((ValueComparer>)refTypeList1.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(refTypeList1)), (IEnumerable)source.GetCurrentValue(valueTypeArray1) == null ? null : (DateTime[])((ValueComparer>)valueTypeArray1.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(valueTypeArray1)), source.GetCurrentValue>(valueTypeEnumerable1) == null ? null : ((ValueComparer>)valueTypeEnumerable1.GetValueComparer()).Snapshot(source.GetCurrentValue>(valueTypeEnumerable1)), (IEnumerable)source.GetCurrentValue>(valueTypeIList1) == null ? null : (IList)((ValueComparer>)valueTypeIList1.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeIList1)), (IEnumerable)source.GetCurrentValue>(valueTypeList1) == null ? null : (List)((ValueComparer>)valueTypeList1.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeList1))) }); + return (ISnapshot)new MultiSnapshot(new ISnapshot[] { liftedArg0, (ISnapshot)new Snapshot, IPAddress[], IEnumerable, IList, List, DateTime[], IEnumerable, IList, List>(source.GetCurrentValue>(id0) == null ? null : ((ValueComparer>)((IProperty)id0).GetValueComparer()).Snapshot(source.GetCurrentValue>(id0)), (object)source.GetCurrentValue(refTypeArray1) == null ? null : (IPAddress[])((ValueComparer)((IProperty)refTypeArray1).GetValueComparer()).Snapshot((object)source.GetCurrentValue(refTypeArray1)), (object)source.GetCurrentValue>(refTypeEnumerable1) == null ? null : (IEnumerable)((ValueComparer)((IProperty)refTypeEnumerable1).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeEnumerable1)), (object)source.GetCurrentValue>(refTypeIList1) == null ? null : (IList)((ValueComparer)((IProperty)refTypeIList1).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeIList1)), (object)source.GetCurrentValue>(refTypeList1) == null ? null : (List)((ValueComparer)((IProperty)refTypeList1).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeList1)), (IEnumerable)source.GetCurrentValue(valueTypeArray1) == null ? null : (DateTime[])((ValueComparer>)((IProperty)valueTypeArray1).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(valueTypeArray1)), source.GetCurrentValue>(valueTypeEnumerable1) == null ? null : ((ValueComparer>)((IProperty)valueTypeEnumerable1).GetValueComparer()).Snapshot(source.GetCurrentValue>(valueTypeEnumerable1)), (IEnumerable)source.GetCurrentValue>(valueTypeIList1) == null ? null : (IList)((ValueComparer>)((IProperty)valueTypeIList1).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeIList1)), (IEnumerable)source.GetCurrentValue>(valueTypeList1) == null ? null : (List)((ValueComparer>)((IProperty)valueTypeList1).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeList1))) }); }); runtimeEntityType.SetStoreGeneratedValuesFactory( - () => (ISnapshot)new Snapshot, Nullable, string>(default(Nullable) == null ? null : ((ValueComparer>)id.GetValueComparer()).Snapshot(default(Nullable)), default(Nullable) == null ? null : ((ValueComparer>)principalBaseId.GetValueComparer()).Snapshot(default(Nullable)), default(string) == null ? null : ((ValueComparer)details.GetValueComparer()).Snapshot(default(string)))); + () => (ISnapshot)new Snapshot, Nullable, string>(default(Nullable) == null ? null : ((ValueComparer>)((IProperty)id).GetValueComparer()).Snapshot(default(Nullable)), default(Nullable) == null ? null : ((ValueComparer>)((IProperty)principalBaseId).GetValueComparer()).Snapshot(default(Nullable)), default(string) == null ? null : ((ValueComparer)((IProperty)details).GetValueComparer()).Snapshot(default(string)))); runtimeEntityType.SetTemporaryValuesFactory( (InternalEntityEntry source) => (ISnapshot)new Snapshot, Nullable, string>(default(Nullable), default(Nullable), default(string))); runtimeEntityType.SetShadowValuesFactory( @@ -96,8 +96,8 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) runtimeEntityType.SetRelationshipSnapshotFactory( (InternalEntityEntry source) => { - var entity = (CompiledModelTestBase.PrincipalDerived>>)source.Entity; - return (ISnapshot)new Snapshot, Nullable, object>(source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)id.GetKeyValueComparer()).Snapshot(source.GetCurrentValue>(id)), source.GetCurrentValue>(principalBaseId) == null ? null : ((ValueComparer>)principalBaseId.GetKeyValueComparer()).Snapshot(source.GetCurrentValue>(principalBaseId)), SnapshotFactoryFactory.SnapshotCollection(PrincipalBaseEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalBase_Deriveds(entity))); + var entity3 = (CompiledModelTestBase.PrincipalDerived>>)source.Entity; + return (ISnapshot)new Snapshot, Nullable, object>(source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)((IProperty)id).GetKeyValueComparer()).Snapshot(source.GetCurrentValue>(id)), source.GetCurrentValue>(principalBaseId) == null ? null : ((ValueComparer>)((IProperty)principalBaseId).GetKeyValueComparer()).Snapshot(source.GetCurrentValue>(principalBaseId)), SnapshotFactoryFactory.SnapshotCollection(PrincipalBaseEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalBase_Deriveds(entity3))); }); runtimeEntityType.Counts = new PropertyCounts( propertyCount: 39, diff --git a/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/Custom_provider_value_comparer/MyEntityEntityType.cs b/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/Custom_provider_value_comparer/MyEntityEntityType.cs index 448f7792295..3af2a2c2ed4 100644 --- a/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/Custom_provider_value_comparer/MyEntityEntityType.cs +++ b/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/Custom_provider_value_comparer/MyEntityEntityType.cs @@ -39,10 +39,10 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas afterSaveBehavior: PropertySaveBehavior.Throw, providerPropertyType: typeof(int)); id.SetGetter( - (Dictionary entity) => (entity.ContainsKey("Id") ? entity["Id"] : null) == null ? 0 : (int)(entity.ContainsKey("Id") ? entity["Id"] : null), - (Dictionary entity) => (entity.ContainsKey("Id") ? entity["Id"] : null) == null, - (Dictionary instance) => (instance.ContainsKey("Id") ? instance["Id"] : null) == null ? 0 : (int)(instance.ContainsKey("Id") ? instance["Id"] : null), - (Dictionary instance) => (instance.ContainsKey("Id") ? instance["Id"] : null) == null); + (Dictionary entity) => (((IDictionary)entity).ContainsKey("Id") ? entity["Id"] : null) == null ? 0 : (int)(((IDictionary)entity).ContainsKey("Id") ? entity["Id"] : null), + (Dictionary entity) => (((IDictionary)entity).ContainsKey("Id") ? entity["Id"] : null) == null, + (Dictionary instance) => (((IDictionary)instance).ContainsKey("Id") ? instance["Id"] : null) == null ? 0 : (int)(((IDictionary)instance).ContainsKey("Id") ? instance["Id"] : null), + (Dictionary instance) => (((IDictionary)instance).ContainsKey("Id") ? instance["Id"] : null) == null); id.SetSetter( (Dictionary entity, int value) => entity["Id"] = (object)value); id.SetMaterializationSetter( @@ -57,13 +57,13 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas else { { - if (entry.FlaggedAsTemporary(0) && (((Dictionary)entry.Entity).ContainsKey("Id") ? ((Dictionary)entry.Entity)["Id"] : null) == null) + if (entry.FlaggedAsTemporary(0) && (((IDictionary)(Dictionary)entry.Entity).ContainsKey("Id") ? ((Dictionary)entry.Entity)["Id"] : null) == null) { return entry.ReadTemporaryValue(0); } else { - var nullableValue = ((Dictionary)entry.Entity).ContainsKey("Id") ? ((Dictionary)entry.Entity)["Id"] : null; + var nullableValue = ((IDictionary)(Dictionary)entry.Entity).ContainsKey("Id") ? ((Dictionary)entry.Entity)["Id"] : null; return nullableValue == null ? default(int) : (int)nullableValue; } } @@ -71,7 +71,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas }, (InternalEntityEntry entry) => { - var nullableValue = ((Dictionary)entry.Entity).ContainsKey("Id") ? ((Dictionary)entry.Entity)["Id"] : null; + var nullableValue = ((IDictionary)(Dictionary)entry.Entity).ContainsKey("Id") ? ((Dictionary)entry.Entity)["Id"] : null; return nullableValue == null ? default(int) : (int)nullableValue; }, (InternalEntityEntry entry) => entry.ReadOriginalValue(id, 0), @@ -114,10 +114,10 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (Dictionary)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)id.GetValueComparer()).Snapshot(source.GetCurrentValue(id))); + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetValueComparer()).Snapshot(source.GetCurrentValue(id))); }); runtimeEntityType.SetStoreGeneratedValuesFactory( - () => (ISnapshot)new Snapshot(((ValueComparer)id.GetValueComparer()).Snapshot(default(int)))); + () => (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetValueComparer()).Snapshot(default(int)))); runtimeEntityType.SetTemporaryValuesFactory( (InternalEntityEntry source) => (ISnapshot)new Snapshot(default(int))); runtimeEntityType.SetShadowValuesFactory( @@ -128,7 +128,7 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (Dictionary)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)id.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(id))); + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(id))); }); runtimeEntityType.Counts = new PropertyCounts( propertyCount: 1, diff --git a/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/Custom_type_mapping/MyEntityEntityType.cs b/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/Custom_type_mapping/MyEntityEntityType.cs index 0dd08961f36..63f5da271b4 100644 --- a/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/Custom_type_mapping/MyEntityEntityType.cs +++ b/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/Custom_type_mapping/MyEntityEntityType.cs @@ -38,10 +38,10 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas valueGenerated: ValueGenerated.OnAdd, afterSaveBehavior: PropertySaveBehavior.Throw); id.SetGetter( - (Dictionary entity) => (entity.ContainsKey("Id") ? entity["Id"] : null) == null ? 0 : (int)(entity.ContainsKey("Id") ? entity["Id"] : null), - (Dictionary entity) => (entity.ContainsKey("Id") ? entity["Id"] : null) == null, - (Dictionary instance) => (instance.ContainsKey("Id") ? instance["Id"] : null) == null ? 0 : (int)(instance.ContainsKey("Id") ? instance["Id"] : null), - (Dictionary instance) => (instance.ContainsKey("Id") ? instance["Id"] : null) == null); + (Dictionary entity) => (((IDictionary)entity).ContainsKey("Id") ? entity["Id"] : null) == null ? 0 : (int)(((IDictionary)entity).ContainsKey("Id") ? entity["Id"] : null), + (Dictionary entity) => (((IDictionary)entity).ContainsKey("Id") ? entity["Id"] : null) == null, + (Dictionary instance) => (((IDictionary)instance).ContainsKey("Id") ? instance["Id"] : null) == null ? 0 : (int)(((IDictionary)instance).ContainsKey("Id") ? instance["Id"] : null), + (Dictionary instance) => (((IDictionary)instance).ContainsKey("Id") ? instance["Id"] : null) == null); id.SetSetter( (Dictionary entity, int value) => entity["Id"] = (object)value); id.SetMaterializationSetter( @@ -56,13 +56,13 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas else { { - if (entry.FlaggedAsTemporary(0) && (((Dictionary)entry.Entity).ContainsKey("Id") ? ((Dictionary)entry.Entity)["Id"] : null) == null) + if (entry.FlaggedAsTemporary(0) && (((IDictionary)(Dictionary)entry.Entity).ContainsKey("Id") ? ((Dictionary)entry.Entity)["Id"] : null) == null) { return entry.ReadTemporaryValue(0); } else { - var nullableValue = ((Dictionary)entry.Entity).ContainsKey("Id") ? ((Dictionary)entry.Entity)["Id"] : null; + var nullableValue = ((IDictionary)(Dictionary)entry.Entity).ContainsKey("Id") ? ((Dictionary)entry.Entity)["Id"] : null; return nullableValue == null ? default(int) : (int)nullableValue; } } @@ -70,7 +70,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas }, (InternalEntityEntry entry) => { - var nullableValue = ((Dictionary)entry.Entity).ContainsKey("Id") ? ((Dictionary)entry.Entity)["Id"] : null; + var nullableValue = ((IDictionary)(Dictionary)entry.Entity).ContainsKey("Id") ? ((Dictionary)entry.Entity)["Id"] : null; return nullableValue == null ? default(int) : (int)nullableValue; }, (InternalEntityEntry entry) => entry.ReadOriginalValue(id, 0), @@ -113,10 +113,10 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (Dictionary)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)id.GetValueComparer()).Snapshot(source.GetCurrentValue(id))); + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetValueComparer()).Snapshot(source.GetCurrentValue(id))); }); runtimeEntityType.SetStoreGeneratedValuesFactory( - () => (ISnapshot)new Snapshot(((ValueComparer)id.GetValueComparer()).Snapshot(default(int)))); + () => (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetValueComparer()).Snapshot(default(int)))); runtimeEntityType.SetTemporaryValuesFactory( (InternalEntityEntry source) => (ISnapshot)new Snapshot(default(int))); runtimeEntityType.SetShadowValuesFactory( @@ -127,7 +127,7 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (Dictionary)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)id.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(id))); + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(id))); }); runtimeEntityType.Counts = new PropertyCounts( propertyCount: 1, diff --git a/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/Custom_value_comparer/MyEntityEntityType.cs b/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/Custom_value_comparer/MyEntityEntityType.cs index 1636e461ce1..3035948c777 100644 --- a/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/Custom_value_comparer/MyEntityEntityType.cs +++ b/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/Custom_value_comparer/MyEntityEntityType.cs @@ -39,10 +39,10 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas afterSaveBehavior: PropertySaveBehavior.Throw, providerPropertyType: typeof(int)); id.SetGetter( - (Dictionary entity) => (entity.ContainsKey("Id") ? entity["Id"] : null) == null ? 0 : (int)(entity.ContainsKey("Id") ? entity["Id"] : null), - (Dictionary entity) => (entity.ContainsKey("Id") ? entity["Id"] : null) == null, - (Dictionary instance) => (instance.ContainsKey("Id") ? instance["Id"] : null) == null ? 0 : (int)(instance.ContainsKey("Id") ? instance["Id"] : null), - (Dictionary instance) => (instance.ContainsKey("Id") ? instance["Id"] : null) == null); + (Dictionary entity) => (((IDictionary)entity).ContainsKey("Id") ? entity["Id"] : null) == null ? 0 : (int)(((IDictionary)entity).ContainsKey("Id") ? entity["Id"] : null), + (Dictionary entity) => (((IDictionary)entity).ContainsKey("Id") ? entity["Id"] : null) == null, + (Dictionary instance) => (((IDictionary)instance).ContainsKey("Id") ? instance["Id"] : null) == null ? 0 : (int)(((IDictionary)instance).ContainsKey("Id") ? instance["Id"] : null), + (Dictionary instance) => (((IDictionary)instance).ContainsKey("Id") ? instance["Id"] : null) == null); id.SetSetter( (Dictionary entity, int value) => entity["Id"] = (object)value); id.SetMaterializationSetter( @@ -57,13 +57,13 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas else { { - if (entry.FlaggedAsTemporary(0) && (((Dictionary)entry.Entity).ContainsKey("Id") ? ((Dictionary)entry.Entity)["Id"] : null) == null) + if (entry.FlaggedAsTemporary(0) && (((IDictionary)(Dictionary)entry.Entity).ContainsKey("Id") ? ((Dictionary)entry.Entity)["Id"] : null) == null) { return entry.ReadTemporaryValue(0); } else { - var nullableValue = ((Dictionary)entry.Entity).ContainsKey("Id") ? ((Dictionary)entry.Entity)["Id"] : null; + var nullableValue = ((IDictionary)(Dictionary)entry.Entity).ContainsKey("Id") ? ((Dictionary)entry.Entity)["Id"] : null; return nullableValue == null ? default(int) : (int)nullableValue; } } @@ -71,7 +71,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas }, (InternalEntityEntry entry) => { - var nullableValue = ((Dictionary)entry.Entity).ContainsKey("Id") ? ((Dictionary)entry.Entity)["Id"] : null; + var nullableValue = ((IDictionary)(Dictionary)entry.Entity).ContainsKey("Id") ? ((Dictionary)entry.Entity)["Id"] : null; return nullableValue == null ? default(int) : (int)nullableValue; }, (InternalEntityEntry entry) => entry.ReadOriginalValue(id, 0), @@ -114,10 +114,10 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (Dictionary)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)id.GetValueComparer()).Snapshot(source.GetCurrentValue(id))); + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetValueComparer()).Snapshot(source.GetCurrentValue(id))); }); runtimeEntityType.SetStoreGeneratedValuesFactory( - () => (ISnapshot)new Snapshot(((ValueComparer)id.GetValueComparer()).Snapshot(default(int)))); + () => (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetValueComparer()).Snapshot(default(int)))); runtimeEntityType.SetTemporaryValuesFactory( (InternalEntityEntry source) => (ISnapshot)new Snapshot(default(int))); runtimeEntityType.SetShadowValuesFactory( @@ -128,7 +128,7 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (Dictionary)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)id.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(id))); + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(id))); }); runtimeEntityType.Counts = new PropertyCounts( propertyCount: 1, diff --git a/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/Custom_value_converter/MyEntityEntityType.cs b/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/Custom_value_converter/MyEntityEntityType.cs index efb4380b746..ab77a8ea0aa 100644 --- a/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/Custom_value_converter/MyEntityEntityType.cs +++ b/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/Custom_value_converter/MyEntityEntityType.cs @@ -39,10 +39,10 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas valueGenerated: ValueGenerated.OnAdd, afterSaveBehavior: PropertySaveBehavior.Throw); id.SetGetter( - (Dictionary entity) => (entity.ContainsKey("Id") ? entity["Id"] : null) == null ? 0 : (int)(entity.ContainsKey("Id") ? entity["Id"] : null), - (Dictionary entity) => (entity.ContainsKey("Id") ? entity["Id"] : null) == null, - (Dictionary instance) => (instance.ContainsKey("Id") ? instance["Id"] : null) == null ? 0 : (int)(instance.ContainsKey("Id") ? instance["Id"] : null), - (Dictionary instance) => (instance.ContainsKey("Id") ? instance["Id"] : null) == null); + (Dictionary entity) => (((IDictionary)entity).ContainsKey("Id") ? entity["Id"] : null) == null ? 0 : (int)(((IDictionary)entity).ContainsKey("Id") ? entity["Id"] : null), + (Dictionary entity) => (((IDictionary)entity).ContainsKey("Id") ? entity["Id"] : null) == null, + (Dictionary instance) => (((IDictionary)instance).ContainsKey("Id") ? instance["Id"] : null) == null ? 0 : (int)(((IDictionary)instance).ContainsKey("Id") ? instance["Id"] : null), + (Dictionary instance) => (((IDictionary)instance).ContainsKey("Id") ? instance["Id"] : null) == null); id.SetSetter( (Dictionary entity, int value) => entity["Id"] = (object)value); id.SetMaterializationSetter( @@ -57,13 +57,13 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas else { { - if (entry.FlaggedAsTemporary(0) && (((Dictionary)entry.Entity).ContainsKey("Id") ? ((Dictionary)entry.Entity)["Id"] : null) == null) + if (entry.FlaggedAsTemporary(0) && (((IDictionary)(Dictionary)entry.Entity).ContainsKey("Id") ? ((Dictionary)entry.Entity)["Id"] : null) == null) { return entry.ReadTemporaryValue(0); } else { - var nullableValue = ((Dictionary)entry.Entity).ContainsKey("Id") ? ((Dictionary)entry.Entity)["Id"] : null; + var nullableValue = ((IDictionary)(Dictionary)entry.Entity).ContainsKey("Id") ? ((Dictionary)entry.Entity)["Id"] : null; return nullableValue == null ? default(int) : (int)nullableValue; } } @@ -71,7 +71,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas }, (InternalEntityEntry entry) => { - var nullableValue = ((Dictionary)entry.Entity).ContainsKey("Id") ? ((Dictionary)entry.Entity)["Id"] : null; + var nullableValue = ((IDictionary)(Dictionary)entry.Entity).ContainsKey("Id") ? ((Dictionary)entry.Entity)["Id"] : null; return nullableValue == null ? default(int) : (int)nullableValue; }, (InternalEntityEntry entry) => entry.ReadOriginalValue(id, 0), @@ -120,10 +120,10 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (Dictionary)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)id.GetValueComparer()).Snapshot(source.GetCurrentValue(id))); + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetValueComparer()).Snapshot(source.GetCurrentValue(id))); }); runtimeEntityType.SetStoreGeneratedValuesFactory( - () => (ISnapshot)new Snapshot(((ValueComparer)id.GetValueComparer()).Snapshot(default(int)))); + () => (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetValueComparer()).Snapshot(default(int)))); runtimeEntityType.SetTemporaryValuesFactory( (InternalEntityEntry source) => (ISnapshot)new Snapshot(default(int))); runtimeEntityType.SetShadowValuesFactory( @@ -134,7 +134,7 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (Dictionary)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)id.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(id))); + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(id))); }); runtimeEntityType.Counts = new PropertyCounts( propertyCount: 1, diff --git a/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/Fully_qualified_model/IdentityUser0EntityType.cs b/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/Fully_qualified_model/IdentityUser0EntityType.cs index 0e9bb560270..903857677c9 100644 --- a/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/Fully_qualified_model/IdentityUser0EntityType.cs +++ b/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/Fully_qualified_model/IdentityUser0EntityType.cs @@ -52,7 +52,7 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (CompiledModelInMemoryTest.IdentityUser)source.Entity; - return (ISnapshot)new Snapshot, string, string, string, string, bool, string, bool, string>(source.GetCurrentValue(id) == null ? null : ((ValueComparer)id.GetValueComparer()).Snapshot(source.GetCurrentValue(id)), ((ValueComparer)accessFailedCount.GetValueComparer()).Snapshot(source.GetCurrentValue(accessFailedCount)), source.GetCurrentValue(concurrencyStamp) == null ? null : ((ValueComparer)concurrencyStamp.GetValueComparer()).Snapshot(source.GetCurrentValue(concurrencyStamp)), source.GetCurrentValue(discriminator) == null ? null : ((ValueComparer)discriminator.GetValueComparer()).Snapshot(source.GetCurrentValue(discriminator)), source.GetCurrentValue(email) == null ? null : ((ValueComparer)email.GetValueComparer()).Snapshot(source.GetCurrentValue(email)), ((ValueComparer)emailConfirmed.GetValueComparer()).Snapshot(source.GetCurrentValue(emailConfirmed)), ((ValueComparer)lockoutEnabled.GetValueComparer()).Snapshot(source.GetCurrentValue(lockoutEnabled)), source.GetCurrentValue>(lockoutEnd) == null ? null : ((ValueComparer>)lockoutEnd.GetValueComparer()).Snapshot(source.GetCurrentValue>(lockoutEnd)), source.GetCurrentValue(normalizedEmail) == null ? null : ((ValueComparer)normalizedEmail.GetValueComparer()).Snapshot(source.GetCurrentValue(normalizedEmail)), source.GetCurrentValue(normalizedUserName) == null ? null : ((ValueComparer)normalizedUserName.GetValueComparer()).Snapshot(source.GetCurrentValue(normalizedUserName)), source.GetCurrentValue(passwordHash) == null ? null : ((ValueComparer)passwordHash.GetValueComparer()).Snapshot(source.GetCurrentValue(passwordHash)), source.GetCurrentValue(phoneNumber) == null ? null : ((ValueComparer)phoneNumber.GetValueComparer()).Snapshot(source.GetCurrentValue(phoneNumber)), ((ValueComparer)phoneNumberConfirmed.GetValueComparer()).Snapshot(source.GetCurrentValue(phoneNumberConfirmed)), source.GetCurrentValue(securityStamp) == null ? null : ((ValueComparer)securityStamp.GetValueComparer()).Snapshot(source.GetCurrentValue(securityStamp)), ((ValueComparer)twoFactorEnabled.GetValueComparer()).Snapshot(source.GetCurrentValue(twoFactorEnabled)), source.GetCurrentValue(userName) == null ? null : ((ValueComparer)userName.GetValueComparer()).Snapshot(source.GetCurrentValue(userName))); + return (ISnapshot)new Snapshot, string, string, string, string, bool, string, bool, string>(source.GetCurrentValue(id) == null ? null : ((ValueComparer)((IProperty)id).GetValueComparer()).Snapshot(source.GetCurrentValue(id)), ((ValueComparer)((IProperty)accessFailedCount).GetValueComparer()).Snapshot(source.GetCurrentValue(accessFailedCount)), source.GetCurrentValue(concurrencyStamp) == null ? null : ((ValueComparer)((IProperty)concurrencyStamp).GetValueComparer()).Snapshot(source.GetCurrentValue(concurrencyStamp)), source.GetCurrentValue(discriminator) == null ? null : ((ValueComparer)((IProperty)discriminator).GetValueComparer()).Snapshot(source.GetCurrentValue(discriminator)), source.GetCurrentValue(email) == null ? null : ((ValueComparer)((IProperty)email).GetValueComparer()).Snapshot(source.GetCurrentValue(email)), ((ValueComparer)((IProperty)emailConfirmed).GetValueComparer()).Snapshot(source.GetCurrentValue(emailConfirmed)), ((ValueComparer)((IProperty)lockoutEnabled).GetValueComparer()).Snapshot(source.GetCurrentValue(lockoutEnabled)), source.GetCurrentValue>(lockoutEnd) == null ? null : ((ValueComparer>)((IProperty)lockoutEnd).GetValueComparer()).Snapshot(source.GetCurrentValue>(lockoutEnd)), source.GetCurrentValue(normalizedEmail) == null ? null : ((ValueComparer)((IProperty)normalizedEmail).GetValueComparer()).Snapshot(source.GetCurrentValue(normalizedEmail)), source.GetCurrentValue(normalizedUserName) == null ? null : ((ValueComparer)((IProperty)normalizedUserName).GetValueComparer()).Snapshot(source.GetCurrentValue(normalizedUserName)), source.GetCurrentValue(passwordHash) == null ? null : ((ValueComparer)((IProperty)passwordHash).GetValueComparer()).Snapshot(source.GetCurrentValue(passwordHash)), source.GetCurrentValue(phoneNumber) == null ? null : ((ValueComparer)((IProperty)phoneNumber).GetValueComparer()).Snapshot(source.GetCurrentValue(phoneNumber)), ((ValueComparer)((IProperty)phoneNumberConfirmed).GetValueComparer()).Snapshot(source.GetCurrentValue(phoneNumberConfirmed)), source.GetCurrentValue(securityStamp) == null ? null : ((ValueComparer)((IProperty)securityStamp).GetValueComparer()).Snapshot(source.GetCurrentValue(securityStamp)), ((ValueComparer)((IProperty)twoFactorEnabled).GetValueComparer()).Snapshot(source.GetCurrentValue(twoFactorEnabled)), source.GetCurrentValue(userName) == null ? null : ((ValueComparer)((IProperty)userName).GetValueComparer()).Snapshot(source.GetCurrentValue(userName))); }); runtimeEntityType.SetStoreGeneratedValuesFactory( () => Snapshot.Empty); @@ -66,7 +66,7 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (CompiledModelInMemoryTest.IdentityUser)source.Entity; - return (ISnapshot)new Snapshot(source.GetCurrentValue(id) == null ? null : ((ValueComparer)id.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(id))); + return (ISnapshot)new Snapshot(source.GetCurrentValue(id) == null ? null : ((ValueComparer)((IProperty)id).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(id))); }); runtimeEntityType.Counts = new PropertyCounts( propertyCount: 16, diff --git a/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/Fully_qualified_model/IdentityUserEntityType.cs b/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/Fully_qualified_model/IdentityUserEntityType.cs index f3dee7022dd..4f4bfbac04b 100644 --- a/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/Fully_qualified_model/IdentityUserEntityType.cs +++ b/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/Fully_qualified_model/IdentityUserEntityType.cs @@ -64,15 +64,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas id.TypeMapping = InMemoryTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), clrType: typeof(string), jsonValueReaderWriter: JsonStringReaderWriter.Instance); @@ -153,15 +153,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas concurrencyStamp.TypeMapping = InMemoryTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), clrType: typeof(string), jsonValueReaderWriter: JsonStringReaderWriter.Instance); @@ -181,15 +181,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas discriminator.TypeMapping = InMemoryTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), clrType: typeof(string), jsonValueReaderWriter: JsonStringReaderWriter.Instance); @@ -224,15 +224,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas email.TypeMapping = InMemoryTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), clrType: typeof(string), jsonValueReaderWriter: JsonStringReaderWriter.Instance); @@ -268,15 +268,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas emailConfirmed.TypeMapping = InMemoryTypeMapping.Default.Clone( comparer: new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v), keyComparer: new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v), providerValueComparer: new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v), clrType: typeof(bool), jsonValueReaderWriter: JsonBoolReaderWriter.Instance); @@ -312,15 +312,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas lockoutEnabled.TypeMapping = InMemoryTypeMapping.Default.Clone( comparer: new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v), keyComparer: new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v), providerValueComparer: new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v), clrType: typeof(bool), jsonValueReaderWriter: JsonBoolReaderWriter.Instance); @@ -356,15 +356,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas lockoutEnd.TypeMapping = InMemoryTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && ((DateTimeOffset)v1).EqualsExact((DateTimeOffset)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((DateTimeOffset)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(DateTimeOffset)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(DateTimeOffset)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && ((DateTimeOffset)v1).EqualsExact((DateTimeOffset)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((DateTimeOffset)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(DateTimeOffset)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(DateTimeOffset)v : default(Nullable)), providerValueComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && ((DateTimeOffset)v1).EqualsExact((DateTimeOffset)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((DateTimeOffset)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(DateTimeOffset)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(DateTimeOffset)v : default(Nullable)), clrType: typeof(DateTimeOffset), jsonValueReaderWriter: JsonDateTimeOffsetReaderWriter.Instance); @@ -400,15 +400,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas normalizedEmail.TypeMapping = InMemoryTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), clrType: typeof(string), jsonValueReaderWriter: JsonStringReaderWriter.Instance); @@ -444,15 +444,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas normalizedUserName.TypeMapping = InMemoryTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), clrType: typeof(string), jsonValueReaderWriter: JsonStringReaderWriter.Instance); @@ -488,15 +488,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas passwordHash.TypeMapping = InMemoryTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), clrType: typeof(string), jsonValueReaderWriter: JsonStringReaderWriter.Instance); @@ -532,15 +532,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas phoneNumber.TypeMapping = InMemoryTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), clrType: typeof(string), jsonValueReaderWriter: JsonStringReaderWriter.Instance); @@ -576,15 +576,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas phoneNumberConfirmed.TypeMapping = InMemoryTypeMapping.Default.Clone( comparer: new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v), keyComparer: new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v), providerValueComparer: new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v), clrType: typeof(bool), jsonValueReaderWriter: JsonBoolReaderWriter.Instance); @@ -620,15 +620,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas securityStamp.TypeMapping = InMemoryTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), clrType: typeof(string), jsonValueReaderWriter: JsonStringReaderWriter.Instance); @@ -664,15 +664,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas twoFactorEnabled.TypeMapping = InMemoryTypeMapping.Default.Clone( comparer: new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v), keyComparer: new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v), providerValueComparer: new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v), clrType: typeof(bool), jsonValueReaderWriter: JsonBoolReaderWriter.Instance); @@ -708,15 +708,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas userName.TypeMapping = InMemoryTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), clrType: typeof(string), jsonValueReaderWriter: JsonStringReaderWriter.Instance); @@ -751,7 +751,7 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (IdentityUser)source.Entity; - return (ISnapshot)new Snapshot, string, string, string, string, bool, string, bool, string>(source.GetCurrentValue(id) == null ? null : ((ValueComparer)id.GetValueComparer()).Snapshot(source.GetCurrentValue(id)), ((ValueComparer)accessFailedCount.GetValueComparer()).Snapshot(source.GetCurrentValue(accessFailedCount)), source.GetCurrentValue(concurrencyStamp) == null ? null : ((ValueComparer)concurrencyStamp.GetValueComparer()).Snapshot(source.GetCurrentValue(concurrencyStamp)), source.GetCurrentValue(discriminator) == null ? null : ((ValueComparer)discriminator.GetValueComparer()).Snapshot(source.GetCurrentValue(discriminator)), source.GetCurrentValue(email) == null ? null : ((ValueComparer)email.GetValueComparer()).Snapshot(source.GetCurrentValue(email)), ((ValueComparer)emailConfirmed.GetValueComparer()).Snapshot(source.GetCurrentValue(emailConfirmed)), ((ValueComparer)lockoutEnabled.GetValueComparer()).Snapshot(source.GetCurrentValue(lockoutEnabled)), source.GetCurrentValue>(lockoutEnd) == null ? null : ((ValueComparer>)lockoutEnd.GetValueComparer()).Snapshot(source.GetCurrentValue>(lockoutEnd)), source.GetCurrentValue(normalizedEmail) == null ? null : ((ValueComparer)normalizedEmail.GetValueComparer()).Snapshot(source.GetCurrentValue(normalizedEmail)), source.GetCurrentValue(normalizedUserName) == null ? null : ((ValueComparer)normalizedUserName.GetValueComparer()).Snapshot(source.GetCurrentValue(normalizedUserName)), source.GetCurrentValue(passwordHash) == null ? null : ((ValueComparer)passwordHash.GetValueComparer()).Snapshot(source.GetCurrentValue(passwordHash)), source.GetCurrentValue(phoneNumber) == null ? null : ((ValueComparer)phoneNumber.GetValueComparer()).Snapshot(source.GetCurrentValue(phoneNumber)), ((ValueComparer)phoneNumberConfirmed.GetValueComparer()).Snapshot(source.GetCurrentValue(phoneNumberConfirmed)), source.GetCurrentValue(securityStamp) == null ? null : ((ValueComparer)securityStamp.GetValueComparer()).Snapshot(source.GetCurrentValue(securityStamp)), ((ValueComparer)twoFactorEnabled.GetValueComparer()).Snapshot(source.GetCurrentValue(twoFactorEnabled)), source.GetCurrentValue(userName) == null ? null : ((ValueComparer)userName.GetValueComparer()).Snapshot(source.GetCurrentValue(userName))); + return (ISnapshot)new Snapshot, string, string, string, string, bool, string, bool, string>(source.GetCurrentValue(id) == null ? null : ((ValueComparer)((IProperty)id).GetValueComparer()).Snapshot(source.GetCurrentValue(id)), ((ValueComparer)((IProperty)accessFailedCount).GetValueComparer()).Snapshot(source.GetCurrentValue(accessFailedCount)), source.GetCurrentValue(concurrencyStamp) == null ? null : ((ValueComparer)((IProperty)concurrencyStamp).GetValueComparer()).Snapshot(source.GetCurrentValue(concurrencyStamp)), source.GetCurrentValue(discriminator) == null ? null : ((ValueComparer)((IProperty)discriminator).GetValueComparer()).Snapshot(source.GetCurrentValue(discriminator)), source.GetCurrentValue(email) == null ? null : ((ValueComparer)((IProperty)email).GetValueComparer()).Snapshot(source.GetCurrentValue(email)), ((ValueComparer)((IProperty)emailConfirmed).GetValueComparer()).Snapshot(source.GetCurrentValue(emailConfirmed)), ((ValueComparer)((IProperty)lockoutEnabled).GetValueComparer()).Snapshot(source.GetCurrentValue(lockoutEnabled)), source.GetCurrentValue>(lockoutEnd) == null ? null : ((ValueComparer>)((IProperty)lockoutEnd).GetValueComparer()).Snapshot(source.GetCurrentValue>(lockoutEnd)), source.GetCurrentValue(normalizedEmail) == null ? null : ((ValueComparer)((IProperty)normalizedEmail).GetValueComparer()).Snapshot(source.GetCurrentValue(normalizedEmail)), source.GetCurrentValue(normalizedUserName) == null ? null : ((ValueComparer)((IProperty)normalizedUserName).GetValueComparer()).Snapshot(source.GetCurrentValue(normalizedUserName)), source.GetCurrentValue(passwordHash) == null ? null : ((ValueComparer)((IProperty)passwordHash).GetValueComparer()).Snapshot(source.GetCurrentValue(passwordHash)), source.GetCurrentValue(phoneNumber) == null ? null : ((ValueComparer)((IProperty)phoneNumber).GetValueComparer()).Snapshot(source.GetCurrentValue(phoneNumber)), ((ValueComparer)((IProperty)phoneNumberConfirmed).GetValueComparer()).Snapshot(source.GetCurrentValue(phoneNumberConfirmed)), source.GetCurrentValue(securityStamp) == null ? null : ((ValueComparer)((IProperty)securityStamp).GetValueComparer()).Snapshot(source.GetCurrentValue(securityStamp)), ((ValueComparer)((IProperty)twoFactorEnabled).GetValueComparer()).Snapshot(source.GetCurrentValue(twoFactorEnabled)), source.GetCurrentValue(userName) == null ? null : ((ValueComparer)((IProperty)userName).GetValueComparer()).Snapshot(source.GetCurrentValue(userName))); }); runtimeEntityType.SetStoreGeneratedValuesFactory( () => Snapshot.Empty); @@ -765,7 +765,7 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (IdentityUser)source.Entity; - return (ISnapshot)new Snapshot(source.GetCurrentValue(id) == null ? null : ((ValueComparer)id.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(id))); + return (ISnapshot)new Snapshot(source.GetCurrentValue(id) == null ? null : ((ValueComparer)((IProperty)id).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(id))); }); runtimeEntityType.Counts = new PropertyCounts( propertyCount: 16, diff --git a/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/Fully_qualified_model/IndexEntityType.cs b/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/Fully_qualified_model/IndexEntityType.cs index 4ed97ac5200..811d2b79db1 100644 --- a/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/Fully_qualified_model/IndexEntityType.cs +++ b/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/Fully_qualified_model/IndexEntityType.cs @@ -62,15 +62,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas id.TypeMapping = InMemoryTypeMapping.Default.Clone( comparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), keyComparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), providerValueComparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), clrType: typeof(Guid), jsonValueReaderWriter: JsonGuidReaderWriter.Instance); @@ -91,10 +91,10 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (CompiledModelInMemoryTest.Index)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)id.GetValueComparer()).Snapshot(source.GetCurrentValue(id))); + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetValueComparer()).Snapshot(source.GetCurrentValue(id))); }); runtimeEntityType.SetStoreGeneratedValuesFactory( - () => (ISnapshot)new Snapshot(((ValueComparer)id.GetValueComparer()).Snapshot(default(Guid)))); + () => (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetValueComparer()).Snapshot(default(Guid)))); runtimeEntityType.SetTemporaryValuesFactory( (InternalEntityEntry source) => (ISnapshot)new Snapshot(default(Guid))); runtimeEntityType.SetShadowValuesFactory( @@ -105,7 +105,7 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (CompiledModelInMemoryTest.Index)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)id.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(id))); + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(id))); }); runtimeEntityType.Counts = new PropertyCounts( propertyCount: 1, diff --git a/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/Fully_qualified_model/ScaffoldingEntityType.cs b/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/Fully_qualified_model/ScaffoldingEntityType.cs index 3b714bd58b6..3e87f3c9bf1 100644 --- a/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/Fully_qualified_model/ScaffoldingEntityType.cs +++ b/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/Fully_qualified_model/ScaffoldingEntityType.cs @@ -62,15 +62,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas id.TypeMapping = InMemoryTypeMapping.Default.Clone( comparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), keyComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), clrType: typeof(long), jsonValueReaderWriter: JsonInt64ReaderWriter.Instance); @@ -91,10 +91,10 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (CompiledModelInMemoryTest.Scaffolding)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)id.GetValueComparer()).Snapshot(source.GetCurrentValue(id))); + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetValueComparer()).Snapshot(source.GetCurrentValue(id))); }); runtimeEntityType.SetStoreGeneratedValuesFactory( - () => (ISnapshot)new Snapshot(((ValueComparer)id.GetValueComparer()).Snapshot(default(long)))); + () => (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetValueComparer()).Snapshot(default(long)))); runtimeEntityType.SetTemporaryValuesFactory( (InternalEntityEntry source) => (ISnapshot)new Snapshot(default(long))); runtimeEntityType.SetShadowValuesFactory( @@ -105,7 +105,7 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (CompiledModelInMemoryTest.Scaffolding)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)id.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(id))); + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(id))); }); runtimeEntityType.Counts = new PropertyCounts( propertyCount: 1, diff --git a/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/Global_namespace/EntityType1.cs b/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/Global_namespace/EntityType1.cs index 6a55da83028..26b960864e3 100644 --- a/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/Global_namespace/EntityType1.cs +++ b/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/Global_namespace/EntityType1.cs @@ -36,10 +36,10 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas valueGenerated: ValueGenerated.OnAdd, afterSaveBehavior: PropertySaveBehavior.Throw); id.SetGetter( - (Dictionary entity) => (entity.ContainsKey("Id") ? entity["Id"] : null) == null ? 0 : (int)(entity.ContainsKey("Id") ? entity["Id"] : null), - (Dictionary entity) => (entity.ContainsKey("Id") ? entity["Id"] : null) == null, - (Dictionary instance) => (instance.ContainsKey("Id") ? instance["Id"] : null) == null ? 0 : (int)(instance.ContainsKey("Id") ? instance["Id"] : null), - (Dictionary instance) => (instance.ContainsKey("Id") ? instance["Id"] : null) == null); + (Dictionary entity) => (((IDictionary)entity).ContainsKey("Id") ? entity["Id"] : null) == null ? 0 : (int)(((IDictionary)entity).ContainsKey("Id") ? entity["Id"] : null), + (Dictionary entity) => (((IDictionary)entity).ContainsKey("Id") ? entity["Id"] : null) == null, + (Dictionary instance) => (((IDictionary)instance).ContainsKey("Id") ? instance["Id"] : null) == null ? 0 : (int)(((IDictionary)instance).ContainsKey("Id") ? instance["Id"] : null), + (Dictionary instance) => (((IDictionary)instance).ContainsKey("Id") ? instance["Id"] : null) == null); id.SetSetter( (Dictionary entity, int value) => entity["Id"] = (object)value); id.SetMaterializationSetter( @@ -54,13 +54,13 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas else { { - if (entry.FlaggedAsTemporary(0) && (((Dictionary)entry.Entity).ContainsKey("Id") ? ((Dictionary)entry.Entity)["Id"] : null) == null) + if (entry.FlaggedAsTemporary(0) && (((IDictionary)(Dictionary)entry.Entity).ContainsKey("Id") ? ((Dictionary)entry.Entity)["Id"] : null) == null) { return entry.ReadTemporaryValue(0); } else { - var nullableValue = ((Dictionary)entry.Entity).ContainsKey("Id") ? ((Dictionary)entry.Entity)["Id"] : null; + var nullableValue = ((IDictionary)(Dictionary)entry.Entity).ContainsKey("Id") ? ((Dictionary)entry.Entity)["Id"] : null; return nullableValue == null ? default(int) : (int)nullableValue; } } @@ -68,7 +68,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas }, (InternalEntityEntry entry) => { - var nullableValue = ((Dictionary)entry.Entity).ContainsKey("Id") ? ((Dictionary)entry.Entity)["Id"] : null; + var nullableValue = ((IDictionary)(Dictionary)entry.Entity).ContainsKey("Id") ? ((Dictionary)entry.Entity)["Id"] : null; return nullableValue == null ? default(int) : (int)nullableValue; }, (InternalEntityEntry entry) => entry.ReadOriginalValue(id, 0), @@ -111,10 +111,10 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (Dictionary)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)id.GetValueComparer()).Snapshot(source.GetCurrentValue(id))); + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetValueComparer()).Snapshot(source.GetCurrentValue(id))); }); runtimeEntityType.SetStoreGeneratedValuesFactory( - () => (ISnapshot)new Snapshot(((ValueComparer)id.GetValueComparer()).Snapshot(default(int)))); + () => (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetValueComparer()).Snapshot(default(int)))); runtimeEntityType.SetTemporaryValuesFactory( (InternalEntityEntry source) => (ISnapshot)new Snapshot(default(int))); runtimeEntityType.SetShadowValuesFactory( @@ -125,7 +125,7 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (Dictionary)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)id.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(id))); + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(id))); }); runtimeEntityType.Counts = new PropertyCounts( propertyCount: 1, diff --git a/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/Lazy_loading_manual/LazyProxiesEntity3EntityType.cs b/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/Lazy_loading_manual/LazyProxiesEntity3EntityType.cs index 3daecf3fa2f..73ec9ee8f77 100644 --- a/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/Lazy_loading_manual/LazyProxiesEntity3EntityType.cs +++ b/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/Lazy_loading_manual/LazyProxiesEntity3EntityType.cs @@ -108,15 +108,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas name.TypeMapping = InMemoryTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), clrType: typeof(string), jsonValueReaderWriter: JsonStringReaderWriter.Instance); @@ -149,7 +149,7 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (CompiledModelInMemoryTest.LazyProxiesEntity3)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)id.GetValueComparer()).Snapshot(source.GetCurrentValue(id)), source.GetCurrentValue(name) == null ? null : ((ValueComparer)name.GetValueComparer()).Snapshot(source.GetCurrentValue(name))); + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetValueComparer()).Snapshot(source.GetCurrentValue(id)), source.GetCurrentValue(name) == null ? null : ((ValueComparer)((IProperty)name).GetValueComparer()).Snapshot(source.GetCurrentValue(name))); }); runtimeEntityType.SetStoreGeneratedValuesFactory( () => Snapshot.Empty); @@ -163,7 +163,7 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (CompiledModelInMemoryTest.LazyProxiesEntity3)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)id.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(id)), SnapshotFactoryFactory.SnapshotCollection(UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_LazyProxiesEntity3__collectionNavigation(entity))); + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(id)), SnapshotFactoryFactory.SnapshotCollection(UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_LazyProxiesEntity3__collectionNavigation(entity))); }); runtimeEntityType.Counts = new PropertyCounts( propertyCount: 2, diff --git a/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/Lazy_loading_manual/LazyProxiesEntity4EntityType.cs b/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/Lazy_loading_manual/LazyProxiesEntity4EntityType.cs index d4bfb153184..7c30d870c22 100644 --- a/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/Lazy_loading_manual/LazyProxiesEntity4EntityType.cs +++ b/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/Lazy_loading_manual/LazyProxiesEntity4EntityType.cs @@ -111,15 +111,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas content.TypeMapping = InMemoryTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), clrType: typeof(string), jsonValueReaderWriter: JsonStringReaderWriter.Instance); @@ -182,15 +182,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas title.TypeMapping = InMemoryTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), clrType: typeof(string), jsonValueReaderWriter: JsonStringReaderWriter.Instance); @@ -304,10 +304,10 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (CompiledModelInMemoryTest.LazyProxiesEntity4)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)id.GetValueComparer()).Snapshot(source.GetCurrentValue(id)), source.GetCurrentValue(content) == null ? null : ((ValueComparer)content.GetValueComparer()).Snapshot(source.GetCurrentValue(content)), ((ValueComparer)referenceNavigationId.GetValueComparer()).Snapshot(source.GetCurrentValue(referenceNavigationId)), source.GetCurrentValue(title) == null ? null : ((ValueComparer)title.GetValueComparer()).Snapshot(source.GetCurrentValue(title))); + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetValueComparer()).Snapshot(source.GetCurrentValue(id)), source.GetCurrentValue(content) == null ? null : ((ValueComparer)((IProperty)content).GetValueComparer()).Snapshot(source.GetCurrentValue(content)), ((ValueComparer)((IProperty)referenceNavigationId).GetValueComparer()).Snapshot(source.GetCurrentValue(referenceNavigationId)), source.GetCurrentValue(title) == null ? null : ((ValueComparer)((IProperty)title).GetValueComparer()).Snapshot(source.GetCurrentValue(title))); }); runtimeEntityType.SetStoreGeneratedValuesFactory( - () => (ISnapshot)new Snapshot(((ValueComparer)referenceNavigationId.GetValueComparer()).Snapshot(default(int)))); + () => (ISnapshot)new Snapshot(((ValueComparer)((IProperty)referenceNavigationId).GetValueComparer()).Snapshot(default(int)))); runtimeEntityType.SetTemporaryValuesFactory( (InternalEntityEntry source) => (ISnapshot)new Snapshot(default(int))); runtimeEntityType.SetShadowValuesFactory( @@ -318,7 +318,7 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (CompiledModelInMemoryTest.LazyProxiesEntity4)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)id.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(id)), ((ValueComparer)referenceNavigationId.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(referenceNavigationId)), UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_LazyProxiesEntity4__referenceNavigation(entity)); + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(id)), ((ValueComparer)((IProperty)referenceNavigationId).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(referenceNavigationId)), UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_LazyProxiesEntity4__referenceNavigation(entity)); }); runtimeEntityType.Counts = new PropertyCounts( propertyCount: 4, diff --git a/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/Lazy_loading_proxies/LazyProxiesEntity1EntityType.cs b/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/Lazy_loading_proxies/LazyProxiesEntity1EntityType.cs index 5a8298ef09a..6e65304ff77 100644 --- a/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/Lazy_loading_proxies/LazyProxiesEntity1EntityType.cs +++ b/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/Lazy_loading_proxies/LazyProxiesEntity1EntityType.cs @@ -213,10 +213,10 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (CompiledModelInMemoryTest.LazyProxiesEntity1)source.Entity; - return (ISnapshot)new Snapshot>(((ValueComparer)id.GetValueComparer()).Snapshot(source.GetCurrentValue(id)), source.GetCurrentValue>(referenceNavigationId) == null ? null : ((ValueComparer>)referenceNavigationId.GetValueComparer()).Snapshot(source.GetCurrentValue>(referenceNavigationId))); + return (ISnapshot)new Snapshot>(((ValueComparer)((IProperty)id).GetValueComparer()).Snapshot(source.GetCurrentValue(id)), source.GetCurrentValue>(referenceNavigationId) == null ? null : ((ValueComparer>)((IProperty)referenceNavigationId).GetValueComparer()).Snapshot(source.GetCurrentValue>(referenceNavigationId))); }); runtimeEntityType.SetStoreGeneratedValuesFactory( - () => (ISnapshot)new Snapshot>(((ValueComparer)id.GetValueComparer()).Snapshot(default(int)), default(Nullable) == null ? null : ((ValueComparer>)referenceNavigationId.GetValueComparer()).Snapshot(default(Nullable)))); + () => (ISnapshot)new Snapshot>(((ValueComparer)((IProperty)id).GetValueComparer()).Snapshot(default(int)), default(Nullable) == null ? null : ((ValueComparer>)((IProperty)referenceNavigationId).GetValueComparer()).Snapshot(default(Nullable)))); runtimeEntityType.SetTemporaryValuesFactory( (InternalEntityEntry source) => (ISnapshot)new Snapshot>(default(int), default(Nullable))); runtimeEntityType.SetShadowValuesFactory( @@ -227,7 +227,7 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (CompiledModelInMemoryTest.LazyProxiesEntity1)source.Entity; - return (ISnapshot)new Snapshot, object>(((ValueComparer)id.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(id)), source.GetCurrentValue>(referenceNavigationId) == null ? null : ((ValueComparer>)referenceNavigationId.GetKeyValueComparer()).Snapshot(source.GetCurrentValue>(referenceNavigationId)), UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_LazyProxiesEntity1_ReferenceNavigation(entity)); + return (ISnapshot)new Snapshot, object>(((ValueComparer)((IProperty)id).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(id)), source.GetCurrentValue>(referenceNavigationId) == null ? null : ((ValueComparer>)((IProperty)referenceNavigationId).GetKeyValueComparer()).Snapshot(source.GetCurrentValue>(referenceNavigationId)), UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_LazyProxiesEntity1_ReferenceNavigation(entity)); }); runtimeEntityType.Counts = new PropertyCounts( propertyCount: 2, diff --git a/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/Lazy_loading_proxies/LazyProxiesEntity2EntityType.cs b/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/Lazy_loading_proxies/LazyProxiesEntity2EntityType.cs index 0c226b79c99..6c552be0289 100644 --- a/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/Lazy_loading_proxies/LazyProxiesEntity2EntityType.cs +++ b/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/Lazy_loading_proxies/LazyProxiesEntity2EntityType.cs @@ -105,10 +105,10 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (CompiledModelInMemoryTest.LazyProxiesEntity2)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)id.GetValueComparer()).Snapshot(source.GetCurrentValue(id))); + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetValueComparer()).Snapshot(source.GetCurrentValue(id))); }); runtimeEntityType.SetStoreGeneratedValuesFactory( - () => (ISnapshot)new Snapshot(((ValueComparer)id.GetValueComparer()).Snapshot(default(int)))); + () => (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetValueComparer()).Snapshot(default(int)))); runtimeEntityType.SetTemporaryValuesFactory( (InternalEntityEntry source) => (ISnapshot)new Snapshot(default(int))); runtimeEntityType.SetShadowValuesFactory( @@ -119,7 +119,7 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (CompiledModelInMemoryTest.LazyProxiesEntity2)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)id.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(id)), SnapshotFactoryFactory.SnapshotCollection(UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_LazyProxiesEntity2_CollectionNavigation(entity))); + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(id)), SnapshotFactoryFactory.SnapshotCollection(UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_LazyProxiesEntity2_CollectionNavigation(entity))); }); runtimeEntityType.Counts = new PropertyCounts( propertyCount: 1, diff --git a/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/Manual_lazy_loading/LazyConstructorEntityEntityType.cs b/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/Manual_lazy_loading/LazyConstructorEntityEntityType.cs index 53cea01bf9e..a783dad0d26 100644 --- a/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/Manual_lazy_loading/LazyConstructorEntityEntityType.cs +++ b/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/Manual_lazy_loading/LazyConstructorEntityEntityType.cs @@ -106,10 +106,10 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (CompiledModelInMemoryTest.LazyConstructorEntity)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)id.GetValueComparer()).Snapshot(source.GetCurrentValue(id))); + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetValueComparer()).Snapshot(source.GetCurrentValue(id))); }); runtimeEntityType.SetStoreGeneratedValuesFactory( - () => (ISnapshot)new Snapshot(((ValueComparer)id.GetValueComparer()).Snapshot(default(int)))); + () => (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetValueComparer()).Snapshot(default(int)))); runtimeEntityType.SetTemporaryValuesFactory( (InternalEntityEntry source) => (ISnapshot)new Snapshot(default(int))); runtimeEntityType.SetShadowValuesFactory( @@ -120,7 +120,7 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (CompiledModelInMemoryTest.LazyConstructorEntity)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)id.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(id)), UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_LazyConstructorEntity_LazyPropertyDelegateEntity(entity), UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_LazyConstructorEntity_LazyPropertyEntity(entity)); + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(id)), UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_LazyConstructorEntity_LazyPropertyDelegateEntity(entity), UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_LazyConstructorEntity_LazyPropertyEntity(entity)); }); runtimeEntityType.Counts = new PropertyCounts( propertyCount: 1, diff --git a/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/Manual_lazy_loading/LazyPropertyDelegateEntityEntityType.cs b/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/Manual_lazy_loading/LazyPropertyDelegateEntityEntityType.cs index 4358cc32a2b..438ef2496b0 100644 --- a/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/Manual_lazy_loading/LazyPropertyDelegateEntityEntityType.cs +++ b/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/Manual_lazy_loading/LazyPropertyDelegateEntityEntityType.cs @@ -240,10 +240,10 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (CompiledModelInMemoryTest.LazyPropertyDelegateEntity)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)id.GetValueComparer()).Snapshot(source.GetCurrentValue(id)), ((ValueComparer)lazyConstructorEntityId.GetValueComparer()).Snapshot(source.GetCurrentValue(lazyConstructorEntityId))); + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetValueComparer()).Snapshot(source.GetCurrentValue(id)), ((ValueComparer)((IProperty)lazyConstructorEntityId).GetValueComparer()).Snapshot(source.GetCurrentValue(lazyConstructorEntityId))); }); runtimeEntityType.SetStoreGeneratedValuesFactory( - () => (ISnapshot)new Snapshot(((ValueComparer)id.GetValueComparer()).Snapshot(default(int)), ((ValueComparer)lazyConstructorEntityId.GetValueComparer()).Snapshot(default(int)))); + () => (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetValueComparer()).Snapshot(default(int)), ((ValueComparer)((IProperty)lazyConstructorEntityId).GetValueComparer()).Snapshot(default(int)))); runtimeEntityType.SetTemporaryValuesFactory( (InternalEntityEntry source) => (ISnapshot)new Snapshot(default(int), default(int))); runtimeEntityType.SetShadowValuesFactory( @@ -254,7 +254,7 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (CompiledModelInMemoryTest.LazyPropertyDelegateEntity)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)id.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(id)), ((ValueComparer)lazyConstructorEntityId.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(lazyConstructorEntityId)), UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_LazyPropertyDelegateEntity_LazyConstructorEntity(entity)); + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(id)), ((ValueComparer)((IProperty)lazyConstructorEntityId).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(lazyConstructorEntityId)), UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_LazyPropertyDelegateEntity_LazyConstructorEntity(entity)); }); runtimeEntityType.Counts = new PropertyCounts( propertyCount: 2, diff --git a/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/Manual_lazy_loading/LazyPropertyEntityEntityType.cs b/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/Manual_lazy_loading/LazyPropertyEntityEntityType.cs index 4a2b036d945..176c558c41e 100644 --- a/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/Manual_lazy_loading/LazyPropertyEntityEntityType.cs +++ b/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/Manual_lazy_loading/LazyPropertyEntityEntityType.cs @@ -229,10 +229,10 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (CompiledModelInMemoryTest.LazyPropertyEntity)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)id.GetValueComparer()).Snapshot(source.GetCurrentValue(id)), ((ValueComparer)lazyConstructorEntityId.GetValueComparer()).Snapshot(source.GetCurrentValue(lazyConstructorEntityId))); + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetValueComparer()).Snapshot(source.GetCurrentValue(id)), ((ValueComparer)((IProperty)lazyConstructorEntityId).GetValueComparer()).Snapshot(source.GetCurrentValue(lazyConstructorEntityId))); }); runtimeEntityType.SetStoreGeneratedValuesFactory( - () => (ISnapshot)new Snapshot(((ValueComparer)id.GetValueComparer()).Snapshot(default(int)), ((ValueComparer)lazyConstructorEntityId.GetValueComparer()).Snapshot(default(int)))); + () => (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetValueComparer()).Snapshot(default(int)), ((ValueComparer)((IProperty)lazyConstructorEntityId).GetValueComparer()).Snapshot(default(int)))); runtimeEntityType.SetTemporaryValuesFactory( (InternalEntityEntry source) => (ISnapshot)new Snapshot(default(int), default(int))); runtimeEntityType.SetShadowValuesFactory( @@ -243,7 +243,7 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (CompiledModelInMemoryTest.LazyPropertyEntity)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)id.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(id)), ((ValueComparer)lazyConstructorEntityId.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(lazyConstructorEntityId)), UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_LazyPropertyEntity_LazyConstructorEntity(entity)); + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(id)), ((ValueComparer)((IProperty)lazyConstructorEntityId).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(lazyConstructorEntityId)), UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_LazyPropertyEntity_LazyConstructorEntity(entity)); }); runtimeEntityType.Counts = new PropertyCounts( propertyCount: 2, diff --git a/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/RelationshipCycles/DependentBaseEntityType.cs b/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/RelationshipCycles/DependentBaseEntityType.cs index 3c801ebb44a..64b96660b6e 100644 --- a/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/RelationshipCycles/DependentBaseEntityType.cs +++ b/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/RelationshipCycles/DependentBaseEntityType.cs @@ -64,15 +64,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas id.TypeMapping = InMemoryTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable)), providerValueComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable)), clrType: typeof(long), jsonValueReaderWriter: JsonInt64ReaderWriter.Instance); @@ -93,15 +93,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas principalId.TypeMapping = InMemoryTypeMapping.Default.Clone( comparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), keyComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), clrType: typeof(long), jsonValueReaderWriter: JsonInt64ReaderWriter.Instance); @@ -194,10 +194,10 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (CompiledModelTestBase.DependentBase>)source.Entity; - return (ISnapshot)new Snapshot, long>(source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)id.GetValueComparer()).Snapshot(source.GetCurrentValue>(id)), ((ValueComparer)principalId.GetValueComparer()).Snapshot(source.GetCurrentValue(principalId))); + return (ISnapshot)new Snapshot, long>(source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)((IProperty)id).GetValueComparer()).Snapshot(source.GetCurrentValue>(id)), ((ValueComparer)((IProperty)principalId).GetValueComparer()).Snapshot(source.GetCurrentValue(principalId))); }); runtimeEntityType.SetStoreGeneratedValuesFactory( - () => (ISnapshot)new Snapshot, long>(default(Nullable) == null ? null : ((ValueComparer>)id.GetValueComparer()).Snapshot(default(Nullable)), ((ValueComparer)principalId.GetValueComparer()).Snapshot(default(long)))); + () => (ISnapshot)new Snapshot, long>(default(Nullable) == null ? null : ((ValueComparer>)((IProperty)id).GetValueComparer()).Snapshot(default(Nullable)), ((ValueComparer)((IProperty)principalId).GetValueComparer()).Snapshot(default(long)))); runtimeEntityType.SetTemporaryValuesFactory( (InternalEntityEntry source) => (ISnapshot)new Snapshot, long>(default(Nullable), default(long))); runtimeEntityType.SetShadowValuesFactory( @@ -208,7 +208,7 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (CompiledModelTestBase.DependentBase>)source.Entity; - return (ISnapshot)new Snapshot, long, object>(source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)id.GetKeyValueComparer()).Snapshot(source.GetCurrentValue>(id)), ((ValueComparer)principalId.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalId)), UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_DependentBase1_Principal(entity)); + return (ISnapshot)new Snapshot, long, object>(source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)((IProperty)id).GetKeyValueComparer()).Snapshot(source.GetCurrentValue>(id)), ((ValueComparer)((IProperty)principalId).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalId)), UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_DependentBase1_Principal(entity)); }); runtimeEntityType.Counts = new PropertyCounts( propertyCount: 2, diff --git a/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/RelationshipCycles/PrincipalBaseEntityType.cs b/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/RelationshipCycles/PrincipalBaseEntityType.cs index 2442767899f..125773b7764 100644 --- a/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/RelationshipCycles/PrincipalBaseEntityType.cs +++ b/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/RelationshipCycles/PrincipalBaseEntityType.cs @@ -69,15 +69,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas id.TypeMapping = InMemoryTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable)), providerValueComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable)), clrType: typeof(long), jsonValueReaderWriter: JsonInt64ReaderWriter.Instance); @@ -98,15 +98,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas discriminator.TypeMapping = InMemoryTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), clrType: typeof(string), jsonValueReaderWriter: JsonStringReaderWriter.Instance); @@ -141,15 +141,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum1.TypeMapping = InMemoryTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.AnEnum v1, CompiledModelTestBase.AnEnum v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.AnEnum v) => v.GetHashCode(), + (CompiledModelTestBase.AnEnum v) => ((object)v).GetHashCode(), (CompiledModelTestBase.AnEnum v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.AnEnum v1, CompiledModelTestBase.AnEnum v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.AnEnum v) => v.GetHashCode(), + (CompiledModelTestBase.AnEnum v) => ((object)v).GetHashCode(), (CompiledModelTestBase.AnEnum v) => v), providerValueComparer: new ValueComparer( (CompiledModelTestBase.AnEnum v1, CompiledModelTestBase.AnEnum v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.AnEnum v) => v.GetHashCode(), + (CompiledModelTestBase.AnEnum v) => ((object)v).GetHashCode(), (CompiledModelTestBase.AnEnum v) => v), clrType: typeof(CompiledModelTestBase.AnEnum), jsonValueReaderWriter: JsonSignedEnumReaderWriter.Instance); @@ -185,15 +185,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum2.TypeMapping = InMemoryTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.AnEnum)v1, (object)(CompiledModelTestBase.AnEnum)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.AnEnum)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.AnEnum)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.AnEnum)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.AnEnum)v1, (object)(CompiledModelTestBase.AnEnum)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.AnEnum)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.AnEnum)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.AnEnum)v : default(Nullable)), providerValueComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.AnEnum)v1, (object)(CompiledModelTestBase.AnEnum)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.AnEnum)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.AnEnum)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.AnEnum)v : default(Nullable)), clrType: typeof(CompiledModelTestBase.AnEnum), jsonValueReaderWriter: JsonSignedEnumReaderWriter.Instance); @@ -229,15 +229,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas flagsEnum1.TypeMapping = InMemoryTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.AFlagsEnum v1, CompiledModelTestBase.AFlagsEnum v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.AFlagsEnum v) => v.GetHashCode(), + (CompiledModelTestBase.AFlagsEnum v) => ((object)v).GetHashCode(), (CompiledModelTestBase.AFlagsEnum v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.AFlagsEnum v1, CompiledModelTestBase.AFlagsEnum v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.AFlagsEnum v) => v.GetHashCode(), + (CompiledModelTestBase.AFlagsEnum v) => ((object)v).GetHashCode(), (CompiledModelTestBase.AFlagsEnum v) => v), providerValueComparer: new ValueComparer( (CompiledModelTestBase.AFlagsEnum v1, CompiledModelTestBase.AFlagsEnum v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.AFlagsEnum v) => v.GetHashCode(), + (CompiledModelTestBase.AFlagsEnum v) => ((object)v).GetHashCode(), (CompiledModelTestBase.AFlagsEnum v) => v), clrType: typeof(CompiledModelTestBase.AFlagsEnum), jsonValueReaderWriter: JsonSignedEnumReaderWriter.Instance); @@ -257,15 +257,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas principalId.TypeMapping = InMemoryTypeMapping.Default.Clone( comparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), keyComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), clrType: typeof(long), jsonValueReaderWriter: JsonInt64ReaderWriter.Instance); @@ -299,50 +299,50 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas relationshipIndex: -1, storeGenerationIndex: -1); refTypeArray.TypeMapping = InMemoryTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfReferenceTypesComparer(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)))), elementMapping: InMemoryTypeMapping.Default.Clone( comparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), keyComparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), converter: new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))); refTypeArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("PrincipalBaseEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalBase_RefTypeArray", "TestNamespace") }); @@ -374,34 +374,34 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas relationshipIndex: -1, storeGenerationIndex: -1); refTypeEnumerable.TypeMapping = InMemoryTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfReferenceTypesComparer, string>(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfReferenceTypesComparer, string>(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, string>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter, string>( JsonStringReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, string>( + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter, string>( JsonStringReaderWriter.Instance), elementMapping: InMemoryTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), clrType: typeof(string), jsonValueReaderWriter: JsonStringReaderWriter.Instance)); @@ -435,34 +435,34 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas relationshipIndex: -1, storeGenerationIndex: -1); refTypeIList.TypeMapping = InMemoryTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfReferenceTypesComparer, string>(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfReferenceTypesComparer, string>(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, string>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter, string>( JsonStringReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, string>( + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter, string>( JsonStringReaderWriter.Instance), elementMapping: InMemoryTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), clrType: typeof(string), jsonValueReaderWriter: JsonStringReaderWriter.Instance)); @@ -496,50 +496,50 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas relationshipIndex: -1, storeGenerationIndex: -1); refTypeList.TypeMapping = InMemoryTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfReferenceTypesComparer, IPAddress>(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfReferenceTypesComparer, IPAddress>(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, IPAddress>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter, IPAddress>( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, IPAddress>( + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter, IPAddress>( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)))), elementMapping: InMemoryTypeMapping.Default.Clone( comparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), keyComparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), converter: new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))); refTypeList.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("PrincipalBaseEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalBase_RefTypeList", "TestNamespace") }); @@ -571,34 +571,34 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas relationshipIndex: -1, storeGenerationIndex: -1); valueTypeArray.TypeMapping = InMemoryTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer(new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer(new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( JsonDateTimeReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( JsonDateTimeReaderWriter.Instance), elementMapping: InMemoryTypeMapping.Default.Clone( comparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v), keyComparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v), providerValueComparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v), clrType: typeof(DateTime), jsonValueReaderWriter: JsonDateTimeReaderWriter.Instance)); @@ -632,21 +632,21 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas relationshipIndex: -1, storeGenerationIndex: -1); valueTypeEnumerable.TypeMapping = InMemoryTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer, byte>(new ValueComparer( (byte v1, byte v2) => v1 == v2, (byte v) => (int)v, (byte v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer, byte>(new ValueComparer( (byte v1, byte v2) => v1 == v2, (byte v) => (int)v, (byte v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, byte>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter, byte>( JsonByteReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, byte>( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, byte>( JsonByteReaderWriter.Instance), elementMapping: InMemoryTypeMapping.Default.Clone( comparer: new ValueComparer( @@ -693,21 +693,21 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas relationshipIndex: -1, storeGenerationIndex: -1); valueTypeIList.TypeMapping = InMemoryTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer, byte>(new ValueComparer( (byte v1, byte v2) => v1 == v2, (byte v) => (int)v, (byte v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer, byte>(new ValueComparer( (byte v1, byte v2) => v1 == v2, (byte v) => (int)v, (byte v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, byte>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter, byte>( JsonByteReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, byte>( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, byte>( JsonByteReaderWriter.Instance), elementMapping: InMemoryTypeMapping.Default.Clone( comparer: new ValueComparer( @@ -754,21 +754,21 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas relationshipIndex: -1, storeGenerationIndex: -1); valueTypeList.TypeMapping = InMemoryTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer, short>(new ValueComparer( (short v1, short v2) => v1 == v2, (short v) => (int)v, (short v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer, short>(new ValueComparer( (short v1, short v2) => v1 == v2, (short v) => (int)v, (short v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, short>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter, short>( JsonInt16ReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, short>( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, short>( JsonInt16ReaderWriter.Instance), elementMapping: InMemoryTypeMapping.Default.Clone( comparer: new ValueComparer( @@ -830,10 +830,10 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (CompiledModelTestBase.PrincipalBase)source.Entity; - return (ISnapshot)new Snapshot, string, CompiledModelTestBase.AnEnum, Nullable, CompiledModelTestBase.AFlagsEnum, long, IPAddress[], IEnumerable, IList, List, DateTime[], IEnumerable, IList, List>(source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)id.GetValueComparer()).Snapshot(source.GetCurrentValue>(id)), source.GetCurrentValue(discriminator) == null ? null : ((ValueComparer)discriminator.GetValueComparer()).Snapshot(source.GetCurrentValue(discriminator)), ((ValueComparer)enum1.GetValueComparer()).Snapshot(source.GetCurrentValue(enum1)), source.GetCurrentValue>(enum2) == null ? null : ((ValueComparer>)enum2.GetValueComparer()).Snapshot(source.GetCurrentValue>(enum2)), ((ValueComparer)flagsEnum1.GetValueComparer()).Snapshot(source.GetCurrentValue(flagsEnum1)), ((ValueComparer)principalId.GetValueComparer()).Snapshot(source.GetCurrentValue(principalId)), (IEnumerable)source.GetCurrentValue(refTypeArray) == null ? null : (IPAddress[])((ValueComparer>)refTypeArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(refTypeArray)), source.GetCurrentValue>(refTypeEnumerable) == null ? null : ((ValueComparer>)refTypeEnumerable.GetValueComparer()).Snapshot(source.GetCurrentValue>(refTypeEnumerable)), (IEnumerable)source.GetCurrentValue>(refTypeIList) == null ? null : (IList)((ValueComparer>)refTypeIList.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(refTypeIList)), (IEnumerable)source.GetCurrentValue>(refTypeList) == null ? null : (List)((ValueComparer>)refTypeList.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(refTypeList)), (IEnumerable)source.GetCurrentValue(valueTypeArray) == null ? null : (DateTime[])((ValueComparer>)valueTypeArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(valueTypeArray)), source.GetCurrentValue>(valueTypeEnumerable) == null ? null : ((ValueComparer>)valueTypeEnumerable.GetValueComparer()).Snapshot(source.GetCurrentValue>(valueTypeEnumerable)), (IEnumerable)source.GetCurrentValue>(valueTypeIList) == null ? null : (IList)((ValueComparer>)valueTypeIList.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeIList)), (IEnumerable)source.GetCurrentValue>(valueTypeList) == null ? null : (List)((ValueComparer>)valueTypeList.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeList))); + return (ISnapshot)new Snapshot, string, CompiledModelTestBase.AnEnum, Nullable, CompiledModelTestBase.AFlagsEnum, long, IPAddress[], IEnumerable, IList, List, DateTime[], IEnumerable, IList, List>(source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)((IProperty)id).GetValueComparer()).Snapshot(source.GetCurrentValue>(id)), source.GetCurrentValue(discriminator) == null ? null : ((ValueComparer)((IProperty)discriminator).GetValueComparer()).Snapshot(source.GetCurrentValue(discriminator)), ((ValueComparer)((IProperty)enum1).GetValueComparer()).Snapshot(source.GetCurrentValue(enum1)), source.GetCurrentValue>(enum2) == null ? null : ((ValueComparer>)((IProperty)enum2).GetValueComparer()).Snapshot(source.GetCurrentValue>(enum2)), ((ValueComparer)((IProperty)flagsEnum1).GetValueComparer()).Snapshot(source.GetCurrentValue(flagsEnum1)), ((ValueComparer)((IProperty)principalId).GetValueComparer()).Snapshot(source.GetCurrentValue(principalId)), (object)source.GetCurrentValue(refTypeArray) == null ? null : (IPAddress[])((ValueComparer)((IProperty)refTypeArray).GetValueComparer()).Snapshot((object)source.GetCurrentValue(refTypeArray)), (object)source.GetCurrentValue>(refTypeEnumerable) == null ? null : (IEnumerable)((ValueComparer)((IProperty)refTypeEnumerable).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeEnumerable)), (object)source.GetCurrentValue>(refTypeIList) == null ? null : (IList)((ValueComparer)((IProperty)refTypeIList).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeIList)), (object)source.GetCurrentValue>(refTypeList) == null ? null : (List)((ValueComparer)((IProperty)refTypeList).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeList)), (IEnumerable)source.GetCurrentValue(valueTypeArray) == null ? null : (DateTime[])((ValueComparer>)((IProperty)valueTypeArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(valueTypeArray)), source.GetCurrentValue>(valueTypeEnumerable) == null ? null : ((ValueComparer>)((IProperty)valueTypeEnumerable).GetValueComparer()).Snapshot(source.GetCurrentValue>(valueTypeEnumerable)), (IEnumerable)source.GetCurrentValue>(valueTypeIList) == null ? null : (IList)((ValueComparer>)((IProperty)valueTypeIList).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeIList)), (IEnumerable)source.GetCurrentValue>(valueTypeList) == null ? null : (List)((ValueComparer>)((IProperty)valueTypeList).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeList))); }); runtimeEntityType.SetStoreGeneratedValuesFactory( - () => (ISnapshot)new Snapshot, long>(default(Nullable) == null ? null : ((ValueComparer>)id.GetValueComparer()).Snapshot(default(Nullable)), ((ValueComparer)principalId.GetValueComparer()).Snapshot(default(long)))); + () => (ISnapshot)new Snapshot, long>(default(Nullable) == null ? null : ((ValueComparer>)((IProperty)id).GetValueComparer()).Snapshot(default(Nullable)), ((ValueComparer)((IProperty)principalId).GetValueComparer()).Snapshot(default(long)))); runtimeEntityType.SetTemporaryValuesFactory( (InternalEntityEntry source) => (ISnapshot)new Snapshot, long>(default(Nullable), default(long))); runtimeEntityType.SetShadowValuesFactory( @@ -844,7 +844,7 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (CompiledModelTestBase.PrincipalBase)source.Entity; - return (ISnapshot)new Snapshot, long, object>(source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)id.GetKeyValueComparer()).Snapshot(source.GetCurrentValue>(id)), ((ValueComparer)principalId.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalId)), SnapshotFactoryFactory.SnapshotCollection(UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalBase_Deriveds(entity))); + return (ISnapshot)new Snapshot, long, object>(source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)((IProperty)id).GetKeyValueComparer()).Snapshot(source.GetCurrentValue>(id)), ((ValueComparer)((IProperty)principalId).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalId)), SnapshotFactoryFactory.SnapshotCollection(UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalBase_Deriveds(entity))); }); runtimeEntityType.Counts = new PropertyCounts( propertyCount: 14, diff --git a/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/RelationshipCycles/PrincipalDerivedEntityType.cs b/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/RelationshipCycles/PrincipalDerivedEntityType.cs index 40f0d864eb3..db29b1d44c4 100644 --- a/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/RelationshipCycles/PrincipalDerivedEntityType.cs +++ b/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/RelationshipCycles/PrincipalDerivedEntityType.cs @@ -103,10 +103,10 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (CompiledModelTestBase.PrincipalDerived>>)source.Entity; - return (ISnapshot)new Snapshot, string, CompiledModelTestBase.AnEnum, Nullable, CompiledModelTestBase.AFlagsEnum, long, IPAddress[], IEnumerable, IList, List, DateTime[], IEnumerable, IList, List>(source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)id.GetValueComparer()).Snapshot(source.GetCurrentValue>(id)), source.GetCurrentValue(discriminator) == null ? null : ((ValueComparer)discriminator.GetValueComparer()).Snapshot(source.GetCurrentValue(discriminator)), ((ValueComparer)enum1.GetValueComparer()).Snapshot(source.GetCurrentValue(enum1)), source.GetCurrentValue>(enum2) == null ? null : ((ValueComparer>)enum2.GetValueComparer()).Snapshot(source.GetCurrentValue>(enum2)), ((ValueComparer)flagsEnum1.GetValueComparer()).Snapshot(source.GetCurrentValue(flagsEnum1)), ((ValueComparer)principalId.GetValueComparer()).Snapshot(source.GetCurrentValue(principalId)), (IEnumerable)source.GetCurrentValue(refTypeArray) == null ? null : (IPAddress[])((ValueComparer>)refTypeArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(refTypeArray)), source.GetCurrentValue>(refTypeEnumerable) == null ? null : ((ValueComparer>)refTypeEnumerable.GetValueComparer()).Snapshot(source.GetCurrentValue>(refTypeEnumerable)), (IEnumerable)source.GetCurrentValue>(refTypeIList) == null ? null : (IList)((ValueComparer>)refTypeIList.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(refTypeIList)), (IEnumerable)source.GetCurrentValue>(refTypeList) == null ? null : (List)((ValueComparer>)refTypeList.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(refTypeList)), (IEnumerable)source.GetCurrentValue(valueTypeArray) == null ? null : (DateTime[])((ValueComparer>)valueTypeArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(valueTypeArray)), source.GetCurrentValue>(valueTypeEnumerable) == null ? null : ((ValueComparer>)valueTypeEnumerable.GetValueComparer()).Snapshot(source.GetCurrentValue>(valueTypeEnumerable)), (IEnumerable)source.GetCurrentValue>(valueTypeIList) == null ? null : (IList)((ValueComparer>)valueTypeIList.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeIList)), (IEnumerable)source.GetCurrentValue>(valueTypeList) == null ? null : (List)((ValueComparer>)valueTypeList.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeList))); + return (ISnapshot)new Snapshot, string, CompiledModelTestBase.AnEnum, Nullable, CompiledModelTestBase.AFlagsEnum, long, IPAddress[], IEnumerable, IList, List, DateTime[], IEnumerable, IList, List>(source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)((IProperty)id).GetValueComparer()).Snapshot(source.GetCurrentValue>(id)), source.GetCurrentValue(discriminator) == null ? null : ((ValueComparer)((IProperty)discriminator).GetValueComparer()).Snapshot(source.GetCurrentValue(discriminator)), ((ValueComparer)((IProperty)enum1).GetValueComparer()).Snapshot(source.GetCurrentValue(enum1)), source.GetCurrentValue>(enum2) == null ? null : ((ValueComparer>)((IProperty)enum2).GetValueComparer()).Snapshot(source.GetCurrentValue>(enum2)), ((ValueComparer)((IProperty)flagsEnum1).GetValueComparer()).Snapshot(source.GetCurrentValue(flagsEnum1)), ((ValueComparer)((IProperty)principalId).GetValueComparer()).Snapshot(source.GetCurrentValue(principalId)), (object)source.GetCurrentValue(refTypeArray) == null ? null : (IPAddress[])((ValueComparer)((IProperty)refTypeArray).GetValueComparer()).Snapshot((object)source.GetCurrentValue(refTypeArray)), (object)source.GetCurrentValue>(refTypeEnumerable) == null ? null : (IEnumerable)((ValueComparer)((IProperty)refTypeEnumerable).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeEnumerable)), (object)source.GetCurrentValue>(refTypeIList) == null ? null : (IList)((ValueComparer)((IProperty)refTypeIList).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeIList)), (object)source.GetCurrentValue>(refTypeList) == null ? null : (List)((ValueComparer)((IProperty)refTypeList).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeList)), (IEnumerable)source.GetCurrentValue(valueTypeArray) == null ? null : (DateTime[])((ValueComparer>)((IProperty)valueTypeArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(valueTypeArray)), source.GetCurrentValue>(valueTypeEnumerable) == null ? null : ((ValueComparer>)((IProperty)valueTypeEnumerable).GetValueComparer()).Snapshot(source.GetCurrentValue>(valueTypeEnumerable)), (IEnumerable)source.GetCurrentValue>(valueTypeIList) == null ? null : (IList)((ValueComparer>)((IProperty)valueTypeIList).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeIList)), (IEnumerable)source.GetCurrentValue>(valueTypeList) == null ? null : (List)((ValueComparer>)((IProperty)valueTypeList).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeList))); }); runtimeEntityType.SetStoreGeneratedValuesFactory( - () => (ISnapshot)new Snapshot, long>(default(Nullable) == null ? null : ((ValueComparer>)id.GetValueComparer()).Snapshot(default(Nullable)), ((ValueComparer)principalId.GetValueComparer()).Snapshot(default(long)))); + () => (ISnapshot)new Snapshot, long>(default(Nullable) == null ? null : ((ValueComparer>)((IProperty)id).GetValueComparer()).Snapshot(default(Nullable)), ((ValueComparer)((IProperty)principalId).GetValueComparer()).Snapshot(default(long)))); runtimeEntityType.SetTemporaryValuesFactory( (InternalEntityEntry source) => (ISnapshot)new Snapshot, long>(default(Nullable), default(long))); runtimeEntityType.SetShadowValuesFactory( @@ -117,7 +117,7 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (CompiledModelTestBase.PrincipalDerived>>)source.Entity; - return (ISnapshot)new Snapshot, long, object, object>(source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)id.GetKeyValueComparer()).Snapshot(source.GetCurrentValue>(id)), ((ValueComparer)principalId.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalId)), SnapshotFactoryFactory.SnapshotCollection(PrincipalBaseEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalBase_Deriveds(entity)), UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalDerived1_Dependent(entity)); + return (ISnapshot)new Snapshot, long, object, object>(source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)((IProperty)id).GetKeyValueComparer()).Snapshot(source.GetCurrentValue>(id)), ((ValueComparer)((IProperty)principalId).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalId)), SnapshotFactoryFactory.SnapshotCollection(PrincipalBaseEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalBase_Deriveds(entity)), UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalDerived1_Dependent(entity)); }); runtimeEntityType.Counts = new PropertyCounts( propertyCount: 14, diff --git a/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/Self_referential_property/SelfReferentialEntityEntityType.cs b/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/Self_referential_property/SelfReferentialEntityEntityType.cs index f1fba782093..57a3c789466 100644 --- a/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/Self_referential_property/SelfReferentialEntityEntityType.cs +++ b/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/Self_referential_property/SelfReferentialEntityEntityType.cs @@ -63,15 +63,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas id.TypeMapping = InMemoryTypeMapping.Default.Clone( comparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), keyComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), clrType: typeof(long), jsonValueReaderWriter: JsonInt64ReaderWriter.Instance); @@ -109,15 +109,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas collection.TypeMapping = InMemoryTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelInMemoryTest.SelfReferentialProperty v1, CompiledModelInMemoryTest.SelfReferentialProperty v2) => object.Equals(v1, v2), - (CompiledModelInMemoryTest.SelfReferentialProperty v) => v.GetHashCode(), + (CompiledModelInMemoryTest.SelfReferentialProperty v) => ((object)v).GetHashCode(), (CompiledModelInMemoryTest.SelfReferentialProperty v) => v), keyComparer: new ValueComparer( (CompiledModelInMemoryTest.SelfReferentialProperty v1, CompiledModelInMemoryTest.SelfReferentialProperty v2) => object.Equals(v1, v2), - (CompiledModelInMemoryTest.SelfReferentialProperty v) => v.GetHashCode(), + (CompiledModelInMemoryTest.SelfReferentialProperty v) => ((object)v).GetHashCode(), (CompiledModelInMemoryTest.SelfReferentialProperty v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), converter: new ValueConverter( (CompiledModelInMemoryTest.SelfReferentialProperty v) => null, @@ -144,10 +144,10 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (CompiledModelInMemoryTest.SelfReferentialEntity)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)id.GetValueComparer()).Snapshot(source.GetCurrentValue(id)), source.GetCurrentValue(collection) == null ? null : ((ValueComparer)collection.GetValueComparer()).Snapshot(source.GetCurrentValue(collection))); + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetValueComparer()).Snapshot(source.GetCurrentValue(id)), source.GetCurrentValue(collection) == null ? null : ((ValueComparer)((IProperty)collection).GetValueComparer()).Snapshot(source.GetCurrentValue(collection))); }); runtimeEntityType.SetStoreGeneratedValuesFactory( - () => (ISnapshot)new Snapshot(((ValueComparer)id.GetValueComparer()).Snapshot(default(long)))); + () => (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetValueComparer()).Snapshot(default(long)))); runtimeEntityType.SetTemporaryValuesFactory( (InternalEntityEntry source) => (ISnapshot)new Snapshot(default(long))); runtimeEntityType.SetShadowValuesFactory( @@ -158,7 +158,7 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (CompiledModelInMemoryTest.SelfReferentialEntity)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)id.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(id))); + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(id))); }); runtimeEntityType.Counts = new PropertyCounts( propertyCount: 2, diff --git a/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/SimpleModel/DependentDerivedEntityType.cs b/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/SimpleModel/DependentDerivedEntityType.cs index 4bea3f2a372..980fe56d8d3 100644 --- a/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/SimpleModel/DependentDerivedEntityType.cs +++ b/test/EFCore.InMemory.FunctionalTests/Scaffolding/Baselines/SimpleModel/DependentDerivedEntityType.cs @@ -106,15 +106,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas data.TypeMapping = InMemoryTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), clrType: typeof(string), jsonValueReaderWriter: JsonStringReaderWriter.Instance); @@ -135,7 +135,7 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (CompiledModelTestBase.DependentDerived)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)id.GetValueComparer()).Snapshot(source.GetCurrentValue(id)), source.GetCurrentValue(data) == null ? null : ((ValueComparer)data.GetValueComparer()).Snapshot(source.GetCurrentValue(data))); + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetValueComparer()).Snapshot(source.GetCurrentValue(id)), source.GetCurrentValue(data) == null ? null : ((ValueComparer)((IProperty)data).GetValueComparer()).Snapshot(source.GetCurrentValue(data))); }); runtimeEntityType.SetStoreGeneratedValuesFactory( () => Snapshot.Empty); @@ -149,7 +149,7 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (CompiledModelTestBase.DependentDerived)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)id.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(id))); + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(id))); }); runtimeEntityType.Counts = new PropertyCounts( propertyCount: 2, diff --git a/test/EFCore.InMemory.FunctionalTests/Scaffolding/CompiledModelInMemoryTest.cs b/test/EFCore.InMemory.FunctionalTests/Scaffolding/CompiledModelInMemoryTest.cs index 98af85621da..4639f3f9600 100644 --- a/test/EFCore.InMemory.FunctionalTests/Scaffolding/CompiledModelInMemoryTest.cs +++ b/test/EFCore.InMemory.FunctionalTests/Scaffolding/CompiledModelInMemoryTest.cs @@ -19,7 +19,7 @@ namespace Microsoft.EntityFrameworkCore.Scaffolding public class CompiledModelInMemoryTest : CompiledModelTestBase { [ConditionalFact] - public virtual void Empty_model() + public virtual Task Empty_model() => Test( modelBuilder => { }, model => @@ -75,7 +75,7 @@ public class SelfReferentialEntity public class SelfReferentialProperty : List; [ConditionalFact] - public virtual void Throws_for_constructor_binding() + public virtual Task Throws_for_constructor_binding() => Test( modelBuilder => modelBuilder.Entity( "Lazy", e => @@ -89,7 +89,7 @@ public virtual void Throws_for_constructor_binding() expectedExceptionMessage: DesignStrings.CompiledModelConstructorBinding("Lazy", "Customize()", "LazyEntityType")); [ConditionalFact] - public virtual void Manual_lazy_loading() + public virtual Task Manual_lazy_loading() => Test( modelBuilder => { modelBuilder.Entity(); @@ -154,7 +154,7 @@ public class LazyPropertyDelegateEntity } [ConditionalFact] - public virtual void Lazy_loading_proxies() + public virtual Task Lazy_loading_proxies() => Test( modelBuilder => modelBuilder.Entity(), model => @@ -186,7 +186,7 @@ public virtual void Lazy_loading_proxies() services => services.AddEntityFrameworkProxies()); [ConditionalFact] - public virtual void Lazy_loading_manual() + public virtual Task Lazy_loading_manual() => Test( b => { @@ -285,7 +285,7 @@ public virtual LazyProxiesEntity3 ReferenceNavigation } [ConditionalFact] - public virtual void Throws_for_query_filter() + public virtual Task Throws_for_query_filter() => Test( modelBuilder => modelBuilder.Entity( "QueryFilter", e => @@ -318,7 +318,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) } [ConditionalFact] - public virtual void Throws_for_value_generator() + public virtual Task Throws_for_value_generator() => Test( modelBuilder => modelBuilder.Entity("MyEntity", e => { @@ -329,7 +329,7 @@ public virtual void Throws_for_value_generator() "MyEntity", "Id", nameof(PropertyBuilder.HasValueGeneratorFactory))); [ConditionalFact] - public virtual void Custom_value_converter() + public virtual Task Custom_value_converter() => Test( modelBuilder => modelBuilder.Entity("MyEntity", e => { @@ -345,7 +345,7 @@ public virtual void Custom_value_converter() }); [ConditionalFact] - public virtual void Custom_value_comparer() + public virtual Task Custom_value_comparer() => Test( modelBuilder => modelBuilder.Entity("MyEntity", e => { @@ -383,7 +383,7 @@ public override object Snapshot(object? instance) } [ConditionalFact] - public virtual void Custom_provider_value_comparer() + public virtual Task Custom_provider_value_comparer() => Test( modelBuilder => modelBuilder.Entity("MyEntity", e => { @@ -402,7 +402,7 @@ is Expression> lambda }); [ConditionalFact] - public virtual void Custom_type_mapping() + public virtual Task Custom_type_mapping() => Test( modelBuilder => modelBuilder.Entity("MyEntity", e => { @@ -441,7 +441,7 @@ public virtual Task Fully_qualified_model() addDesignTimeServices: services => services.AddSingleton()); [ConditionalFact] - public virtual void RelationshipCycles() + public virtual Task RelationshipCycles() => Test( BuildCyclesModel, AssertCyclesModel, @@ -494,9 +494,8 @@ protected virtual void AssertCyclesModel(IModel model) } // Primitive collections not supported completely - public override void BigModel() - { - } + public override Task BigModel() + => Task.CompletedTask; public class Scaffolding { @@ -512,9 +511,6 @@ public class IdentityUser : TestModels.AspNetIdentity.IdentityUser; private class FullyQualifiedCSharpHelper(ITypeMappingSource typeMappingSource) : CSharpHelper(typeMappingSource) { - protected override bool ShouldUseFullName(Type type) - => base.ShouldUseFullName(type); - protected override bool ShouldUseFullName(string shortTypeName) => base.ShouldUseFullName(shortTypeName) || shortTypeName is nameof(System.Index) or nameof(Internal); } diff --git a/test/EFCore.Relational.Specification.Tests/Scaffolding/CompiledModelRelationalTestBase.cs b/test/EFCore.Relational.Specification.Tests/Scaffolding/CompiledModelRelationalTestBase.cs index 20a8dc1c828..182f3f9e906 100644 --- a/test/EFCore.Relational.Specification.Tests/Scaffolding/CompiledModelRelationalTestBase.cs +++ b/test/EFCore.Relational.Specification.Tests/Scaffolding/CompiledModelRelationalTestBase.cs @@ -12,7 +12,7 @@ namespace Microsoft.EntityFrameworkCore.Scaffolding; public abstract class CompiledModelRelationalTestBase : CompiledModelTestBase { [ConditionalFact] - public virtual void BigModel_with_JSON_columns() + public virtual Task BigModel_with_JSON_columns() => Test( modelBuilder => BuildBigModel(modelBuilder, jsonColumns: true), model => AssertBigModel(model, jsonColumns: true), @@ -451,7 +451,7 @@ protected override void AssertComplexTypes(IModel model) } [ConditionalFact] - public virtual void Tpc_Sprocs() + public virtual Task Tpc_Sprocs() => Test( BuildTpcSprocsModel, AssertTpcSprocs, @@ -847,7 +847,7 @@ protected virtual void AssertTpcSprocs(IModel model) } [ConditionalFact] - public virtual void Sequences() + public virtual Task Sequences() => Test( modelBuilder => modelBuilder.HasSequence("Long") @@ -872,7 +872,7 @@ public virtual void Sequences() }); [ConditionalFact] - public virtual void CheckConstraints() + public virtual Task CheckConstraints() => Test( modelBuilder => modelBuilder.Entity( eb => @@ -893,7 +893,7 @@ public virtual void CheckConstraints() }); [ConditionalFact] - public virtual void Triggers() + public virtual Task Triggers() => Test( modelBuilder => modelBuilder.Entity( eb => @@ -1209,7 +1209,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) } [ConditionalFact] - public virtual void Dynamic_schema() + public virtual Task Dynamic_schema() => Test( modelBuilder => modelBuilder.Entity( eb => diff --git a/test/EFCore.Specification.Tests/MaterializationInterceptionTestBase.cs b/test/EFCore.Specification.Tests/MaterializationInterceptionTestBase.cs index d40ab02d102..9f0b1f44c07 100644 --- a/test/EFCore.Specification.Tests/MaterializationInterceptionTestBase.cs +++ b/test/EFCore.Specification.Tests/MaterializationInterceptionTestBase.cs @@ -217,7 +217,7 @@ public virtual async Task Intercept_query_materialization_with_owned_types(bool new TestEntity30244 { Id = _id++, - Name = "TestIssue", + Title = "TestIssue", Settings = { new KeyValueSetting30244("Value1", "1"), new KeyValueSetting30244("Value2", "9") } }); @@ -305,7 +305,7 @@ public virtual async Task Intercept_query_materialization_with_owned_types_proje new TestEntity30244 { Id = _id++, - Name = "TestIssue", + Title = "TestIssue", Settings = { new KeyValueSetting30244("Value1", "1"), new KeyValueSetting30244("Value2", "9") } }); diff --git a/test/EFCore.Specification.Tests/ModelBuilding/ModelBuilderTest.ComplexType.cs b/test/EFCore.Specification.Tests/ModelBuilding/ModelBuilderTest.ComplexType.cs index 0cfd9b9ad97..1f189d46531 100644 --- a/test/EFCore.Specification.Tests/ModelBuilding/ModelBuilderTest.ComplexType.cs +++ b/test/EFCore.Specification.Tests/ModelBuilding/ModelBuilderTest.ComplexType.cs @@ -26,6 +26,7 @@ public virtual void Can_set_complex_property_annotation() .HasTypeAnnotation("foo", "bar") .HasPropertyAnnotation("foo2", "bar2") .Ignore(c => c.Details) + .Ignore(c => c.Title) .Ignore(c => c.Orders); var model = modelBuilder.FinalizeModel(); @@ -1726,6 +1727,7 @@ protected virtual void Mapping_throws_for_empty_complex_types() .ComplexProperty(e => e.Customer) .Ignore(c => c.Notes) .Ignore(c => c.Name) + .Ignore(c => c.Title) .Ignore(c => c.Id) .Ignore(c => c.AlternateKey); diff --git a/test/EFCore.Specification.Tests/ModelBuilding/ModelBuilderTest.TestModel.cs b/test/EFCore.Specification.Tests/ModelBuilding/ModelBuilderTest.TestModel.cs index b0a7a413e47..83cd5ea7374 100644 --- a/test/EFCore.Specification.Tests/ModelBuilding/ModelBuilderTest.TestModel.cs +++ b/test/EFCore.Specification.Tests/ModelBuilding/ModelBuilderTest.TestModel.cs @@ -87,6 +87,7 @@ protected class Customer public int Id { get; set; } public Guid AlternateKey { get; set; } public string? Name { get; set; } + public string Title { get; set; } = null!; public IEnumerable? Orders { get; set; } diff --git a/test/EFCore.Specification.Tests/Scaffolding/CompiledModelTestBase.cs b/test/EFCore.Specification.Tests/Scaffolding/CompiledModelTestBase.cs index 6f8c9892551..f924280e959 100644 --- a/test/EFCore.Specification.Tests/Scaffolding/CompiledModelTestBase.cs +++ b/test/EFCore.Specification.Tests/Scaffolding/CompiledModelTestBase.cs @@ -18,7 +18,7 @@ namespace Microsoft.EntityFrameworkCore.Scaffolding; public abstract class CompiledModelTestBase : NonSharedModelTestBase { [ConditionalFact] - public virtual void SimpleModel() + public virtual Task SimpleModel() => Test( modelBuilder => { @@ -80,7 +80,7 @@ public static class Dummy }); [ConditionalFact] - public virtual void BigModel() + public virtual Task BigModel() => Test( modelBuilder => BuildBigModel(modelBuilder, jsonColumns: false), model => AssertBigModel(model, jsonColumns: false), @@ -580,7 +580,7 @@ protected virtual void AssertBigModel(IModel model, bool jsonColumns) } [ConditionalFact] - public virtual void ComplexTypes() + public virtual Task ComplexTypes() => Test( BuildComplexTypesModel, AssertComplexTypes, diff --git a/test/EFCore.Specification.Tests/SingletonInterceptorsTestBase.cs b/test/EFCore.Specification.Tests/SingletonInterceptorsTestBase.cs index d8bdc9450ef..b142ef32e71 100644 --- a/test/EFCore.Specification.Tests/SingletonInterceptorsTestBase.cs +++ b/test/EFCore.Specification.Tests/SingletonInterceptorsTestBase.cs @@ -37,7 +37,7 @@ public class TestEntity30244 [DatabaseGenerated((DatabaseGeneratedOption.None))] public int Id { get; set; } - public string? Name { get; set; } + public string? Title { get; set; } public List Settings { get; } = []; } diff --git a/test/EFCore.Specification.Tests/TestUtilities/TestAnnotationComparer.cs b/test/EFCore.Specification.Tests/TestUtilities/TestAnnotationComparer.cs index d1b15aaa8a0..12fc99b8c49 100644 --- a/test/EFCore.Specification.Tests/TestUtilities/TestAnnotationComparer.cs +++ b/test/EFCore.Specification.Tests/TestUtilities/TestAnnotationComparer.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Collections; using Microsoft.EntityFrameworkCore.Metadata.Internal; // ReSharper disable PossibleNullReferenceException @@ -30,11 +31,34 @@ public bool Equals(IAnnotation? x, IAnnotation? y) return y == null; } - return y == null - ? false - : x.Name == y.Name + return y != null && (x.Name == y.Name && (x.Name == CoreAnnotationNames.ValueGeneratorFactory - || Equals(x.Value, y.Value)); + || CompareAnnotations())); + + bool CompareAnnotations() + { + if (x.Value is not string + && x.Value is IList xList + && y.Value is IList yList) + { + if (xList.Count != yList.Count) + { + return false; + } + + for (int i = 0; i < xList.Count; i++) + { + if (!Equals(xList[i], yList[i])) + { + return false; + } + } + + return true; + } + + return Equals(x.Value, y.Value); + } } public int GetHashCode(IAnnotation obj) diff --git a/test/EFCore.SqlServer.FunctionalTests/ModelBuilding/SqlServerModelBuilderTestBase.cs b/test/EFCore.SqlServer.FunctionalTests/ModelBuilding/SqlServerModelBuilderTestBase.cs index 1407c546fe5..9a72bfb9706 100644 --- a/test/EFCore.SqlServer.FunctionalTests/ModelBuilding/SqlServerModelBuilderTestBase.cs +++ b/test/EFCore.SqlServer.FunctionalTests/ModelBuilding/SqlServerModelBuilderTestBase.cs @@ -1241,7 +1241,7 @@ public virtual void Temporal_table_with_history_table_configuration() var entity = model.FindEntityType(typeof(Customer))!; Assert.True(entity.IsTemporal()); - Assert.Equal(6, entity.GetProperties().Count()); + Assert.Equal(7, entity.GetProperties().Count()); Assert.Equal("HistoryTable", entity.GetHistoryTableName()); Assert.Equal("historySchema", entity.GetHistoryTableSchema()); @@ -1290,7 +1290,7 @@ public virtual void Temporal_table_with_changed_configuration() var entity = model.FindEntityType(typeof(Customer))!; Assert.True(entity.IsTemporal()); - Assert.Equal(6, entity.GetProperties().Count()); + Assert.Equal(7, entity.GetProperties().Count()); Assert.Equal("ChangedHistoryTable", entity.GetHistoryTableName()); Assert.Equal("changedHistorySchema", entity.GetHistoryTableSchema()); @@ -1339,7 +1339,7 @@ public virtual void Temporal_table_with_period_column_names_changed_configuratio var entity = model.FindEntityType(typeof(Customer))!; Assert.True(entity.IsTemporal()); - Assert.Equal(6, entity.GetProperties().Count()); + Assert.Equal(7, entity.GetProperties().Count()); Assert.Equal("ChangedHistoryTable", entity.GetHistoryTableName()); Assert.Equal("changedHistorySchema", entity.GetHistoryTableSchema()); @@ -1389,7 +1389,7 @@ public virtual void Temporal_table_with_explicit_properties_mapped_to_the_period var entity = model.FindEntityType(typeof(Customer))!; Assert.True(entity.IsTemporal()); - Assert.Equal(6, entity.GetProperties().Count()); + Assert.Equal(7, entity.GetProperties().Count()); Assert.Equal("HistoryTable", entity.GetHistoryTableName()); @@ -1437,7 +1437,7 @@ public virtual void var entity = model.FindEntityType(typeof(Customer))!; Assert.True(entity.IsTemporal()); - Assert.Equal(8, entity.GetProperties().Count()); + Assert.Equal(9, entity.GetProperties().Count()); Assert.Equal("HistoryTable", entity.GetHistoryTableName()); @@ -1480,7 +1480,7 @@ public virtual void Switching_from_temporal_to_non_temporal_default_settings() Assert.False(entity.IsTemporal()); Assert.Null(entity.GetPeriodStartPropertyName()); Assert.Null(entity.GetPeriodEndPropertyName()); - Assert.Equal(4, entity.GetProperties().Count()); + Assert.Equal(5, entity.GetProperties().Count()); } [ConditionalFact] diff --git a/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/BigModel/DependentBaseEntityType.cs b/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/BigModel/DependentBaseEntityType.cs index 797d42daf95..a51f4bf5b7e 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/BigModel/DependentBaseEntityType.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/BigModel/DependentBaseEntityType.cs @@ -53,15 +53,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas principalId.TypeMapping = SqlServerLongTypeMapping.Default.Clone( comparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), keyComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v)); principalId.SetCurrentValueComparer(new EntryCurrentValueComparer(principalId)); principalId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); @@ -80,15 +80,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas principalAlternateId.TypeMapping = GuidTypeMapping.Default.Clone( comparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), keyComparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), providerValueComparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "uniqueidentifier")); @@ -109,11 +109,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumDiscriminator.TypeMapping = IntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum1 v1, CompiledModelTestBase.Enum1 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum1 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum1 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum1 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum1 v1, CompiledModelTestBase.Enum1 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum1 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum1 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum1 v) => v), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -277,10 +277,10 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (CompiledModelTestBase.DependentBase>)source.Entity; - return (ISnapshot)new Snapshot>(((ValueComparer)principalId.GetValueComparer()).Snapshot(source.GetCurrentValue(principalId)), ((ValueComparer)principalAlternateId.GetValueComparer()).Snapshot(source.GetCurrentValue(principalAlternateId)), ((ValueComparer)enumDiscriminator.GetValueComparer()).Snapshot(source.GetCurrentValue(enumDiscriminator)), source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)id.GetValueComparer()).Snapshot(source.GetCurrentValue>(id))); + return (ISnapshot)new Snapshot>(((ValueComparer)((IProperty)principalId).GetValueComparer()).Snapshot(source.GetCurrentValue(principalId)), ((ValueComparer)((IProperty)principalAlternateId).GetValueComparer()).Snapshot(source.GetCurrentValue(principalAlternateId)), ((ValueComparer)((IProperty)enumDiscriminator).GetValueComparer()).Snapshot(source.GetCurrentValue(enumDiscriminator)), source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)((IProperty)id).GetValueComparer()).Snapshot(source.GetCurrentValue>(id))); }); runtimeEntityType.SetStoreGeneratedValuesFactory( - () => (ISnapshot)new Snapshot(((ValueComparer)principalId.GetValueComparer()).Snapshot(default(long)), ((ValueComparer)principalAlternateId.GetValueComparer()).Snapshot(default(Guid)))); + () => (ISnapshot)new Snapshot(((ValueComparer)((IProperty)principalId).GetValueComparer()).Snapshot(default(long)), ((ValueComparer)((IProperty)principalAlternateId).GetValueComparer()).Snapshot(default(Guid)))); runtimeEntityType.SetTemporaryValuesFactory( (InternalEntityEntry source) => (ISnapshot)new Snapshot(default(long), default(Guid))); runtimeEntityType.SetShadowValuesFactory( @@ -291,7 +291,7 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (CompiledModelTestBase.DependentBase>)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)principalId.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalId)), ((ValueComparer)principalAlternateId.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalAlternateId)), UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_DependentBase1_Principal(entity)); + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)principalId).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalId)), ((ValueComparer)((IProperty)principalAlternateId).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalAlternateId)), UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_DependentBase1_Principal(entity)); }); runtimeEntityType.Counts = new PropertyCounts( propertyCount: 4, diff --git a/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/BigModel/DependentDerivedEntityType.cs b/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/BigModel/DependentDerivedEntityType.cs index 0ca672b10df..55ebcd56287 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/BigModel/DependentDerivedEntityType.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/BigModel/DependentDerivedEntityType.cs @@ -62,15 +62,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas data.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "char(20)", @@ -96,15 +96,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas money.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( comparer: new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v), keyComparer: new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v), providerValueComparer: new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "decimal(9,3)", @@ -127,11 +127,11 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) runtimeEntityType.SetOriginalValuesFactory( (InternalEntityEntry source) => { - var entity = (CompiledModelTestBase.DependentDerived>)source.Entity; - return (ISnapshot)new Snapshot, string, decimal>(((ValueComparer)principalId.GetValueComparer()).Snapshot(source.GetCurrentValue(principalId)), ((ValueComparer)principalAlternateId.GetValueComparer()).Snapshot(source.GetCurrentValue(principalAlternateId)), ((ValueComparer)enumDiscriminator.GetValueComparer()).Snapshot(source.GetCurrentValue(enumDiscriminator)), source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)id.GetValueComparer()).Snapshot(source.GetCurrentValue>(id)), source.GetCurrentValue(data) == null ? null : ((ValueComparer)data.GetValueComparer()).Snapshot(source.GetCurrentValue(data)), ((ValueComparer)money.GetValueComparer()).Snapshot(source.GetCurrentValue(money))); + var entity8 = (CompiledModelTestBase.DependentDerived>)source.Entity; + return (ISnapshot)new Snapshot, string, decimal>(((ValueComparer)((IProperty)principalId).GetValueComparer()).Snapshot(source.GetCurrentValue(principalId)), ((ValueComparer)((IProperty)principalAlternateId).GetValueComparer()).Snapshot(source.GetCurrentValue(principalAlternateId)), ((ValueComparer)((IProperty)enumDiscriminator).GetValueComparer()).Snapshot(source.GetCurrentValue(enumDiscriminator)), source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)((IProperty)id).GetValueComparer()).Snapshot(source.GetCurrentValue>(id)), source.GetCurrentValue(data) == null ? null : ((ValueComparer)((IProperty)data).GetValueComparer()).Snapshot(source.GetCurrentValue(data)), ((ValueComparer)((IProperty)money).GetValueComparer()).Snapshot(source.GetCurrentValue(money))); }); runtimeEntityType.SetStoreGeneratedValuesFactory( - () => (ISnapshot)new Snapshot(((ValueComparer)principalId.GetValueComparer()).Snapshot(default(long)), ((ValueComparer)principalAlternateId.GetValueComparer()).Snapshot(default(Guid)))); + () => (ISnapshot)new Snapshot(((ValueComparer)((IProperty)principalId).GetValueComparer()).Snapshot(default(long)), ((ValueComparer)((IProperty)principalAlternateId).GetValueComparer()).Snapshot(default(Guid)))); runtimeEntityType.SetTemporaryValuesFactory( (InternalEntityEntry source) => (ISnapshot)new Snapshot(default(long), default(Guid))); runtimeEntityType.SetShadowValuesFactory( @@ -141,8 +141,8 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) runtimeEntityType.SetRelationshipSnapshotFactory( (InternalEntityEntry source) => { - var entity = (CompiledModelTestBase.DependentDerived>)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)principalId.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalId)), ((ValueComparer)principalAlternateId.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalAlternateId)), DependentBaseEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_DependentBase1_Principal(entity)); + var entity8 = (CompiledModelTestBase.DependentDerived>)source.Entity; + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)principalId).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalId)), ((ValueComparer)((IProperty)principalAlternateId).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalAlternateId)), DependentBaseEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_DependentBase1_Principal(entity8)); }); runtimeEntityType.Counts = new PropertyCounts( propertyCount: 6, diff --git a/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/BigModel/ManyTypesEntityType.cs b/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/BigModel/ManyTypesEntityType.cs index 3e6ffa7d0b7..afcd9c87110 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/BigModel/ManyTypesEntityType.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/BigModel/ManyTypesEntityType.cs @@ -70,11 +70,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas id.TypeMapping = IntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.ManyTypesId v1, CompiledModelTestBase.ManyTypesId v2) => v1.Equals(v2), - (CompiledModelTestBase.ManyTypesId v) => v.GetHashCode(), + (CompiledModelTestBase.ManyTypesId v) => ((object)v).GetHashCode(), (CompiledModelTestBase.ManyTypesId v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.ManyTypesId v1, CompiledModelTestBase.ManyTypesId v2) => v1.Equals(v2), - (CompiledModelTestBase.ManyTypesId v) => v.GetHashCode(), + (CompiledModelTestBase.ManyTypesId v) => ((object)v).GetHashCode(), (CompiledModelTestBase.ManyTypesId v) => v), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -123,15 +123,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas @bool.TypeMapping = SqlServerBoolTypeMapping.Default.Clone( comparer: new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v), keyComparer: new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v), providerValueComparer: new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v)); @bool.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); @bool.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Bool", "TestNamespace") }); @@ -165,15 +165,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas boolArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer(new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v)), keyComparer: new ListOfValueTypesComparer(new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -187,15 +187,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerBoolTypeMapping.Default.Clone( comparer: new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v), keyComparer: new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v), providerValueComparer: new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v))); boolArray.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); boolArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BoolArray", "TestNamespace") }); @@ -206,17 +206,17 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("BoolNestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); boolNestedCollection.SetGetter( - (CompiledModelTestBase.ManyTypes entity) => ReadBoolNestedCollection(entity), - (CompiledModelTestBase.ManyTypes entity) => ReadBoolNestedCollection(entity) == null, - (CompiledModelTestBase.ManyTypes instance) => ReadBoolNestedCollection(instance), - (CompiledModelTestBase.ManyTypes instance) => ReadBoolNestedCollection(instance) == null); + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BoolNestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BoolNestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BoolNestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BoolNestedCollection(instance) == null); boolNestedCollection.SetSetter( - (CompiledModelTestBase.ManyTypes entity, bool[][] value) => WriteBoolNestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, bool[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BoolNestedCollection(entity) = value); boolNestedCollection.SetMaterializationSetter( - (CompiledModelTestBase.ManyTypes entity, bool[][] value) => WriteBoolNestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, bool[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BoolNestedCollection(entity) = value); boolNestedCollection.SetAccessors( - (InternalEntityEntry entry) => ReadBoolNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => ReadBoolNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BoolNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BoolNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => entry.ReadOriginalValue(boolNestedCollection, 3), (InternalEntityEntry entry) => entry.GetCurrentValue(boolNestedCollection), (ValueBuffer valueBuffer) => valueBuffer[3]); @@ -229,15 +229,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas boolNestedCollection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer(new ListOfValueTypesComparer(new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v))), keyComparer: new ListOfReferenceTypesComparer(new ListOfValueTypesComparer(new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -253,15 +253,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer(new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v)), keyComparer: new ListOfValueTypesComparer(new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -275,17 +275,18 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerBoolTypeMapping.Default.Clone( comparer: new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v), keyComparer: new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v), providerValueComparer: new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v)))); boolNestedCollection.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + boolNestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BoolNestedCollection", "TestNamespace") }); var boolToStringConverterProperty = runtimeEntityType.AddProperty( "BoolToStringConverterProperty", @@ -316,15 +317,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas boolToStringConverterProperty.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v), keyComparer: new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(1)", @@ -372,11 +373,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas boolToTwoValuesConverterProperty.TypeMapping = SqlServerByteTypeMapping.Default.Clone( comparer: new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v), keyComparer: new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v), providerValueComparer: new ValueComparer( (byte v1, byte v2) => v1 == v2, @@ -424,11 +425,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas boolToZeroOneConverterProperty.TypeMapping = SqlServerShortTypeMapping.Default.Clone( comparer: new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v), keyComparer: new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v), providerValueComparer: new ValueComparer( (short v1, short v2) => v1 == v2, @@ -475,7 +476,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas bytes.TypeMapping = SqlServerByteArrayTypeMapping.Default.Clone( comparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), - (byte[] v) => v.GetHashCode(), + (byte[] v) => ((object)v).GetHashCode(), (byte[] v) => v), keyComparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), @@ -520,15 +521,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas bytesArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer(new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), - (byte[] v) => v.GetHashCode(), + (byte[] v) => ((object)v).GetHashCode(), (byte[] v) => v)), keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), - (byte[] v) => v.GetHashCode(), + (byte[] v) => ((object)v).GetHashCode(), (byte[] v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -542,7 +543,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerByteArrayTypeMapping.Default.Clone( comparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), - (byte[] v) => v.GetHashCode(), + (byte[] v) => ((object)v).GetHashCode(), (byte[] v) => v), keyComparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), @@ -564,17 +565,17 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("BytesNestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); bytesNestedCollection.SetGetter( - (CompiledModelTestBase.ManyTypes entity) => ReadBytesNestedCollection(entity), - (CompiledModelTestBase.ManyTypes entity) => ReadBytesNestedCollection(entity) == null, - (CompiledModelTestBase.ManyTypes instance) => ReadBytesNestedCollection(instance), - (CompiledModelTestBase.ManyTypes instance) => ReadBytesNestedCollection(instance) == null); + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BytesNestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BytesNestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BytesNestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BytesNestedCollection(instance) == null); bytesNestedCollection.SetSetter( - (CompiledModelTestBase.ManyTypes entity, byte[][][] value) => WriteBytesNestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, byte[][][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BytesNestedCollection(entity) = value); bytesNestedCollection.SetMaterializationSetter( - (CompiledModelTestBase.ManyTypes entity, byte[][][] value) => WriteBytesNestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, byte[][][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BytesNestedCollection(entity) = value); bytesNestedCollection.SetAccessors( - (InternalEntityEntry entry) => ReadBytesNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => ReadBytesNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BytesNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BytesNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => entry.ReadOriginalValue(bytesNestedCollection, 9), (InternalEntityEntry entry) => entry.GetCurrentValue(bytesNestedCollection), (ValueBuffer valueBuffer) => valueBuffer[9]); @@ -587,15 +588,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas bytesNestedCollection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer(new ListOfReferenceTypesComparer(new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), - (byte[] v) => v.GetHashCode(), + (byte[] v) => ((object)v).GetHashCode(), (byte[] v) => v))), keyComparer: new ListOfReferenceTypesComparer(new ListOfReferenceTypesComparer(new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), - (byte[] v) => v.GetHashCode(), + (byte[] v) => ((object)v).GetHashCode(), (byte[] v) => v))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -611,15 +612,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer(new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), - (byte[] v) => v.GetHashCode(), + (byte[] v) => ((object)v).GetHashCode(), (byte[] v) => v)), keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), - (byte[] v) => v.GetHashCode(), + (byte[] v) => ((object)v).GetHashCode(), (byte[] v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -633,7 +634,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerByteArrayTypeMapping.Default.Clone( comparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), - (byte[] v) => v.GetHashCode(), + (byte[] v) => ((object)v).GetHashCode(), (byte[] v) => v), keyComparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), @@ -647,6 +648,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas storeTypeName: "varbinary(max)"), storeTypePostfix: StoreTypePostfix.None))); bytesNestedCollection.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + bytesNestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BytesNestedCollection", "TestNamespace") }); var bytesToStringConverterProperty = runtimeEntityType.AddProperty( "BytesToStringConverterProperty", @@ -687,7 +689,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (byte[] v) => v.ToArray()), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -743,7 +745,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (int v) => v), providerValueComparer: new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v), converter: new ValueConverter( (int v) => (decimal)v, @@ -794,7 +796,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (char v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(1)", @@ -850,7 +852,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (char v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -880,7 +882,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (char v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(1)", @@ -904,17 +906,17 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("CharNestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); charNestedCollection.SetGetter( - (CompiledModelTestBase.ManyTypes entity) => ReadCharNestedCollection(entity), - (CompiledModelTestBase.ManyTypes entity) => ReadCharNestedCollection(entity) == null, - (CompiledModelTestBase.ManyTypes instance) => ReadCharNestedCollection(instance), - (CompiledModelTestBase.ManyTypes instance) => ReadCharNestedCollection(instance) == null); + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_CharNestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_CharNestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_CharNestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_CharNestedCollection(instance) == null); charNestedCollection.SetSetter( - (CompiledModelTestBase.ManyTypes entity, char[][] value) => WriteCharNestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, char[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_CharNestedCollection(entity) = value); charNestedCollection.SetMaterializationSetter( - (CompiledModelTestBase.ManyTypes entity, char[][] value) => WriteCharNestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, char[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_CharNestedCollection(entity) = value); charNestedCollection.SetAccessors( - (InternalEntityEntry entry) => ReadCharNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => ReadCharNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_CharNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_CharNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => entry.ReadOriginalValue(charNestedCollection, 14), (InternalEntityEntry entry) => entry.GetCurrentValue(charNestedCollection), (ValueBuffer valueBuffer) => valueBuffer[14]); @@ -935,7 +937,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (char v) => v))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -967,7 +969,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (char v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -997,7 +999,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (char v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(1)", @@ -1013,6 +1015,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (char v) => string.Format(CultureInfo.InvariantCulture, "{0}", (object)v), (string v) => v.Length < 1 ? '\0' : v[0]))))); charNestedCollection.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + charNestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_CharNestedCollection", "TestNamespace") }); var charToStringConverterProperty = runtimeEntityType.AddProperty( "CharToStringConverterProperty", @@ -1052,7 +1055,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (char v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nchar(1)", @@ -1103,15 +1106,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas dateOnly.TypeMapping = SqlServerDateOnlyTypeMapping.Default.Clone( comparer: new ValueComparer( (DateOnly v1, DateOnly v2) => v1.Equals(v2), - (DateOnly v) => v.GetHashCode(), + (DateOnly v) => ((object)v).GetHashCode(), (DateOnly v) => v), keyComparer: new ValueComparer( (DateOnly v1, DateOnly v2) => v1.Equals(v2), - (DateOnly v) => v.GetHashCode(), + (DateOnly v) => ((object)v).GetHashCode(), (DateOnly v) => v), providerValueComparer: new ValueComparer( (DateOnly v1, DateOnly v2) => v1.Equals(v2), - (DateOnly v) => v.GetHashCode(), + (DateOnly v) => ((object)v).GetHashCode(), (DateOnly v) => v)); dateOnly.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); dateOnly.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DateOnly", "TestNamespace") }); @@ -1145,15 +1148,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas dateOnlyArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer(new ValueComparer( (DateOnly v1, DateOnly v2) => v1.Equals(v2), - (DateOnly v) => v.GetHashCode(), + (DateOnly v) => ((object)v).GetHashCode(), (DateOnly v) => v)), keyComparer: new ListOfValueTypesComparer(new ValueComparer( (DateOnly v1, DateOnly v2) => v1.Equals(v2), - (DateOnly v) => v.GetHashCode(), + (DateOnly v) => ((object)v).GetHashCode(), (DateOnly v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -1167,15 +1170,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerDateOnlyTypeMapping.Default.Clone( comparer: new ValueComparer( (DateOnly v1, DateOnly v2) => v1.Equals(v2), - (DateOnly v) => v.GetHashCode(), + (DateOnly v) => ((object)v).GetHashCode(), (DateOnly v) => v), keyComparer: new ValueComparer( (DateOnly v1, DateOnly v2) => v1.Equals(v2), - (DateOnly v) => v.GetHashCode(), + (DateOnly v) => ((object)v).GetHashCode(), (DateOnly v) => v), providerValueComparer: new ValueComparer( (DateOnly v1, DateOnly v2) => v1.Equals(v2), - (DateOnly v) => v.GetHashCode(), + (DateOnly v) => ((object)v).GetHashCode(), (DateOnly v) => v))); dateOnlyArray.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); dateOnlyArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DateOnlyArray", "TestNamespace") }); @@ -1210,15 +1213,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas dateOnlyToStringConverterProperty.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (DateOnly v1, DateOnly v2) => v1.Equals(v2), - (DateOnly v) => v.GetHashCode(), + (DateOnly v) => ((object)v).GetHashCode(), (DateOnly v) => v), keyComparer: new ValueComparer( (DateOnly v1, DateOnly v2) => v1.Equals(v2), - (DateOnly v) => v.GetHashCode(), + (DateOnly v) => ((object)v).GetHashCode(), (DateOnly v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(10)", @@ -1267,15 +1270,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas dateTime.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( comparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v), keyComparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v), providerValueComparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v)); dateTime.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); dateTime.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DateTime", "TestNamespace") }); @@ -1309,15 +1312,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas dateTimeArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer(new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v)), keyComparer: new ListOfValueTypesComparer(new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -1331,15 +1334,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerDateTimeTypeMapping.Default.Clone( comparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v), keyComparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v), providerValueComparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v))); dateTimeArray.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); dateTimeArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DateTimeArray", "TestNamespace") }); @@ -1374,15 +1377,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas dateTimeOffsetToBinaryConverterProperty.TypeMapping = SqlServerLongTypeMapping.Default.Clone( comparer: new ValueComparer( (DateTimeOffset v1, DateTimeOffset v2) => v1.EqualsExact(v2), - (DateTimeOffset v) => v.GetHashCode(), + (DateTimeOffset v) => ((object)v).GetHashCode(), (DateTimeOffset v) => v), keyComparer: new ValueComparer( (DateTimeOffset v1, DateTimeOffset v2) => v1.EqualsExact(v2), - (DateTimeOffset v) => v.GetHashCode(), + (DateTimeOffset v) => ((object)v).GetHashCode(), (DateTimeOffset v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), converter: new ValueConverter( (DateTimeOffset v) => DateTimeOffsetToBinaryConverter.ToLong(v), @@ -1426,11 +1429,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas dateTimeOffsetToBytesConverterProperty.TypeMapping = SqlServerByteArrayTypeMapping.Default.Clone( comparer: new ValueComparer( (DateTimeOffset v1, DateTimeOffset v2) => v1.EqualsExact(v2), - (DateTimeOffset v) => v.GetHashCode(), + (DateTimeOffset v) => ((object)v).GetHashCode(), (DateTimeOffset v) => v), keyComparer: new ValueComparer( (DateTimeOffset v1, DateTimeOffset v2) => v1.EqualsExact(v2), - (DateTimeOffset v) => v.GetHashCode(), + (DateTimeOffset v) => ((object)v).GetHashCode(), (DateTimeOffset v) => v), providerValueComparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), @@ -1481,15 +1484,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas dateTimeOffsetToStringConverterProperty.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (DateTimeOffset v1, DateTimeOffset v2) => v1.EqualsExact(v2), - (DateTimeOffset v) => v.GetHashCode(), + (DateTimeOffset v) => ((object)v).GetHashCode(), (DateTimeOffset v) => v), keyComparer: new ValueComparer( (DateTimeOffset v1, DateTimeOffset v2) => v1.EqualsExact(v2), - (DateTimeOffset v) => v.GetHashCode(), + (DateTimeOffset v) => ((object)v).GetHashCode(), (DateTimeOffset v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(48)", @@ -1538,15 +1541,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas dateTimeToBinaryConverterProperty.TypeMapping = SqlServerLongTypeMapping.Default.Clone( comparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v), keyComparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), converter: new ValueConverter( (DateTime v) => v.ToBinary(), @@ -1590,15 +1593,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas dateTimeToStringConverterProperty.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v), keyComparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(48)", @@ -1647,15 +1650,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas dateTimeToTicksConverterProperty.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( comparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v), keyComparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v), providerValueComparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v)); dateTimeToTicksConverterProperty.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); dateTimeToTicksConverterProperty.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DateTimeToTicksConverterProperty", "TestNamespace") }); @@ -1690,15 +1693,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas @decimal.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( comparer: new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v), keyComparer: new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v), providerValueComparer: new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v)); @decimal.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); @decimal.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Decimal", "TestNamespace") }); @@ -1732,15 +1735,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas decimalArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer(new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v)), keyComparer: new ListOfValueTypesComparer(new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -1754,15 +1757,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerDecimalTypeMapping.Default.Clone( comparer: new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v), keyComparer: new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v), providerValueComparer: new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v))); decimalArray.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); decimalArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DecimalArray", "TestNamespace") }); @@ -1797,11 +1800,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas decimalNumberToBytesConverterProperty.TypeMapping = SqlServerByteArrayTypeMapping.Default.Clone( comparer: new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v), keyComparer: new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v), providerValueComparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), @@ -1852,15 +1855,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas decimalNumberToStringConverterProperty.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v), keyComparer: new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(64)", @@ -1909,15 +1912,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas @double.TypeMapping = SqlServerDoubleTypeMapping.Default.Clone( comparer: new ValueComparer( (double v1, double v2) => v1.Equals(v2), - (double v) => v.GetHashCode(), + (double v) => ((object)v).GetHashCode(), (double v) => v), keyComparer: new ValueComparer( (double v1, double v2) => v1.Equals(v2), - (double v) => v.GetHashCode(), + (double v) => ((object)v).GetHashCode(), (double v) => v), providerValueComparer: new ValueComparer( (double v1, double v2) => v1.Equals(v2), - (double v) => v.GetHashCode(), + (double v) => ((object)v).GetHashCode(), (double v) => v)); @double.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); @double.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Double", "TestNamespace") }); @@ -1951,15 +1954,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas doubleArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer(new ValueComparer( (double v1, double v2) => v1.Equals(v2), - (double v) => v.GetHashCode(), + (double v) => ((object)v).GetHashCode(), (double v) => v)), keyComparer: new ListOfValueTypesComparer(new ValueComparer( (double v1, double v2) => v1.Equals(v2), - (double v) => v.GetHashCode(), + (double v) => ((object)v).GetHashCode(), (double v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -1973,15 +1976,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerDoubleTypeMapping.Default.Clone( comparer: new ValueComparer( (double v1, double v2) => v1.Equals(v2), - (double v) => v.GetHashCode(), + (double v) => ((object)v).GetHashCode(), (double v) => v), keyComparer: new ValueComparer( (double v1, double v2) => v1.Equals(v2), - (double v) => v.GetHashCode(), + (double v) => ((object)v).GetHashCode(), (double v) => v), providerValueComparer: new ValueComparer( (double v1, double v2) => v1.Equals(v2), - (double v) => v.GetHashCode(), + (double v) => ((object)v).GetHashCode(), (double v) => v))); doubleArray.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); doubleArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DoubleArray", "TestNamespace") }); @@ -2016,11 +2019,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas doubleNumberToBytesConverterProperty.TypeMapping = SqlServerByteArrayTypeMapping.Default.Clone( comparer: new ValueComparer( (double v1, double v2) => v1.Equals(v2), - (double v) => v.GetHashCode(), + (double v) => ((object)v).GetHashCode(), (double v) => v), keyComparer: new ValueComparer( (double v1, double v2) => v1.Equals(v2), - (double v) => v.GetHashCode(), + (double v) => ((object)v).GetHashCode(), (double v) => v), providerValueComparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), @@ -2071,15 +2074,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas doubleNumberToStringConverterProperty.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (double v1, double v2) => v1.Equals(v2), - (double v) => v.GetHashCode(), + (double v) => ((object)v).GetHashCode(), (double v) => v), keyComparer: new ValueComparer( (double v1, double v2) => v1.Equals(v2), - (double v) => v.GetHashCode(), + (double v) => ((object)v).GetHashCode(), (double v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(64)", @@ -2127,11 +2130,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum16.TypeMapping = SqlServerShortTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v), providerValueComparer: new ValueComparer( (short v1, short v2) => v1 == v2, @@ -2178,15 +2181,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum16Array.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v)), keyComparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -2208,11 +2211,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerShortTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v), providerValueComparer: new ValueComparer( (short v1, short v2) => v1 == v2, @@ -2259,28 +2262,28 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum16AsString.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (CompiledModelTestBase.Enum16 v) => v.ToString(), + (CompiledModelTestBase.Enum16 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum16 v) => v.ToString(), + (CompiledModelTestBase.Enum16 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))); enum16AsString.SetSentinelFromProviderValue("Default"); enum16AsString.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); @@ -2315,15 +2318,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum16AsStringArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v)), keyComparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -2333,40 +2336,40 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum16 v) => v.ToString(), + (CompiledModelTestBase.Enum16 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum16 v) => v.ToString(), + (CompiledModelTestBase.Enum16 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))), elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (CompiledModelTestBase.Enum16 v) => v.ToString(), + (CompiledModelTestBase.Enum16 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum16 v) => v.ToString(), + (CompiledModelTestBase.Enum16 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))); enum16AsStringArray.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); enum16AsStringArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum16AsStringArray", "TestNamespace") }); @@ -2400,15 +2403,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum16AsStringCollection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer, CompiledModelTestBase.Enum16>(new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v)), keyComparer: new ListOfValueTypesComparer, CompiledModelTestBase.Enum16>(new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -2418,40 +2421,40 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum16 v) => v.ToString(), + (CompiledModelTestBase.Enum16 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.Enum16>( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum16 v) => v.ToString(), + (CompiledModelTestBase.Enum16 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))), elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (CompiledModelTestBase.Enum16 v) => v.ToString(), + (CompiledModelTestBase.Enum16 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum16 v) => v.ToString(), + (CompiledModelTestBase.Enum16 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))); enum16AsStringCollection.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); enum16AsStringCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum16AsStringCollection", "TestNamespace") }); @@ -2485,15 +2488,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum16Collection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer, CompiledModelTestBase.Enum16>(new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v)), keyComparer: new ListOfValueTypesComparer, CompiledModelTestBase.Enum16>(new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -2515,11 +2518,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerShortTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v), providerValueComparer: new ValueComparer( (short v1, short v2) => v1 == v2, @@ -2565,11 +2568,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum32.TypeMapping = IntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -2616,15 +2619,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum32Array.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v)), keyComparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -2646,11 +2649,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: IntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -2697,28 +2700,28 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum32AsString.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (CompiledModelTestBase.Enum32 v) => v.ToString(), + (CompiledModelTestBase.Enum32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum32 v) => v.ToString(), + (CompiledModelTestBase.Enum32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))); enum32AsString.SetSentinelFromProviderValue("Default"); enum32AsString.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); @@ -2753,15 +2756,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum32AsStringArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v)), keyComparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -2771,40 +2774,40 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum32 v) => v.ToString(), + (CompiledModelTestBase.Enum32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum32 v) => v.ToString(), + (CompiledModelTestBase.Enum32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))), elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (CompiledModelTestBase.Enum32 v) => v.ToString(), + (CompiledModelTestBase.Enum32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum32 v) => v.ToString(), + (CompiledModelTestBase.Enum32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))); enum32AsStringArray.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); enum32AsStringArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum32AsStringArray", "TestNamespace") }); @@ -2838,15 +2841,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum32AsStringCollection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer, CompiledModelTestBase.Enum32>(new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v)), keyComparer: new ListOfValueTypesComparer, CompiledModelTestBase.Enum32>(new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -2856,40 +2859,40 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum32 v) => v.ToString(), + (CompiledModelTestBase.Enum32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.Enum32>( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum32 v) => v.ToString(), + (CompiledModelTestBase.Enum32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))), elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (CompiledModelTestBase.Enum32 v) => v.ToString(), + (CompiledModelTestBase.Enum32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum32 v) => v.ToString(), + (CompiledModelTestBase.Enum32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))); enum32AsStringCollection.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); enum32AsStringCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum32AsStringCollection", "TestNamespace") }); @@ -2923,15 +2926,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum32Collection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer, CompiledModelTestBase.Enum32>(new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v)), keyComparer: new ListOfValueTypesComparer, CompiledModelTestBase.Enum32>(new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -2953,11 +2956,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: IntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -2980,17 +2983,17 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("Enum32NestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); enum32NestedCollection.SetGetter( - (CompiledModelTestBase.ManyTypes entity) => ReadEnum32NestedCollection(entity), - (CompiledModelTestBase.ManyTypes entity) => ReadEnum32NestedCollection(entity) == null, - (CompiledModelTestBase.ManyTypes instance) => ReadEnum32NestedCollection(instance), - (CompiledModelTestBase.ManyTypes instance) => ReadEnum32NestedCollection(instance) == null); + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum32NestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum32NestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum32NestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum32NestedCollection(instance) == null); enum32NestedCollection.SetSetter( - (CompiledModelTestBase.ManyTypes entity, List[][] value) => WriteEnum32NestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, List[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum32NestedCollection(entity) = value); enum32NestedCollection.SetMaterializationSetter( - (CompiledModelTestBase.ManyTypes entity, List[][] value) => WriteEnum32NestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, List[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum32NestedCollection(entity) = value); enum32NestedCollection.SetAccessors( - (InternalEntityEntry entry) => ReadEnum32NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => ReadEnum32NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum32NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum32NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => entry.ReadOriginalValue[][]>(enum32NestedCollection, 47), (InternalEntityEntry entry) => entry.GetCurrentValue[][]>(enum32NestedCollection), (ValueBuffer valueBuffer) => valueBuffer[47]); @@ -3003,15 +3006,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum32NestedCollection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer[][], List[]>(new ListOfReferenceTypesComparer[], List>(new ListOfValueTypesComparer, CompiledModelTestBase.Enum32>(new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v)))), keyComparer: new ListOfReferenceTypesComparer[][], List[]>(new ListOfReferenceTypesComparer[], List>(new ListOfValueTypesComparer, CompiledModelTestBase.Enum32>(new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v)))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -3037,15 +3040,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer[], List>(new ListOfValueTypesComparer, CompiledModelTestBase.Enum32>(new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v))), keyComparer: new ListOfReferenceTypesComparer[], List>(new ListOfValueTypesComparer, CompiledModelTestBase.Enum32>(new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -3069,15 +3072,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer, CompiledModelTestBase.Enum32>(new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v)), keyComparer: new ListOfValueTypesComparer, CompiledModelTestBase.Enum32>(new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -3099,11 +3102,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: IntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -3118,6 +3121,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (CompiledModelTestBase.Enum32 value) => (int)value, (int value) => (CompiledModelTestBase.Enum32)value)))))); enum32NestedCollection.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + enum32NestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum32NestedCollection", "TestNamespace") }); var enum64 = runtimeEntityType.AddProperty( "Enum64", @@ -3148,15 +3152,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum64.TypeMapping = SqlServerLongTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), converter: new ValueConverter( (CompiledModelTestBase.Enum64 value) => (long)value, @@ -3199,15 +3203,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum64Array.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v)), keyComparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -3229,15 +3233,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerLongTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), converter: new ValueConverter( (CompiledModelTestBase.Enum64 value) => (long)value, @@ -3280,28 +3284,28 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum64AsString.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (CompiledModelTestBase.Enum64 v) => v.ToString(), + (CompiledModelTestBase.Enum64 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum64 v) => v.ToString(), + (CompiledModelTestBase.Enum64 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))); enum64AsString.SetSentinelFromProviderValue("Default"); enum64AsString.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); @@ -3336,15 +3340,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum64AsStringArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v)), keyComparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -3354,40 +3358,40 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum64 v) => v.ToString(), + (CompiledModelTestBase.Enum64 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum64 v) => v.ToString(), + (CompiledModelTestBase.Enum64 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))), elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (CompiledModelTestBase.Enum64 v) => v.ToString(), + (CompiledModelTestBase.Enum64 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum64 v) => v.ToString(), + (CompiledModelTestBase.Enum64 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))); enum64AsStringArray.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); enum64AsStringArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum64AsStringArray", "TestNamespace") }); @@ -3421,15 +3425,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum64AsStringCollection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer, CompiledModelTestBase.Enum64>(new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v)), keyComparer: new ListOfValueTypesComparer, CompiledModelTestBase.Enum64>(new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -3439,40 +3443,40 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum64 v) => v.ToString(), + (CompiledModelTestBase.Enum64 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.Enum64>( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum64 v) => v.ToString(), + (CompiledModelTestBase.Enum64 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))), elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (CompiledModelTestBase.Enum64 v) => v.ToString(), + (CompiledModelTestBase.Enum64 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum64 v) => v.ToString(), + (CompiledModelTestBase.Enum64 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))); enum64AsStringCollection.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); enum64AsStringCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum64AsStringCollection", "TestNamespace") }); @@ -3506,15 +3510,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum64Collection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer, CompiledModelTestBase.Enum64>(new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v)), keyComparer: new ListOfValueTypesComparer, CompiledModelTestBase.Enum64>(new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -3536,15 +3540,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerLongTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), converter: new ValueConverter( (CompiledModelTestBase.Enum64 value) => (long)value, @@ -3586,11 +3590,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum8.TypeMapping = SqlServerShortTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), providerValueComparer: new ValueComparer( (short v1, short v2) => v1 == v2, @@ -3637,15 +3641,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum8Array.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v)), keyComparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -3667,11 +3671,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerShortTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), providerValueComparer: new ValueComparer( (short v1, short v2) => v1 == v2, @@ -3718,28 +3722,28 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum8AsString.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (CompiledModelTestBase.Enum8 v) => v.ToString(), + (CompiledModelTestBase.Enum8 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum8 v) => v.ToString(), + (CompiledModelTestBase.Enum8 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))); enum8AsString.SetSentinelFromProviderValue("Default"); enum8AsString.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); @@ -3774,15 +3778,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum8AsStringArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v)), keyComparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -3792,40 +3796,40 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum8 v) => v.ToString(), + (CompiledModelTestBase.Enum8 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum8 v) => v.ToString(), + (CompiledModelTestBase.Enum8 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))), elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (CompiledModelTestBase.Enum8 v) => v.ToString(), + (CompiledModelTestBase.Enum8 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum8 v) => v.ToString(), + (CompiledModelTestBase.Enum8 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))); enum8AsStringArray.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); enum8AsStringArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum8AsStringArray", "TestNamespace") }); @@ -3859,15 +3863,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum8AsStringCollection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer, CompiledModelTestBase.Enum8>(new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v)), keyComparer: new ListOfValueTypesComparer, CompiledModelTestBase.Enum8>(new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -3877,40 +3881,40 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum8 v) => v.ToString(), + (CompiledModelTestBase.Enum8 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.Enum8>( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum8 v) => v.ToString(), + (CompiledModelTestBase.Enum8 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))), elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (CompiledModelTestBase.Enum8 v) => v.ToString(), + (CompiledModelTestBase.Enum8 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum8 v) => v.ToString(), + (CompiledModelTestBase.Enum8 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))); enum8AsStringCollection.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); enum8AsStringCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum8AsStringCollection", "TestNamespace") }); @@ -3944,15 +3948,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum8Collection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer, CompiledModelTestBase.Enum8>(new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v)), keyComparer: new ListOfValueTypesComparer, CompiledModelTestBase.Enum8>(new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -3974,11 +3978,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerShortTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), providerValueComparer: new ValueComparer( (short v1, short v2) => v1 == v2, @@ -4001,17 +4005,17 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("Enum8NestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); enum8NestedCollection.SetGetter( - (CompiledModelTestBase.ManyTypes entity) => ReadEnum8NestedCollection(entity), - (CompiledModelTestBase.ManyTypes entity) => ReadEnum8NestedCollection(entity) == null, - (CompiledModelTestBase.ManyTypes instance) => ReadEnum8NestedCollection(instance), - (CompiledModelTestBase.ManyTypes instance) => ReadEnum8NestedCollection(instance) == null); + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum8NestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum8NestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum8NestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum8NestedCollection(instance) == null); enum8NestedCollection.SetSetter( - (CompiledModelTestBase.ManyTypes entity, CompiledModelTestBase.Enum8[][] value) => WriteEnum8NestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, CompiledModelTestBase.Enum8[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum8NestedCollection(entity) = value); enum8NestedCollection.SetMaterializationSetter( - (CompiledModelTestBase.ManyTypes entity, CompiledModelTestBase.Enum8[][] value) => WriteEnum8NestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, CompiledModelTestBase.Enum8[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum8NestedCollection(entity) = value); enum8NestedCollection.SetAccessors( - (InternalEntityEntry entry) => ReadEnum8NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => ReadEnum8NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum8NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum8NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => entry.ReadOriginalValue(enum8NestedCollection, 60), (InternalEntityEntry entry) => entry.GetCurrentValue(enum8NestedCollection), (ValueBuffer valueBuffer) => valueBuffer[60]); @@ -4024,15 +4028,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum8NestedCollection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer(new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v))), keyComparer: new ListOfReferenceTypesComparer(new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -4056,15 +4060,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v)), keyComparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -4086,11 +4090,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerShortTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), providerValueComparer: new ValueComparer( (short v1, short v2) => v1 == v2, @@ -4105,6 +4109,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (CompiledModelTestBase.Enum8 value) => (short)value, (short value) => (CompiledModelTestBase.Enum8)value))))); enum8NestedCollection.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + enum8NestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum8NestedCollection", "TestNamespace") }); var enumToNumberConverterProperty = runtimeEntityType.AddProperty( "EnumToNumberConverterProperty", @@ -4136,11 +4141,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumToNumberConverterProperty.TypeMapping = IntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -4188,28 +4193,28 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumToStringConverterProperty.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (CompiledModelTestBase.Enum32 v) => v.ToString(), + (CompiledModelTestBase.Enum32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum32 v) => v.ToString(), + (CompiledModelTestBase.Enum32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))); enumToStringConverterProperty.SetSentinelFromProviderValue("Default"); enumToStringConverterProperty.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); @@ -4244,11 +4249,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU16.TypeMapping = IntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -4295,15 +4300,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU16Array.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v)), keyComparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -4325,11 +4330,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: IntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -4376,28 +4381,28 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU16AsString.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (CompiledModelTestBase.EnumU16 v) => v.ToString(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU16 v) => v.ToString(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))); enumU16AsString.SetSentinelFromProviderValue("Min"); enumU16AsString.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); @@ -4432,15 +4437,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU16AsStringArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v)), keyComparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -4450,40 +4455,40 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU16 v) => v.ToString(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU16 v) => v.ToString(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))), elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (CompiledModelTestBase.EnumU16 v) => v.ToString(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU16 v) => v.ToString(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))); enumU16AsStringArray.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); enumU16AsStringArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU16AsStringArray", "TestNamespace") }); @@ -4517,15 +4522,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU16AsStringCollection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer, CompiledModelTestBase.EnumU16>(new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v)), keyComparer: new ListOfValueTypesComparer, CompiledModelTestBase.EnumU16>(new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -4535,40 +4540,40 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU16 v) => v.ToString(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.EnumU16>( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU16 v) => v.ToString(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))), elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (CompiledModelTestBase.EnumU16 v) => v.ToString(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU16 v) => v.ToString(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))); enumU16AsStringCollection.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); enumU16AsStringCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU16AsStringCollection", "TestNamespace") }); @@ -4602,15 +4607,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU16Collection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer, CompiledModelTestBase.EnumU16>(new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v)), keyComparer: new ListOfValueTypesComparer, CompiledModelTestBase.EnumU16>(new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -4632,11 +4637,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: IntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -4682,15 +4687,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU32.TypeMapping = SqlServerLongTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), converter: new ValueConverter( (CompiledModelTestBase.EnumU32 value) => (long)value, @@ -4733,15 +4738,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU32Array.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v)), keyComparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -4763,15 +4768,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerLongTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), converter: new ValueConverter( (CompiledModelTestBase.EnumU32 value) => (long)value, @@ -4814,28 +4819,28 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU32AsString.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (CompiledModelTestBase.EnumU32 v) => v.ToString(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU32 v) => v.ToString(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))); enumU32AsString.SetSentinelFromProviderValue("Min"); enumU32AsString.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); @@ -4870,15 +4875,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU32AsStringArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v)), keyComparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -4888,40 +4893,40 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU32 v) => v.ToString(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU32 v) => v.ToString(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))), elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (CompiledModelTestBase.EnumU32 v) => v.ToString(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU32 v) => v.ToString(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))); enumU32AsStringArray.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); enumU32AsStringArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU32AsStringArray", "TestNamespace") }); @@ -4955,15 +4960,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU32AsStringCollection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer, CompiledModelTestBase.EnumU32>(new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v)), keyComparer: new ListOfValueTypesComparer, CompiledModelTestBase.EnumU32>(new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -4973,40 +4978,40 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU32 v) => v.ToString(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.EnumU32>( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU32 v) => v.ToString(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))), elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (CompiledModelTestBase.EnumU32 v) => v.ToString(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU32 v) => v.ToString(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))); enumU32AsStringCollection.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); enumU32AsStringCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU32AsStringCollection", "TestNamespace") }); @@ -5040,15 +5045,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU32Collection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer, CompiledModelTestBase.EnumU32>(new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v)), keyComparer: new ListOfValueTypesComparer, CompiledModelTestBase.EnumU32>(new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -5070,15 +5075,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerLongTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), converter: new ValueConverter( (CompiledModelTestBase.EnumU32 value) => (long)value, @@ -5120,15 +5125,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU64.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), providerValueComparer: new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "decimal(20,0)", @@ -5175,15 +5180,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU64Array.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v)), keyComparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -5205,15 +5210,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerDecimalTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), providerValueComparer: new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "decimal(20,0)", @@ -5260,28 +5265,28 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU64AsString.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (CompiledModelTestBase.EnumU64 v) => v.ToString(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU64 v) => v.ToString(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))); enumU64AsString.SetSentinelFromProviderValue("Min"); enumU64AsString.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); @@ -5316,15 +5321,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU64AsStringArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v)), keyComparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -5334,40 +5339,40 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU64 v) => v.ToString(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU64 v) => v.ToString(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))), elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (CompiledModelTestBase.EnumU64 v) => v.ToString(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU64 v) => v.ToString(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))); enumU64AsStringArray.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); enumU64AsStringArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU64AsStringArray", "TestNamespace") }); @@ -5401,15 +5406,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU64AsStringCollection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer, CompiledModelTestBase.EnumU64>(new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v)), keyComparer: new ListOfValueTypesComparer, CompiledModelTestBase.EnumU64>(new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -5419,40 +5424,40 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU64 v) => v.ToString(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.EnumU64>( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU64 v) => v.ToString(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))), elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (CompiledModelTestBase.EnumU64 v) => v.ToString(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU64 v) => v.ToString(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))); enumU64AsStringCollection.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); enumU64AsStringCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU64AsStringCollection", "TestNamespace") }); @@ -5486,15 +5491,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU64Collection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer, CompiledModelTestBase.EnumU64>(new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v)), keyComparer: new ListOfValueTypesComparer, CompiledModelTestBase.EnumU64>(new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -5516,15 +5521,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerDecimalTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), providerValueComparer: new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "decimal(20,0)", @@ -5547,17 +5552,17 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("EnumU64NestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); enumU64NestedCollection.SetGetter( - (CompiledModelTestBase.ManyTypes entity) => ReadEnumU64NestedCollection(entity), - (CompiledModelTestBase.ManyTypes entity) => ReadEnumU64NestedCollection(entity) == null, - (CompiledModelTestBase.ManyTypes instance) => ReadEnumU64NestedCollection(instance), - (CompiledModelTestBase.ManyTypes instance) => ReadEnumU64NestedCollection(instance) == null); + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU64NestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU64NestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU64NestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU64NestedCollection(instance) == null); enumU64NestedCollection.SetSetter( - (CompiledModelTestBase.ManyTypes entity, CompiledModelTestBase.EnumU64[][] value) => WriteEnumU64NestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, CompiledModelTestBase.EnumU64[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU64NestedCollection(entity) = value); enumU64NestedCollection.SetMaterializationSetter( - (CompiledModelTestBase.ManyTypes entity, CompiledModelTestBase.EnumU64[][] value) => WriteEnumU64NestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, CompiledModelTestBase.EnumU64[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU64NestedCollection(entity) = value); enumU64NestedCollection.SetAccessors( - (InternalEntityEntry entry) => ReadEnumU64NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => ReadEnumU64NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU64NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU64NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => entry.ReadOriginalValue(enumU64NestedCollection, 81), (InternalEntityEntry entry) => entry.GetCurrentValue(enumU64NestedCollection), (ValueBuffer valueBuffer) => valueBuffer[81]); @@ -5570,15 +5575,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU64NestedCollection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer(new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v))), keyComparer: new ListOfReferenceTypesComparer(new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -5602,15 +5607,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v)), keyComparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -5632,15 +5637,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerDecimalTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), providerValueComparer: new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "decimal(20,0)", @@ -5655,6 +5660,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (CompiledModelTestBase.EnumU64 value) => (decimal)(long)value, (decimal value) => (CompiledModelTestBase.EnumU64)(long)value))))); enumU64NestedCollection.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + enumU64NestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU64NestedCollection", "TestNamespace") }); var enumU8 = runtimeEntityType.AddProperty( "EnumU8", @@ -5685,11 +5691,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU8.TypeMapping = SqlServerByteTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v), providerValueComparer: new ValueComparer( (byte v1, byte v2) => v1 == v2, @@ -5736,15 +5742,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU8Array.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v)), keyComparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -5766,11 +5772,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerByteTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v), providerValueComparer: new ValueComparer( (byte v1, byte v2) => v1 == v2, @@ -5817,28 +5823,28 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU8AsString.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (CompiledModelTestBase.EnumU8 v) => v.ToString(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU8 v) => v.ToString(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))); enumU8AsString.SetSentinelFromProviderValue("Min"); enumU8AsString.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); @@ -5873,15 +5879,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU8AsStringArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v)), keyComparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -5891,40 +5897,40 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU8 v) => v.ToString(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU8 v) => v.ToString(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))), elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (CompiledModelTestBase.EnumU8 v) => v.ToString(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU8 v) => v.ToString(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))); enumU8AsStringArray.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); enumU8AsStringArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU8AsStringArray", "TestNamespace") }); @@ -5958,15 +5964,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU8AsStringCollection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer, CompiledModelTestBase.EnumU8>(new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v)), keyComparer: new ListOfValueTypesComparer, CompiledModelTestBase.EnumU8>(new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -5976,40 +5982,40 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU8 v) => v.ToString(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.EnumU8>( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU8 v) => v.ToString(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))), elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (CompiledModelTestBase.EnumU8 v) => v.ToString(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU8 v) => v.ToString(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))); enumU8AsStringCollection.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); enumU8AsStringCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU8AsStringCollection", "TestNamespace") }); @@ -6043,15 +6049,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU8Collection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer, CompiledModelTestBase.EnumU8>(new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v)), keyComparer: new ListOfValueTypesComparer, CompiledModelTestBase.EnumU8>(new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -6073,11 +6079,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerByteTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v), providerValueComparer: new ValueComparer( (byte v1, byte v2) => v1 == v2, @@ -6124,15 +6130,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas @float.TypeMapping = SqlServerFloatTypeMapping.Default.Clone( comparer: new ValueComparer( (float v1, float v2) => v1.Equals(v2), - (float v) => v.GetHashCode(), + (float v) => ((object)v).GetHashCode(), (float v) => v), keyComparer: new ValueComparer( (float v1, float v2) => v1.Equals(v2), - (float v) => v.GetHashCode(), + (float v) => ((object)v).GetHashCode(), (float v) => v), providerValueComparer: new ValueComparer( (float v1, float v2) => v1.Equals(v2), - (float v) => v.GetHashCode(), + (float v) => ((object)v).GetHashCode(), (float v) => v)); @float.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); @float.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Float", "TestNamespace") }); @@ -6166,15 +6172,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas floatArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer(new ValueComparer( (float v1, float v2) => v1.Equals(v2), - (float v) => v.GetHashCode(), + (float v) => ((object)v).GetHashCode(), (float v) => v)), keyComparer: new ListOfValueTypesComparer(new ValueComparer( (float v1, float v2) => v1.Equals(v2), - (float v) => v.GetHashCode(), + (float v) => ((object)v).GetHashCode(), (float v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -6188,15 +6194,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerFloatTypeMapping.Default.Clone( comparer: new ValueComparer( (float v1, float v2) => v1.Equals(v2), - (float v) => v.GetHashCode(), + (float v) => ((object)v).GetHashCode(), (float v) => v), keyComparer: new ValueComparer( (float v1, float v2) => v1.Equals(v2), - (float v) => v.GetHashCode(), + (float v) => ((object)v).GetHashCode(), (float v) => v), providerValueComparer: new ValueComparer( (float v1, float v2) => v1.Equals(v2), - (float v) => v.GetHashCode(), + (float v) => ((object)v).GetHashCode(), (float v) => v))); floatArray.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); floatArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_FloatArray", "TestNamespace") }); @@ -6231,15 +6237,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas guid.TypeMapping = GuidTypeMapping.Default.Clone( comparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), keyComparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), providerValueComparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "uniqueidentifier")); @@ -6275,15 +6281,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas guidArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer(new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v)), keyComparer: new ListOfValueTypesComparer(new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -6297,15 +6303,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: GuidTypeMapping.Default.Clone( comparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), keyComparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), providerValueComparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "uniqueidentifier"))); @@ -6318,17 +6324,17 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("GuidNestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); guidNestedCollection.SetGetter( - (CompiledModelTestBase.ManyTypes entity) => ReadGuidNestedCollection(entity), - (CompiledModelTestBase.ManyTypes entity) => ReadGuidNestedCollection(entity) == null, - (CompiledModelTestBase.ManyTypes instance) => ReadGuidNestedCollection(instance), - (CompiledModelTestBase.ManyTypes instance) => ReadGuidNestedCollection(instance) == null); + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_GuidNestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_GuidNestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_GuidNestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_GuidNestedCollection(instance) == null); guidNestedCollection.SetSetter( - (CompiledModelTestBase.ManyTypes entity, ICollection value) => WriteGuidNestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, ICollection value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_GuidNestedCollection(entity) = value); guidNestedCollection.SetMaterializationSetter( - (CompiledModelTestBase.ManyTypes entity, ICollection value) => WriteGuidNestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, ICollection value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_GuidNestedCollection(entity) = value); guidNestedCollection.SetAccessors( - (InternalEntityEntry entry) => ReadGuidNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => ReadGuidNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_GuidNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_GuidNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => entry.ReadOriginalValue>(guidNestedCollection, 92), (InternalEntityEntry entry) => entry.GetCurrentValue>(guidNestedCollection), (ValueBuffer valueBuffer) => valueBuffer[92]); @@ -6341,15 +6347,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas guidNestedCollection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer, Guid[][]>(new ListOfReferenceTypesComparer(new ListOfValueTypesComparer(new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v)))), keyComparer: new ListOfReferenceTypesComparer, Guid[][]>(new ListOfReferenceTypesComparer(new ListOfValueTypesComparer(new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v)))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -6367,15 +6373,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer(new ListOfValueTypesComparer(new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v))), keyComparer: new ListOfReferenceTypesComparer(new ListOfValueTypesComparer(new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -6391,15 +6397,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer(new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v)), keyComparer: new ListOfValueTypesComparer(new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -6413,19 +6419,20 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: GuidTypeMapping.Default.Clone( comparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), keyComparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), providerValueComparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "uniqueidentifier"))))); guidNestedCollection.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + guidNestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_GuidNestedCollection", "TestNamespace") }); var guidToBytesConverterProperty = runtimeEntityType.AddProperty( "GuidToBytesConverterProperty", @@ -6457,11 +6464,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas guidToBytesConverterProperty.TypeMapping = SqlServerByteArrayTypeMapping.Default.Clone( comparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), keyComparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), providerValueComparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), @@ -6512,15 +6519,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas guidToStringConverterProperty.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), keyComparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(36)", @@ -6568,15 +6575,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas iPAddress.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), keyComparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(45)", @@ -6584,12 +6591,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)))); iPAddress.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); iPAddress.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_IPAddress", "TestNamespace") }); @@ -6623,15 +6630,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas iPAddressArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -6641,27 +6648,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)))), elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), keyComparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(45)", @@ -6669,12 +6676,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))); iPAddressArray.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); iPAddressArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_IPAddressArray", "TestNamespace") }); @@ -6709,11 +6716,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas iPAddressToBytesConverterProperty.TypeMapping = SqlServerByteArrayTypeMapping.Default.Clone( comparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), keyComparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), providerValueComparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), @@ -6763,15 +6770,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas iPAddressToStringConverterProperty.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), keyComparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(45)", @@ -6779,12 +6786,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)))); iPAddressToStringConverterProperty.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); iPAddressToStringConverterProperty.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_IPAddressToStringConverterProperty", "TestNamespace") }); @@ -6869,7 +6876,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (short v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -6976,7 +6983,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (int v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -7009,17 +7016,17 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("Int32NestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); int32NestedCollection.SetGetter( - (CompiledModelTestBase.ManyTypes entity) => ReadInt32NestedCollection(entity), - (CompiledModelTestBase.ManyTypes entity) => ReadInt32NestedCollection(entity) == null, - (CompiledModelTestBase.ManyTypes instance) => ReadInt32NestedCollection(instance), - (CompiledModelTestBase.ManyTypes instance) => ReadInt32NestedCollection(instance) == null); + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int32NestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int32NestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int32NestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int32NestedCollection(instance) == null); int32NestedCollection.SetSetter( - (CompiledModelTestBase.ManyTypes entity, int[][] value) => WriteInt32NestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, int[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int32NestedCollection(entity) = value); int32NestedCollection.SetMaterializationSetter( - (CompiledModelTestBase.ManyTypes entity, int[][] value) => WriteInt32NestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, int[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int32NestedCollection(entity) = value); int32NestedCollection.SetAccessors( - (InternalEntityEntry entry) => ReadInt32NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => ReadInt32NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int32NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int32NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => entry.ReadOriginalValue(int32NestedCollection, 103), (InternalEntityEntry entry) => entry.GetCurrentValue(int32NestedCollection), (ValueBuffer valueBuffer) => valueBuffer[103]); @@ -7040,7 +7047,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (int v) => v))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -7064,7 +7071,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (int v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -7089,6 +7096,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (int v) => v, (int v) => v)))); int32NestedCollection.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + int32NestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int32NestedCollection", "TestNamespace") }); var int64 = runtimeEntityType.AddProperty( "Int64", @@ -7120,15 +7128,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas int64.TypeMapping = SqlServerLongTypeMapping.Default.Clone( comparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), keyComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v)); int64.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); int64.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int64", "TestNamespace") }); @@ -7162,15 +7170,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas int64Array.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer(new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v)), keyComparer: new ListOfValueTypesComparer(new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -7184,15 +7192,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerLongTypeMapping.Default.Clone( comparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), keyComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v))); int64Array.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); int64Array.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int64Array", "TestNamespace") }); @@ -7203,17 +7211,17 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("Int64NestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); int64NestedCollection.SetGetter( - (CompiledModelTestBase.ManyTypes entity) => ReadInt64NestedCollection(entity), - (CompiledModelTestBase.ManyTypes entity) => ReadInt64NestedCollection(entity) == null, - (CompiledModelTestBase.ManyTypes instance) => ReadInt64NestedCollection(instance), - (CompiledModelTestBase.ManyTypes instance) => ReadInt64NestedCollection(instance) == null); + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int64NestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int64NestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int64NestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int64NestedCollection(instance) == null); int64NestedCollection.SetSetter( - (CompiledModelTestBase.ManyTypes entity, IList[] value) => WriteInt64NestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, IList[] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int64NestedCollection(entity) = value); int64NestedCollection.SetMaterializationSetter( - (CompiledModelTestBase.ManyTypes entity, IList[] value) => WriteInt64NestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, IList[] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int64NestedCollection(entity) = value); int64NestedCollection.SetAccessors( - (InternalEntityEntry entry) => ReadInt64NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => ReadInt64NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int64NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int64NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(int64NestedCollection, 106), (InternalEntityEntry entry) => entry.GetCurrentValue[]>(int64NestedCollection), (ValueBuffer valueBuffer) => valueBuffer[106]); @@ -7226,15 +7234,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas int64NestedCollection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer[], IList>(new ListOfReferenceTypesComparer, long[]>(new ListOfValueTypesComparer(new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v)))), keyComparer: new ListOfReferenceTypesComparer[], IList>(new ListOfReferenceTypesComparer, long[]>(new ListOfValueTypesComparer(new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v)))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -7252,15 +7260,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer, long[]>(new ListOfValueTypesComparer(new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v))), keyComparer: new ListOfReferenceTypesComparer, long[]>(new ListOfValueTypesComparer(new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -7276,15 +7284,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer(new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v)), keyComparer: new ListOfValueTypesComparer(new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -7298,17 +7306,18 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerLongTypeMapping.Default.Clone( comparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), keyComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v))))); int64NestedCollection.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + int64NestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int64NestedCollection", "TestNamespace") }); var int8 = runtimeEntityType.AddProperty( "Int8", @@ -7398,7 +7407,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (sbyte v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -7447,17 +7456,17 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("Int8NestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); int8NestedCollection.SetGetter( - (CompiledModelTestBase.ManyTypes entity) => ReadInt8NestedCollection(entity), - (CompiledModelTestBase.ManyTypes entity) => ReadInt8NestedCollection(entity) == null, - (CompiledModelTestBase.ManyTypes instance) => ReadInt8NestedCollection(instance), - (CompiledModelTestBase.ManyTypes instance) => ReadInt8NestedCollection(instance) == null); + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int8NestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int8NestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int8NestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int8NestedCollection(instance) == null); int8NestedCollection.SetSetter( - (CompiledModelTestBase.ManyTypes entity, sbyte[][][] value) => WriteInt8NestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, sbyte[][][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int8NestedCollection(entity) = value); int8NestedCollection.SetMaterializationSetter( - (CompiledModelTestBase.ManyTypes entity, sbyte[][][] value) => WriteInt8NestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, sbyte[][][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int8NestedCollection(entity) = value); int8NestedCollection.SetAccessors( - (InternalEntityEntry entry) => ReadInt8NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => ReadInt8NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int8NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int8NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => entry.ReadOriginalValue(int8NestedCollection, 109), (InternalEntityEntry entry) => entry.GetCurrentValue(int8NestedCollection), (ValueBuffer valueBuffer) => valueBuffer[109]); @@ -7478,7 +7487,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (sbyte v) => v)))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -7512,7 +7521,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (sbyte v) => v))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -7544,7 +7553,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (sbyte v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -7585,6 +7594,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (sbyte v) => (short)v, (short v) => (sbyte)v)))))); int8NestedCollection.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + int8NestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int8NestedCollection", "TestNamespace") }); var intNumberToBytesConverterProperty = runtimeEntityType.AddProperty( "IntNumberToBytesConverterProperty", @@ -7679,7 +7689,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (int v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(64)", @@ -7737,21 +7747,21 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (Nullable v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (Nullable v) => v == null ? null : v.ToString(), + (Nullable v) => v == null ? null : ((object)v).ToString(), (string v) => v == null || v == "" ? null : (Nullable)int.Parse(v), convertsNulls: true), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (Nullable v) => v == null ? null : v.ToString(), + (Nullable v) => v == null ? null : ((object)v).ToString(), (string v) => v == null || v == "" ? null : (Nullable)int.Parse(v), convertsNulls: true))); nullIntToNullStringConverterProperty.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); @@ -7787,15 +7797,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableBool.TypeMapping = SqlServerBoolTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (bool)v1 == (bool)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((bool)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(bool)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(bool)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (bool)v1 == (bool)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((bool)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(bool)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(bool)v : default(Nullable)), providerValueComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (bool)v1 == (bool)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((bool)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(bool)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(bool)v : default(Nullable))); nullableBool.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); nullableBool.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableBool", "TestNamespace") }); @@ -7829,15 +7839,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableBoolArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (bool)v1 == (bool)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((bool)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(bool)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(bool)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (bool)v1 == (bool)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((bool)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(bool)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(bool)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -7851,15 +7861,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerBoolTypeMapping.Default.Clone( comparer: new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v), keyComparer: new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v), providerValueComparer: new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v))); nullableBoolArray.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); nullableBoolArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableBoolArray", "TestNamespace") }); @@ -7894,7 +7904,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableBytes.TypeMapping = SqlServerByteArrayTypeMapping.Default.Clone( comparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), - (byte[] v) => v.GetHashCode(), + (byte[] v) => ((object)v).GetHashCode(), (byte[] v) => v), keyComparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), @@ -7939,15 +7949,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableBytesArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer(new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), - (byte[] v) => v.GetHashCode(), + (byte[] v) => ((object)v).GetHashCode(), (byte[] v) => v)), keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), - (byte[] v) => v.GetHashCode(), + (byte[] v) => ((object)v).GetHashCode(), (byte[] v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -7961,7 +7971,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerByteArrayTypeMapping.Default.Clone( comparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), - (byte[] v) => v.GetHashCode(), + (byte[] v) => ((object)v).GetHashCode(), (byte[] v) => v), keyComparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), @@ -7983,17 +7993,17 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("NullableBytesNestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); nullableBytesNestedCollection.SetGetter( - (CompiledModelTestBase.ManyTypes entity) => ReadNullableBytesNestedCollection(entity), - (CompiledModelTestBase.ManyTypes entity) => ReadNullableBytesNestedCollection(entity) == null, - (CompiledModelTestBase.ManyTypes instance) => ReadNullableBytesNestedCollection(instance), - (CompiledModelTestBase.ManyTypes instance) => ReadNullableBytesNestedCollection(instance) == null); + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableBytesNestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableBytesNestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableBytesNestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableBytesNestedCollection(instance) == null); nullableBytesNestedCollection.SetSetter( - (CompiledModelTestBase.ManyTypes entity, byte[][][] value) => WriteNullableBytesNestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, byte[][][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableBytesNestedCollection(entity) = value); nullableBytesNestedCollection.SetMaterializationSetter( - (CompiledModelTestBase.ManyTypes entity, byte[][][] value) => WriteNullableBytesNestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, byte[][][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableBytesNestedCollection(entity) = value); nullableBytesNestedCollection.SetAccessors( - (InternalEntityEntry entry) => ReadNullableBytesNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => ReadNullableBytesNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableBytesNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableBytesNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => entry.ReadOriginalValue(nullableBytesNestedCollection, 117), (InternalEntityEntry entry) => entry.GetCurrentValue(nullableBytesNestedCollection), (ValueBuffer valueBuffer) => valueBuffer[117]); @@ -8006,15 +8016,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableBytesNestedCollection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer(new ListOfReferenceTypesComparer(new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), - (byte[] v) => v.GetHashCode(), + (byte[] v) => ((object)v).GetHashCode(), (byte[] v) => v))), keyComparer: new ListOfReferenceTypesComparer(new ListOfReferenceTypesComparer(new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), - (byte[] v) => v.GetHashCode(), + (byte[] v) => ((object)v).GetHashCode(), (byte[] v) => v))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -8030,15 +8040,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer(new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), - (byte[] v) => v.GetHashCode(), + (byte[] v) => ((object)v).GetHashCode(), (byte[] v) => v)), keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), - (byte[] v) => v.GetHashCode(), + (byte[] v) => ((object)v).GetHashCode(), (byte[] v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -8052,7 +8062,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerByteArrayTypeMapping.Default.Clone( comparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), - (byte[] v) => v.GetHashCode(), + (byte[] v) => ((object)v).GetHashCode(), (byte[] v) => v), keyComparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), @@ -8066,6 +8076,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas storeTypeName: "varbinary(max)"), storeTypePostfix: StoreTypePostfix.None))); nullableBytesNestedCollection.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + nullableBytesNestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableBytesNestedCollection", "TestNamespace") }); var nullableChar = runtimeEntityType.AddProperty( "NullableChar", @@ -8105,7 +8116,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (Nullable v) => v.HasValue ? (Nullable)(char)v : default(Nullable)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(1)", @@ -8160,7 +8171,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (Nullable v) => v.HasValue ? (Nullable)(char)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -8190,7 +8201,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (char v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(1)", @@ -8238,15 +8249,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableDateOnly.TypeMapping = SqlServerDateOnlyTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateOnly)v1 == (DateOnly)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((DateOnly)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(DateOnly)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(DateOnly)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateOnly)v1 == (DateOnly)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((DateOnly)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(DateOnly)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(DateOnly)v : default(Nullable)), providerValueComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateOnly)v1 == (DateOnly)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((DateOnly)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(DateOnly)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(DateOnly)v : default(Nullable))); nullableDateOnly.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); nullableDateOnly.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableDateOnly", "TestNamespace") }); @@ -8280,15 +8291,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableDateOnlyArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateOnly)v1 == (DateOnly)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((DateOnly)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(DateOnly)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(DateOnly)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateOnly)v1 == (DateOnly)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((DateOnly)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(DateOnly)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(DateOnly)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -8302,15 +8313,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerDateOnlyTypeMapping.Default.Clone( comparer: new ValueComparer( (DateOnly v1, DateOnly v2) => v1.Equals(v2), - (DateOnly v) => v.GetHashCode(), + (DateOnly v) => ((object)v).GetHashCode(), (DateOnly v) => v), keyComparer: new ValueComparer( (DateOnly v1, DateOnly v2) => v1.Equals(v2), - (DateOnly v) => v.GetHashCode(), + (DateOnly v) => ((object)v).GetHashCode(), (DateOnly v) => v), providerValueComparer: new ValueComparer( (DateOnly v1, DateOnly v2) => v1.Equals(v2), - (DateOnly v) => v.GetHashCode(), + (DateOnly v) => ((object)v).GetHashCode(), (DateOnly v) => v))); nullableDateOnlyArray.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); nullableDateOnlyArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableDateOnlyArray", "TestNamespace") }); @@ -8345,15 +8356,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableDateTime.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(DateTime)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(DateTime)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), providerValueComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(DateTime)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable))); nullableDateTime.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); nullableDateTime.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableDateTime", "TestNamespace") }); @@ -8387,15 +8398,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableDateTimeArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(DateTime)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(DateTime)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -8409,15 +8420,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerDateTimeTypeMapping.Default.Clone( comparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v), keyComparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v), providerValueComparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v))); nullableDateTimeArray.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); nullableDateTimeArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableDateTimeArray", "TestNamespace") }); @@ -8452,15 +8463,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableDecimal.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(decimal)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(decimal)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), providerValueComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(decimal)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable))); nullableDecimal.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); nullableDecimal.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableDecimal", "TestNamespace") }); @@ -8494,15 +8505,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableDecimalArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(decimal)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(decimal)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -8516,15 +8527,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerDecimalTypeMapping.Default.Clone( comparer: new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v), keyComparer: new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v), providerValueComparer: new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v))); nullableDecimalArray.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); nullableDecimalArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableDecimalArray", "TestNamespace") }); @@ -8559,15 +8570,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableDouble.TypeMapping = SqlServerDoubleTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && ((double)v1).Equals((double)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((double)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(double)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(double)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && ((double)v1).Equals((double)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((double)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(double)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(double)v : default(Nullable)), providerValueComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && ((double)v1).Equals((double)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((double)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(double)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(double)v : default(Nullable))); nullableDouble.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); nullableDouble.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableDouble", "TestNamespace") }); @@ -8601,15 +8612,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableDoubleArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && ((double)v1).Equals((double)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((double)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(double)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(double)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && ((double)v1).Equals((double)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((double)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(double)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(double)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -8623,15 +8634,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerDoubleTypeMapping.Default.Clone( comparer: new ValueComparer( (double v1, double v2) => v1.Equals(v2), - (double v) => v.GetHashCode(), + (double v) => ((object)v).GetHashCode(), (double v) => v), keyComparer: new ValueComparer( (double v1, double v2) => v1.Equals(v2), - (double v) => v.GetHashCode(), + (double v) => ((object)v).GetHashCode(), (double v) => v), providerValueComparer: new ValueComparer( (double v1, double v2) => v1.Equals(v2), - (double v) => v.GetHashCode(), + (double v) => ((object)v).GetHashCode(), (double v) => v))); nullableDoubleArray.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); nullableDoubleArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableDoubleArray", "TestNamespace") }); @@ -8666,11 +8677,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum16.TypeMapping = SqlServerShortTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum16)v1, (object)(CompiledModelTestBase.Enum16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum16)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum16)v1, (object)(CompiledModelTestBase.Enum16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum16)v : default(Nullable)), providerValueComparer: new ValueComparer( (short v1, short v2) => v1 == v2, @@ -8716,15 +8727,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum16Array.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum16)v1, (object)(CompiledModelTestBase.Enum16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum16)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum16)v1, (object)(CompiledModelTestBase.Enum16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum16)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -8746,11 +8757,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerShortTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v), providerValueComparer: new ValueComparer( (short v1, short v2) => v1 == v2, @@ -8797,11 +8808,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum16AsString.TypeMapping = SqlServerShortTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum16)v1, (object)(CompiledModelTestBase.Enum16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum16)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum16)v1, (object)(CompiledModelTestBase.Enum16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum16)v : default(Nullable)), providerValueComparer: new ValueComparer( (short v1, short v2) => v1 == v2, @@ -8847,15 +8858,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum16AsStringArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum16)v1, (object)(CompiledModelTestBase.Enum16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum16)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum16)v1, (object)(CompiledModelTestBase.Enum16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum16)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -8877,11 +8888,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerShortTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v), providerValueComparer: new ValueComparer( (short v1, short v2) => v1 == v2, @@ -8927,15 +8938,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum16AsStringCollection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.Enum16>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum16)v1, (object)(CompiledModelTestBase.Enum16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum16)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.Enum16>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum16)v1, (object)(CompiledModelTestBase.Enum16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum16)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -8957,11 +8968,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerShortTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v), providerValueComparer: new ValueComparer( (short v1, short v2) => v1 == v2, @@ -9007,15 +9018,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum16Collection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.Enum16>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum16)v1, (object)(CompiledModelTestBase.Enum16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum16)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.Enum16>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum16)v1, (object)(CompiledModelTestBase.Enum16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum16)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -9037,11 +9048,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerShortTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v), providerValueComparer: new ValueComparer( (short v1, short v2) => v1 == v2, @@ -9088,11 +9099,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum32.TypeMapping = IntTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum32)v1, (object)(CompiledModelTestBase.Enum32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum32)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum32)v1, (object)(CompiledModelTestBase.Enum32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum32)v : default(Nullable)), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -9138,15 +9149,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum32Array.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum32)v1, (object)(CompiledModelTestBase.Enum32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum32)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum32)v1, (object)(CompiledModelTestBase.Enum32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum32)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -9168,11 +9179,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: IntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -9219,11 +9230,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum32AsString.TypeMapping = IntTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum32)v1, (object)(CompiledModelTestBase.Enum32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum32)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum32)v1, (object)(CompiledModelTestBase.Enum32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum32)v : default(Nullable)), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -9269,15 +9280,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum32AsStringArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum32)v1, (object)(CompiledModelTestBase.Enum32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum32)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum32)v1, (object)(CompiledModelTestBase.Enum32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum32)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -9299,11 +9310,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: IntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -9349,15 +9360,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum32AsStringCollection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.Enum32>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum32)v1, (object)(CompiledModelTestBase.Enum32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum32)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.Enum32>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum32)v1, (object)(CompiledModelTestBase.Enum32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum32)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -9379,11 +9390,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: IntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -9429,15 +9440,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum32Collection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.Enum32>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum32)v1, (object)(CompiledModelTestBase.Enum32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum32)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.Enum32>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum32)v1, (object)(CompiledModelTestBase.Enum32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum32)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -9459,11 +9470,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: IntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -9486,17 +9497,17 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("NullableEnum32NestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); nullableEnum32NestedCollection.SetGetter( - (CompiledModelTestBase.ManyTypes entity) => ReadNullableEnum32NestedCollection(entity), - (CompiledModelTestBase.ManyTypes entity) => ReadNullableEnum32NestedCollection(entity) == null, - (CompiledModelTestBase.ManyTypes instance) => ReadNullableEnum32NestedCollection(instance), - (CompiledModelTestBase.ManyTypes instance) => ReadNullableEnum32NestedCollection(instance) == null); + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum32NestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum32NestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum32NestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum32NestedCollection(instance) == null); nullableEnum32NestedCollection.SetSetter( - (CompiledModelTestBase.ManyTypes entity, Nullable[][][] value) => WriteNullableEnum32NestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, Nullable[][][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum32NestedCollection(entity) = value); nullableEnum32NestedCollection.SetMaterializationSetter( - (CompiledModelTestBase.ManyTypes entity, Nullable[][][] value) => WriteNullableEnum32NestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, Nullable[][][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum32NestedCollection(entity) = value); nullableEnum32NestedCollection.SetAccessors( - (InternalEntityEntry entry) => ReadNullableEnum32NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => ReadNullableEnum32NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum32NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum32NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => entry.ReadOriginalValue[][][]>(nullableEnum32NestedCollection, 140), (InternalEntityEntry entry) => entry.GetCurrentValue[][][]>(nullableEnum32NestedCollection), (ValueBuffer valueBuffer) => valueBuffer[140]); @@ -9509,15 +9520,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum32NestedCollection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer(new ListOfReferenceTypesComparer(new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum32)v1, (object)(CompiledModelTestBase.Enum32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum32)v : default(Nullable))))), keyComparer: new ListOfReferenceTypesComparer(new ListOfReferenceTypesComparer(new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum32)v1, (object)(CompiledModelTestBase.Enum32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum32)v : default(Nullable))))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -9543,15 +9554,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer(new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum32)v1, (object)(CompiledModelTestBase.Enum32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum32)v : default(Nullable)))), keyComparer: new ListOfReferenceTypesComparer(new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum32)v1, (object)(CompiledModelTestBase.Enum32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum32)v : default(Nullable)))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -9575,15 +9586,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum32)v1, (object)(CompiledModelTestBase.Enum32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum32)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum32)v1, (object)(CompiledModelTestBase.Enum32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum32)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -9605,11 +9616,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: IntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -9624,6 +9635,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (CompiledModelTestBase.Enum32 value) => (int)value, (int value) => (CompiledModelTestBase.Enum32)value)))))); nullableEnum32NestedCollection.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + nullableEnum32NestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum32NestedCollection", "TestNamespace") }); var nullableEnum64 = runtimeEntityType.AddProperty( "NullableEnum64", @@ -9655,15 +9667,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum64.TypeMapping = SqlServerLongTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum64)v1, (object)(CompiledModelTestBase.Enum64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum64)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum64)v1, (object)(CompiledModelTestBase.Enum64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum64)v : default(Nullable)), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), converter: new ValueConverter( (CompiledModelTestBase.Enum64 value) => (long)value, @@ -9705,15 +9717,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum64Array.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum64)v1, (object)(CompiledModelTestBase.Enum64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum64)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum64)v1, (object)(CompiledModelTestBase.Enum64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum64)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -9735,15 +9747,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerLongTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), converter: new ValueConverter( (CompiledModelTestBase.Enum64 value) => (long)value, @@ -9786,15 +9798,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum64AsString.TypeMapping = SqlServerLongTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum64)v1, (object)(CompiledModelTestBase.Enum64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum64)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum64)v1, (object)(CompiledModelTestBase.Enum64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum64)v : default(Nullable)), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), converter: new ValueConverter( (CompiledModelTestBase.Enum64 value) => (long)value, @@ -9836,15 +9848,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum64AsStringArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum64)v1, (object)(CompiledModelTestBase.Enum64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum64)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum64)v1, (object)(CompiledModelTestBase.Enum64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum64)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -9866,15 +9878,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerLongTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), converter: new ValueConverter( (CompiledModelTestBase.Enum64 value) => (long)value, @@ -9916,15 +9928,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum64AsStringCollection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.Enum64>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum64)v1, (object)(CompiledModelTestBase.Enum64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum64)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.Enum64>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum64)v1, (object)(CompiledModelTestBase.Enum64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum64)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -9946,15 +9958,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerLongTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), converter: new ValueConverter( (CompiledModelTestBase.Enum64 value) => (long)value, @@ -9996,15 +10008,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum64Collection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.Enum64>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum64)v1, (object)(CompiledModelTestBase.Enum64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum64)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.Enum64>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum64)v1, (object)(CompiledModelTestBase.Enum64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum64)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -10026,15 +10038,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerLongTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), converter: new ValueConverter( (CompiledModelTestBase.Enum64 value) => (long)value, @@ -10077,11 +10089,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum8.TypeMapping = SqlServerShortTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum8)v1, (object)(CompiledModelTestBase.Enum8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum8)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum8)v1, (object)(CompiledModelTestBase.Enum8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum8)v : default(Nullable)), providerValueComparer: new ValueComparer( (short v1, short v2) => v1 == v2, @@ -10127,15 +10139,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum8Array.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum8)v1, (object)(CompiledModelTestBase.Enum8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum8)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum8)v1, (object)(CompiledModelTestBase.Enum8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum8)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -10157,11 +10169,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerShortTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), providerValueComparer: new ValueComparer( (short v1, short v2) => v1 == v2, @@ -10208,11 +10220,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum8AsString.TypeMapping = SqlServerShortTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum8)v1, (object)(CompiledModelTestBase.Enum8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum8)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum8)v1, (object)(CompiledModelTestBase.Enum8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum8)v : default(Nullable)), providerValueComparer: new ValueComparer( (short v1, short v2) => v1 == v2, @@ -10258,15 +10270,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum8AsStringArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum8)v1, (object)(CompiledModelTestBase.Enum8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum8)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum8)v1, (object)(CompiledModelTestBase.Enum8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum8)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -10288,11 +10300,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerShortTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), providerValueComparer: new ValueComparer( (short v1, short v2) => v1 == v2, @@ -10338,15 +10350,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum8AsStringCollection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.Enum8>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum8)v1, (object)(CompiledModelTestBase.Enum8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum8)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.Enum8>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum8)v1, (object)(CompiledModelTestBase.Enum8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum8)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -10368,11 +10380,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerShortTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), providerValueComparer: new ValueComparer( (short v1, short v2) => v1 == v2, @@ -10418,15 +10430,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum8Collection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.Enum8>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum8)v1, (object)(CompiledModelTestBase.Enum8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum8)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.Enum8>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum8)v1, (object)(CompiledModelTestBase.Enum8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum8)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -10448,11 +10460,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerShortTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), providerValueComparer: new ValueComparer( (short v1, short v2) => v1 == v2, @@ -10475,17 +10487,17 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("NullableEnum8NestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); nullableEnum8NestedCollection.SetGetter( - (CompiledModelTestBase.ManyTypes entity) => ReadNullableEnum8NestedCollection(entity), - (CompiledModelTestBase.ManyTypes entity) => ReadNullableEnum8NestedCollection(entity) == null, - (CompiledModelTestBase.ManyTypes instance) => ReadNullableEnum8NestedCollection(instance), - (CompiledModelTestBase.ManyTypes instance) => ReadNullableEnum8NestedCollection(instance) == null); + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum8NestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum8NestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum8NestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum8NestedCollection(instance) == null); nullableEnum8NestedCollection.SetSetter( - (CompiledModelTestBase.ManyTypes entity, Nullable[][] value) => WriteNullableEnum8NestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, Nullable[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum8NestedCollection(entity) = value); nullableEnum8NestedCollection.SetMaterializationSetter( - (CompiledModelTestBase.ManyTypes entity, Nullable[][] value) => WriteNullableEnum8NestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, Nullable[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum8NestedCollection(entity) = value); nullableEnum8NestedCollection.SetAccessors( - (InternalEntityEntry entry) => ReadNullableEnum8NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => ReadNullableEnum8NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum8NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum8NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => entry.ReadOriginalValue[][]>(nullableEnum8NestedCollection, 153), (InternalEntityEntry entry) => entry.GetCurrentValue[][]>(nullableEnum8NestedCollection), (ValueBuffer valueBuffer) => valueBuffer[153]); @@ -10498,15 +10510,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum8NestedCollection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer(new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum8)v1, (object)(CompiledModelTestBase.Enum8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum8)v : default(Nullable)))), keyComparer: new ListOfReferenceTypesComparer(new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum8)v1, (object)(CompiledModelTestBase.Enum8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum8)v : default(Nullable)))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -10530,15 +10542,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum8)v1, (object)(CompiledModelTestBase.Enum8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum8)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum8)v1, (object)(CompiledModelTestBase.Enum8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum8)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -10560,11 +10572,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerShortTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), providerValueComparer: new ValueComparer( (short v1, short v2) => v1 == v2, @@ -10579,6 +10591,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (CompiledModelTestBase.Enum8 value) => (short)value, (short value) => (CompiledModelTestBase.Enum8)value))))); nullableEnum8NestedCollection.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + nullableEnum8NestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum8NestedCollection", "TestNamespace") }); var nullableEnumU16 = runtimeEntityType.AddProperty( "NullableEnumU16", @@ -10610,11 +10623,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU16.TypeMapping = IntTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU16)v1, (object)(CompiledModelTestBase.EnumU16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU16)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU16)v1, (object)(CompiledModelTestBase.EnumU16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU16)v : default(Nullable)), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -10660,15 +10673,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU16Array.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU16)v1, (object)(CompiledModelTestBase.EnumU16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU16)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU16)v1, (object)(CompiledModelTestBase.EnumU16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU16)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -10690,11 +10703,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: IntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -10741,11 +10754,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU16AsString.TypeMapping = IntTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU16)v1, (object)(CompiledModelTestBase.EnumU16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU16)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU16)v1, (object)(CompiledModelTestBase.EnumU16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU16)v : default(Nullable)), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -10791,15 +10804,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU16AsStringArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU16)v1, (object)(CompiledModelTestBase.EnumU16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU16)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU16)v1, (object)(CompiledModelTestBase.EnumU16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU16)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -10821,11 +10834,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: IntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -10871,15 +10884,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU16AsStringCollection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.EnumU16>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU16)v1, (object)(CompiledModelTestBase.EnumU16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU16)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.EnumU16>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU16)v1, (object)(CompiledModelTestBase.EnumU16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU16)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -10901,11 +10914,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: IntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -10951,15 +10964,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU16Collection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.EnumU16>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU16)v1, (object)(CompiledModelTestBase.EnumU16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU16)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.EnumU16>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU16)v1, (object)(CompiledModelTestBase.EnumU16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU16)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -10981,11 +10994,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: IntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -11032,15 +11045,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU32.TypeMapping = SqlServerLongTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU32)v1, (object)(CompiledModelTestBase.EnumU32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU32)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU32)v1, (object)(CompiledModelTestBase.EnumU32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU32)v : default(Nullable)), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), converter: new ValueConverter( (CompiledModelTestBase.EnumU32 value) => (long)value, @@ -11082,15 +11095,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU32Array.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU32)v1, (object)(CompiledModelTestBase.EnumU32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU32)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU32)v1, (object)(CompiledModelTestBase.EnumU32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU32)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -11112,15 +11125,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerLongTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), converter: new ValueConverter( (CompiledModelTestBase.EnumU32 value) => (long)value, @@ -11163,15 +11176,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU32AsString.TypeMapping = SqlServerLongTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU32)v1, (object)(CompiledModelTestBase.EnumU32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU32)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU32)v1, (object)(CompiledModelTestBase.EnumU32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU32)v : default(Nullable)), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), converter: new ValueConverter( (CompiledModelTestBase.EnumU32 value) => (long)value, @@ -11213,15 +11226,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU32AsStringArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU32)v1, (object)(CompiledModelTestBase.EnumU32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU32)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU32)v1, (object)(CompiledModelTestBase.EnumU32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU32)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -11243,15 +11256,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerLongTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), converter: new ValueConverter( (CompiledModelTestBase.EnumU32 value) => (long)value, @@ -11293,15 +11306,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU32AsStringCollection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.EnumU32>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU32)v1, (object)(CompiledModelTestBase.EnumU32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU32)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.EnumU32>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU32)v1, (object)(CompiledModelTestBase.EnumU32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU32)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -11323,15 +11336,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerLongTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), converter: new ValueConverter( (CompiledModelTestBase.EnumU32 value) => (long)value, @@ -11373,15 +11386,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU32Collection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.EnumU32>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU32)v1, (object)(CompiledModelTestBase.EnumU32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU32)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.EnumU32>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU32)v1, (object)(CompiledModelTestBase.EnumU32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU32)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -11403,15 +11416,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerLongTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), converter: new ValueConverter( (CompiledModelTestBase.EnumU32 value) => (long)value, @@ -11454,15 +11467,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU64.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU64)v1, (object)(CompiledModelTestBase.EnumU64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU64)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU64)v1, (object)(CompiledModelTestBase.EnumU64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU64)v : default(Nullable)), providerValueComparer: new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "decimal(20,0)", @@ -11508,15 +11521,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU64Array.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU64)v1, (object)(CompiledModelTestBase.EnumU64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU64)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU64)v1, (object)(CompiledModelTestBase.EnumU64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU64)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -11538,15 +11551,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerDecimalTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), providerValueComparer: new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "decimal(20,0)", @@ -11593,15 +11606,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU64AsString.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU64)v1, (object)(CompiledModelTestBase.EnumU64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU64)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU64)v1, (object)(CompiledModelTestBase.EnumU64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU64)v : default(Nullable)), providerValueComparer: new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "decimal(20,0)", @@ -11647,15 +11660,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU64AsStringArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU64)v1, (object)(CompiledModelTestBase.EnumU64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU64)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU64)v1, (object)(CompiledModelTestBase.EnumU64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU64)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -11677,15 +11690,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerDecimalTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), providerValueComparer: new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "decimal(20,0)", @@ -11731,15 +11744,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU64AsStringCollection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.EnumU64>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU64)v1, (object)(CompiledModelTestBase.EnumU64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU64)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.EnumU64>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU64)v1, (object)(CompiledModelTestBase.EnumU64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU64)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -11761,15 +11774,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerDecimalTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), providerValueComparer: new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "decimal(20,0)", @@ -11815,15 +11828,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU64Collection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.EnumU64>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU64)v1, (object)(CompiledModelTestBase.EnumU64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU64)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.EnumU64>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU64)v1, (object)(CompiledModelTestBase.EnumU64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU64)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -11845,15 +11858,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerDecimalTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), providerValueComparer: new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "decimal(20,0)", @@ -11876,17 +11889,17 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("NullableEnumU64NestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); nullableEnumU64NestedCollection.SetGetter( - (CompiledModelTestBase.ManyTypes entity) => ReadNullableEnumU64NestedCollection(entity), - (CompiledModelTestBase.ManyTypes entity) => ReadNullableEnumU64NestedCollection(entity) == null, - (CompiledModelTestBase.ManyTypes instance) => ReadNullableEnumU64NestedCollection(instance), - (CompiledModelTestBase.ManyTypes instance) => ReadNullableEnumU64NestedCollection(instance) == null); + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU64NestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU64NestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU64NestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU64NestedCollection(instance) == null); nullableEnumU64NestedCollection.SetSetter( - (CompiledModelTestBase.ManyTypes entity, Nullable[][] value) => WriteNullableEnumU64NestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, Nullable[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU64NestedCollection(entity) = value); nullableEnumU64NestedCollection.SetMaterializationSetter( - (CompiledModelTestBase.ManyTypes entity, Nullable[][] value) => WriteNullableEnumU64NestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, Nullable[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU64NestedCollection(entity) = value); nullableEnumU64NestedCollection.SetAccessors( - (InternalEntityEntry entry) => ReadNullableEnumU64NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => ReadNullableEnumU64NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU64NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU64NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => entry.ReadOriginalValue[][]>(nullableEnumU64NestedCollection, 172), (InternalEntityEntry entry) => entry.GetCurrentValue[][]>(nullableEnumU64NestedCollection), (ValueBuffer valueBuffer) => valueBuffer[172]); @@ -11899,15 +11912,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU64NestedCollection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer(new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU64)v1, (object)(CompiledModelTestBase.EnumU64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU64)v : default(Nullable)))), keyComparer: new ListOfReferenceTypesComparer(new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU64)v1, (object)(CompiledModelTestBase.EnumU64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU64)v : default(Nullable)))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -11931,15 +11944,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU64)v1, (object)(CompiledModelTestBase.EnumU64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU64)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU64)v1, (object)(CompiledModelTestBase.EnumU64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU64)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -11961,15 +11974,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerDecimalTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), providerValueComparer: new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "decimal(20,0)", @@ -11984,6 +11997,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (CompiledModelTestBase.EnumU64 value) => (decimal)(long)value, (decimal value) => (CompiledModelTestBase.EnumU64)(long)value))))); nullableEnumU64NestedCollection.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + nullableEnumU64NestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU64NestedCollection", "TestNamespace") }); var nullableEnumU8 = runtimeEntityType.AddProperty( "NullableEnumU8", @@ -12015,11 +12029,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU8.TypeMapping = SqlServerByteTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU8)v1, (object)(CompiledModelTestBase.EnumU8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU8)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU8)v1, (object)(CompiledModelTestBase.EnumU8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU8)v : default(Nullable)), providerValueComparer: new ValueComparer( (byte v1, byte v2) => v1 == v2, @@ -12065,15 +12079,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU8Array.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU8)v1, (object)(CompiledModelTestBase.EnumU8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU8)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU8)v1, (object)(CompiledModelTestBase.EnumU8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU8)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -12095,11 +12109,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerByteTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v), providerValueComparer: new ValueComparer( (byte v1, byte v2) => v1 == v2, @@ -12146,11 +12160,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU8AsString.TypeMapping = SqlServerByteTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU8)v1, (object)(CompiledModelTestBase.EnumU8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU8)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU8)v1, (object)(CompiledModelTestBase.EnumU8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU8)v : default(Nullable)), providerValueComparer: new ValueComparer( (byte v1, byte v2) => v1 == v2, @@ -12196,15 +12210,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU8AsStringArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU8)v1, (object)(CompiledModelTestBase.EnumU8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU8)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU8)v1, (object)(CompiledModelTestBase.EnumU8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU8)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -12226,11 +12240,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerByteTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v), providerValueComparer: new ValueComparer( (byte v1, byte v2) => v1 == v2, @@ -12276,15 +12290,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU8AsStringCollection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.EnumU8>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU8)v1, (object)(CompiledModelTestBase.EnumU8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU8)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.EnumU8>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU8)v1, (object)(CompiledModelTestBase.EnumU8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU8)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -12306,11 +12320,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerByteTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v), providerValueComparer: new ValueComparer( (byte v1, byte v2) => v1 == v2, @@ -12356,15 +12370,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU8Collection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.EnumU8>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU8)v1, (object)(CompiledModelTestBase.EnumU8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU8)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.EnumU8>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU8)v1, (object)(CompiledModelTestBase.EnumU8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU8)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -12386,11 +12400,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerByteTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v), providerValueComparer: new ValueComparer( (byte v1, byte v2) => v1 == v2, @@ -12437,15 +12451,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableFloat.TypeMapping = SqlServerFloatTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && ((float)v1).Equals((float)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((float)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(float)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(float)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && ((float)v1).Equals((float)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((float)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(float)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(float)v : default(Nullable)), providerValueComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && ((float)v1).Equals((float)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((float)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(float)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(float)v : default(Nullable))); nullableFloat.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); nullableFloat.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableFloat", "TestNamespace") }); @@ -12479,15 +12493,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableFloatArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && ((float)v1).Equals((float)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((float)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(float)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(float)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && ((float)v1).Equals((float)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((float)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(float)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(float)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -12501,15 +12515,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerFloatTypeMapping.Default.Clone( comparer: new ValueComparer( (float v1, float v2) => v1.Equals(v2), - (float v) => v.GetHashCode(), + (float v) => ((object)v).GetHashCode(), (float v) => v), keyComparer: new ValueComparer( (float v1, float v2) => v1.Equals(v2), - (float v) => v.GetHashCode(), + (float v) => ((object)v).GetHashCode(), (float v) => v), providerValueComparer: new ValueComparer( (float v1, float v2) => v1.Equals(v2), - (float v) => v.GetHashCode(), + (float v) => ((object)v).GetHashCode(), (float v) => v))); nullableFloatArray.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); nullableFloatArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableFloatArray", "TestNamespace") }); @@ -12544,15 +12558,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableGuid.TypeMapping = GuidTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (Guid)v1 == (Guid)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((Guid)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(Guid)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(Guid)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (Guid)v1 == (Guid)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((Guid)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(Guid)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(Guid)v : default(Nullable)), providerValueComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (Guid)v1 == (Guid)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((Guid)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(Guid)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(Guid)v : default(Nullable)), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "uniqueidentifier")); @@ -12588,15 +12602,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableGuidArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (Guid)v1 == (Guid)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((Guid)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(Guid)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(Guid)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (Guid)v1 == (Guid)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((Guid)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(Guid)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(Guid)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -12610,15 +12624,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: GuidTypeMapping.Default.Clone( comparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), keyComparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), providerValueComparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "uniqueidentifier"))); @@ -12631,17 +12645,17 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("NullableGuidNestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); nullableGuidNestedCollection.SetGetter( - (CompiledModelTestBase.ManyTypes entity) => ReadNullableGuidNestedCollection(entity), - (CompiledModelTestBase.ManyTypes entity) => ReadNullableGuidNestedCollection(entity) == null, - (CompiledModelTestBase.ManyTypes instance) => ReadNullableGuidNestedCollection(instance), - (CompiledModelTestBase.ManyTypes instance) => ReadNullableGuidNestedCollection(instance) == null); + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableGuidNestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableGuidNestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableGuidNestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableGuidNestedCollection(instance) == null); nullableGuidNestedCollection.SetSetter( - (CompiledModelTestBase.ManyTypes entity, Nullable[][] value) => WriteNullableGuidNestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, Nullable[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableGuidNestedCollection(entity) = value); nullableGuidNestedCollection.SetMaterializationSetter( - (CompiledModelTestBase.ManyTypes entity, Nullable[][] value) => WriteNullableGuidNestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, Nullable[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableGuidNestedCollection(entity) = value); nullableGuidNestedCollection.SetAccessors( - (InternalEntityEntry entry) => ReadNullableGuidNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => ReadNullableGuidNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableGuidNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableGuidNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => entry.ReadOriginalValue[][]>(nullableGuidNestedCollection, 183), (InternalEntityEntry entry) => entry.GetCurrentValue[][]>(nullableGuidNestedCollection), (ValueBuffer valueBuffer) => valueBuffer[183]); @@ -12654,15 +12668,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableGuidNestedCollection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer(new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (Guid)v1 == (Guid)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((Guid)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(Guid)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(Guid)v : default(Nullable)))), keyComparer: new ListOfReferenceTypesComparer(new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (Guid)v1 == (Guid)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((Guid)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(Guid)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(Guid)v : default(Nullable)))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -12678,15 +12692,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (Guid)v1 == (Guid)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((Guid)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(Guid)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(Guid)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (Guid)v1 == (Guid)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((Guid)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(Guid)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(Guid)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -12700,19 +12714,20 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: GuidTypeMapping.Default.Clone( comparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), keyComparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), providerValueComparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "uniqueidentifier")))); nullableGuidNestedCollection.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + nullableGuidNestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableGuidNestedCollection", "TestNamespace") }); var nullableIPAddress = runtimeEntityType.AddProperty( "NullableIPAddress", @@ -12744,15 +12759,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableIPAddress.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), keyComparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(45)", @@ -12760,12 +12775,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)))); nullableIPAddress.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); nullableIPAddress.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableIPAddress", "TestNamespace") }); @@ -12799,15 +12814,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableIPAddressArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -12817,27 +12832,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)))), elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), keyComparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(45)", @@ -12845,12 +12860,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))); nullableIPAddressArray.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); nullableIPAddressArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableIPAddressArray", "TestNamespace") }); @@ -12935,7 +12950,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -13042,7 +13057,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -13075,17 +13090,17 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("NullableInt32NestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); nullableInt32NestedCollection.SetGetter( - (CompiledModelTestBase.ManyTypes entity) => ReadNullableInt32NestedCollection(entity), - (CompiledModelTestBase.ManyTypes entity) => ReadNullableInt32NestedCollection(entity) == null, - (CompiledModelTestBase.ManyTypes instance) => ReadNullableInt32NestedCollection(instance), - (CompiledModelTestBase.ManyTypes instance) => ReadNullableInt32NestedCollection(instance) == null); + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt32NestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt32NestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt32NestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt32NestedCollection(instance) == null); nullableInt32NestedCollection.SetSetter( - (CompiledModelTestBase.ManyTypes entity, Nullable[][] value) => WriteNullableInt32NestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, Nullable[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt32NestedCollection(entity) = value); nullableInt32NestedCollection.SetMaterializationSetter( - (CompiledModelTestBase.ManyTypes entity, Nullable[][] value) => WriteNullableInt32NestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, Nullable[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt32NestedCollection(entity) = value); nullableInt32NestedCollection.SetAccessors( - (InternalEntityEntry entry) => ReadNullableInt32NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => ReadNullableInt32NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt32NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt32NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => entry.ReadOriginalValue[][]>(nullableInt32NestedCollection, 190), (InternalEntityEntry entry) => entry.GetCurrentValue[][]>(nullableInt32NestedCollection), (ValueBuffer valueBuffer) => valueBuffer[190]); @@ -13106,7 +13121,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable)))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -13130,7 +13145,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -13155,6 +13170,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (int v) => v, (int v) => v)))); nullableInt32NestedCollection.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + nullableInt32NestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt32NestedCollection", "TestNamespace") }); var nullableInt64 = runtimeEntityType.AddProperty( "NullableInt64", @@ -13186,15 +13202,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableInt64.TypeMapping = SqlServerLongTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable)), providerValueComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable))); nullableInt64.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); nullableInt64.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt64", "TestNamespace") }); @@ -13228,15 +13244,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableInt64Array.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -13250,15 +13266,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerLongTypeMapping.Default.Clone( comparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), keyComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v))); nullableInt64Array.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); nullableInt64Array.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt64Array", "TestNamespace") }); @@ -13269,17 +13285,17 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("NullableInt64NestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); nullableInt64NestedCollection.SetGetter( - (CompiledModelTestBase.ManyTypes entity) => ReadNullableInt64NestedCollection(entity), - (CompiledModelTestBase.ManyTypes entity) => ReadNullableInt64NestedCollection(entity) == null, - (CompiledModelTestBase.ManyTypes instance) => ReadNullableInt64NestedCollection(instance), - (CompiledModelTestBase.ManyTypes instance) => ReadNullableInt64NestedCollection(instance) == null); + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt64NestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt64NestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt64NestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt64NestedCollection(instance) == null); nullableInt64NestedCollection.SetSetter( - (CompiledModelTestBase.ManyTypes entity, List[][]> value) => WriteNullableInt64NestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, List[][]> value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt64NestedCollection(entity) = value); nullableInt64NestedCollection.SetMaterializationSetter( - (CompiledModelTestBase.ManyTypes entity, List[][]> value) => WriteNullableInt64NestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, List[][]> value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt64NestedCollection(entity) = value); nullableInt64NestedCollection.SetAccessors( - (InternalEntityEntry entry) => ReadNullableInt64NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => ReadNullableInt64NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt64NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt64NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => entry.ReadOriginalValue[][]>>(nullableInt64NestedCollection, 193), (InternalEntityEntry entry) => entry.GetCurrentValue[][]>>(nullableInt64NestedCollection), (ValueBuffer valueBuffer) => valueBuffer[193]); @@ -13292,15 +13308,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableInt64NestedCollection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer, long?[][]>(new ListOfReferenceTypesComparer(new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable))))), keyComparer: new ListOfReferenceTypesComparer, long?[][]>(new ListOfReferenceTypesComparer(new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable))))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -13318,15 +13334,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer(new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable)))), keyComparer: new ListOfReferenceTypesComparer(new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable)))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -13342,15 +13358,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -13364,17 +13380,18 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerLongTypeMapping.Default.Clone( comparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), keyComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v))))); nullableInt64NestedCollection.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + nullableInt64NestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt64NestedCollection", "TestNamespace") }); var nullableInt8 = runtimeEntityType.AddProperty( "NullableInt8", @@ -13464,7 +13481,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (Nullable v) => v.HasValue ? (Nullable)(sbyte)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -13537,15 +13554,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullablePhysicalAddress.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), - (PhysicalAddress v) => v.GetHashCode(), + (PhysicalAddress v) => ((object)v).GetHashCode(), (PhysicalAddress v) => v), keyComparer: new ValueComparer( (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), - (PhysicalAddress v) => v.GetHashCode(), + (PhysicalAddress v) => ((object)v).GetHashCode(), (PhysicalAddress v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(20)", @@ -13553,12 +13570,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (PhysicalAddress v) => v.ToString(), + (PhysicalAddress v) => ((object)v).ToString(), (string v) => PhysicalAddress.Parse(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (PhysicalAddress v) => v.ToString(), + (PhysicalAddress v) => ((object)v).ToString(), (string v) => PhysicalAddress.Parse(v)))); nullablePhysicalAddress.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); nullablePhysicalAddress.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullablePhysicalAddress", "TestNamespace") }); @@ -13592,15 +13609,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullablePhysicalAddressArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer(new ValueComparer( (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), - (PhysicalAddress v) => v.GetHashCode(), + (PhysicalAddress v) => ((object)v).GetHashCode(), (PhysicalAddress v) => v)), keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), - (PhysicalAddress v) => v.GetHashCode(), + (PhysicalAddress v) => ((object)v).GetHashCode(), (PhysicalAddress v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -13610,27 +13627,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (PhysicalAddress v) => v.ToString(), + (PhysicalAddress v) => ((object)v).ToString(), (string v) => PhysicalAddress.Parse(v))))), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (PhysicalAddress v) => v.ToString(), + (PhysicalAddress v) => ((object)v).ToString(), (string v) => PhysicalAddress.Parse(v)))), elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), - (PhysicalAddress v) => v.GetHashCode(), + (PhysicalAddress v) => ((object)v).GetHashCode(), (PhysicalAddress v) => v), keyComparer: new ValueComparer( (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), - (PhysicalAddress v) => v.GetHashCode(), + (PhysicalAddress v) => ((object)v).GetHashCode(), (PhysicalAddress v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(20)", @@ -13638,12 +13655,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (PhysicalAddress v) => v.ToString(), + (PhysicalAddress v) => ((object)v).ToString(), (string v) => PhysicalAddress.Parse(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (PhysicalAddress v) => v.ToString(), + (PhysicalAddress v) => ((object)v).ToString(), (string v) => PhysicalAddress.Parse(v))))); nullablePhysicalAddressArray.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); nullablePhysicalAddressArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullablePhysicalAddressArray", "TestNamespace") }); @@ -13654,17 +13671,17 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("NullablePhysicalAddressNestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); nullablePhysicalAddressNestedCollection.SetGetter( - (CompiledModelTestBase.ManyTypes entity) => ReadNullablePhysicalAddressNestedCollection(entity), - (CompiledModelTestBase.ManyTypes entity) => ReadNullablePhysicalAddressNestedCollection(entity) == null, - (CompiledModelTestBase.ManyTypes instance) => ReadNullablePhysicalAddressNestedCollection(instance), - (CompiledModelTestBase.ManyTypes instance) => ReadNullablePhysicalAddressNestedCollection(instance) == null); + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullablePhysicalAddressNestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullablePhysicalAddressNestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullablePhysicalAddressNestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullablePhysicalAddressNestedCollection(instance) == null); nullablePhysicalAddressNestedCollection.SetSetter( - (CompiledModelTestBase.ManyTypes entity, IEnumerable value) => WriteNullablePhysicalAddressNestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, IEnumerable value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullablePhysicalAddressNestedCollection(entity) = value); nullablePhysicalAddressNestedCollection.SetMaterializationSetter( - (CompiledModelTestBase.ManyTypes entity, IEnumerable value) => WriteNullablePhysicalAddressNestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, IEnumerable value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullablePhysicalAddressNestedCollection(entity) = value); nullablePhysicalAddressNestedCollection.SetAccessors( - (InternalEntityEntry entry) => ReadNullablePhysicalAddressNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => ReadNullablePhysicalAddressNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullablePhysicalAddressNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullablePhysicalAddressNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullablePhysicalAddressNestedCollection, 198), (InternalEntityEntry entry) => entry.GetCurrentValue>(nullablePhysicalAddressNestedCollection), (ValueBuffer valueBuffer) => valueBuffer[198]); @@ -13677,15 +13694,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullablePhysicalAddressNestedCollection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer, PhysicalAddress[][]>(new ListOfReferenceTypesComparer(new ListOfReferenceTypesComparer(new ValueComparer( (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), - (PhysicalAddress v) => v.GetHashCode(), + (PhysicalAddress v) => ((object)v).GetHashCode(), (PhysicalAddress v) => v)))), keyComparer: new ListOfReferenceTypesComparer, PhysicalAddress[][]>(new ListOfReferenceTypesComparer(new ListOfReferenceTypesComparer(new ValueComparer( (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), - (PhysicalAddress v) => v.GetHashCode(), + (PhysicalAddress v) => ((object)v).GetHashCode(), (PhysicalAddress v) => v)))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -13697,7 +13714,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (PhysicalAddress v) => v.ToString(), + (PhysicalAddress v) => ((object)v).ToString(), (string v) => PhysicalAddress.Parse(v))))))), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter, PhysicalAddress[][]>( @@ -13706,20 +13723,20 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (PhysicalAddress v) => v.ToString(), + (PhysicalAddress v) => ((object)v).ToString(), (string v) => PhysicalAddress.Parse(v)))))), elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer(new ListOfReferenceTypesComparer(new ValueComparer( (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), - (PhysicalAddress v) => v.GetHashCode(), + (PhysicalAddress v) => ((object)v).GetHashCode(), (PhysicalAddress v) => v))), keyComparer: new ListOfReferenceTypesComparer(new ListOfReferenceTypesComparer(new ValueComparer( (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), - (PhysicalAddress v) => v.GetHashCode(), + (PhysicalAddress v) => ((object)v).GetHashCode(), (PhysicalAddress v) => v))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -13730,7 +13747,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (PhysicalAddress v) => v.ToString(), + (PhysicalAddress v) => ((object)v).ToString(), (string v) => PhysicalAddress.Parse(v)))))), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( @@ -13738,20 +13755,20 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (PhysicalAddress v) => v.ToString(), + (PhysicalAddress v) => ((object)v).ToString(), (string v) => PhysicalAddress.Parse(v))))), elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer(new ValueComparer( (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), - (PhysicalAddress v) => v.GetHashCode(), + (PhysicalAddress v) => ((object)v).GetHashCode(), (PhysicalAddress v) => v)), keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), - (PhysicalAddress v) => v.GetHashCode(), + (PhysicalAddress v) => ((object)v).GetHashCode(), (PhysicalAddress v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -13761,27 +13778,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (PhysicalAddress v) => v.ToString(), + (PhysicalAddress v) => ((object)v).ToString(), (string v) => PhysicalAddress.Parse(v))))), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (PhysicalAddress v) => v.ToString(), + (PhysicalAddress v) => ((object)v).ToString(), (string v) => PhysicalAddress.Parse(v)))), elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), - (PhysicalAddress v) => v.GetHashCode(), + (PhysicalAddress v) => ((object)v).GetHashCode(), (PhysicalAddress v) => v), keyComparer: new ValueComparer( (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), - (PhysicalAddress v) => v.GetHashCode(), + (PhysicalAddress v) => ((object)v).GetHashCode(), (PhysicalAddress v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(20)", @@ -13789,14 +13806,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (PhysicalAddress v) => v.ToString(), + (PhysicalAddress v) => ((object)v).ToString(), (string v) => PhysicalAddress.Parse(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (PhysicalAddress v) => v.ToString(), + (PhysicalAddress v) => ((object)v).ToString(), (string v) => PhysicalAddress.Parse(v))))))); nullablePhysicalAddressNestedCollection.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + nullablePhysicalAddressNestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullablePhysicalAddressNestedCollection", "TestNamespace") }); var nullableString = runtimeEntityType.AddProperty( "NullableString", @@ -13828,15 +13846,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableString.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -13875,15 +13893,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableStringArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -13897,15 +13915,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -13921,17 +13939,17 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("NullableStringNestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); nullableStringNestedCollection.SetGetter( - (CompiledModelTestBase.ManyTypes entity) => ReadNullableStringNestedCollection(entity), - (CompiledModelTestBase.ManyTypes entity) => ReadNullableStringNestedCollection(entity) == null, - (CompiledModelTestBase.ManyTypes instance) => ReadNullableStringNestedCollection(instance), - (CompiledModelTestBase.ManyTypes instance) => ReadNullableStringNestedCollection(instance) == null); + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableStringNestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableStringNestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableStringNestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableStringNestedCollection(instance) == null); nullableStringNestedCollection.SetSetter( - (CompiledModelTestBase.ManyTypes entity, string[][] value) => WriteNullableStringNestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, string[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableStringNestedCollection(entity) = value); nullableStringNestedCollection.SetMaterializationSetter( - (CompiledModelTestBase.ManyTypes entity, string[][] value) => WriteNullableStringNestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, string[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableStringNestedCollection(entity) = value); nullableStringNestedCollection.SetAccessors( - (InternalEntityEntry entry) => ReadNullableStringNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => ReadNullableStringNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableStringNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableStringNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => entry.ReadOriginalValue(nullableStringNestedCollection, 201), (InternalEntityEntry entry) => entry.GetCurrentValue(nullableStringNestedCollection), (ValueBuffer valueBuffer) => valueBuffer[201]); @@ -13944,15 +13962,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableStringNestedCollection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer(new ListOfReferenceTypesComparer(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v))), keyComparer: new ListOfReferenceTypesComparer(new ListOfReferenceTypesComparer(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -13968,15 +13986,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -13990,15 +14008,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -14006,6 +14024,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas dbType: System.Data.DbType.String), storeTypePostfix: StoreTypePostfix.None))); nullableStringNestedCollection.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + nullableStringNestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableStringNestedCollection", "TestNamespace") }); var nullableTimeOnly = runtimeEntityType.AddProperty( "NullableTimeOnly", @@ -14037,15 +14056,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableTimeOnly.TypeMapping = SqlServerTimeOnlyTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (TimeOnly)v1 == (TimeOnly)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((TimeOnly)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(TimeOnly)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(TimeOnly)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (TimeOnly)v1 == (TimeOnly)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((TimeOnly)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(TimeOnly)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(TimeOnly)v : default(Nullable)), providerValueComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (TimeOnly)v1 == (TimeOnly)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((TimeOnly)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(TimeOnly)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(TimeOnly)v : default(Nullable))); nullableTimeOnly.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); nullableTimeOnly.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableTimeOnly", "TestNamespace") }); @@ -14079,15 +14098,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableTimeOnlyArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (TimeOnly)v1 == (TimeOnly)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((TimeOnly)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(TimeOnly)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(TimeOnly)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (TimeOnly)v1 == (TimeOnly)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((TimeOnly)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(TimeOnly)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(TimeOnly)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -14101,15 +14120,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerTimeOnlyTypeMapping.Default.Clone( comparer: new ValueComparer( (TimeOnly v1, TimeOnly v2) => v1.Equals(v2), - (TimeOnly v) => v.GetHashCode(), + (TimeOnly v) => ((object)v).GetHashCode(), (TimeOnly v) => v), keyComparer: new ValueComparer( (TimeOnly v1, TimeOnly v2) => v1.Equals(v2), - (TimeOnly v) => v.GetHashCode(), + (TimeOnly v) => ((object)v).GetHashCode(), (TimeOnly v) => v), providerValueComparer: new ValueComparer( (TimeOnly v1, TimeOnly v2) => v1.Equals(v2), - (TimeOnly v) => v.GetHashCode(), + (TimeOnly v) => ((object)v).GetHashCode(), (TimeOnly v) => v))); nullableTimeOnlyArray.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); nullableTimeOnlyArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableTimeOnlyArray", "TestNamespace") }); @@ -14144,15 +14163,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableTimeSpan.TypeMapping = SqlServerTimeSpanTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (TimeSpan)v1 == (TimeSpan)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((TimeSpan)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(TimeSpan)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(TimeSpan)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (TimeSpan)v1 == (TimeSpan)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((TimeSpan)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(TimeSpan)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(TimeSpan)v : default(Nullable)), providerValueComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (TimeSpan)v1 == (TimeSpan)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((TimeSpan)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(TimeSpan)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(TimeSpan)v : default(Nullable))); nullableTimeSpan.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); nullableTimeSpan.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableTimeSpan", "TestNamespace") }); @@ -14186,15 +14205,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableTimeSpanArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (TimeSpan)v1 == (TimeSpan)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((TimeSpan)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(TimeSpan)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(TimeSpan)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (TimeSpan)v1 == (TimeSpan)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((TimeSpan)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(TimeSpan)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(TimeSpan)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -14208,15 +14227,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerTimeSpanTypeMapping.Default.Clone( comparer: new ValueComparer( (TimeSpan v1, TimeSpan v2) => v1.Equals(v2), - (TimeSpan v) => v.GetHashCode(), + (TimeSpan v) => ((object)v).GetHashCode(), (TimeSpan v) => v), keyComparer: new ValueComparer( (TimeSpan v1, TimeSpan v2) => v1.Equals(v2), - (TimeSpan v) => v.GetHashCode(), + (TimeSpan v) => ((object)v).GetHashCode(), (TimeSpan v) => v), providerValueComparer: new ValueComparer( (TimeSpan v1, TimeSpan v2) => v1.Equals(v2), - (TimeSpan v) => v.GetHashCode(), + (TimeSpan v) => ((object)v).GetHashCode(), (TimeSpan v) => v))); nullableTimeSpanArray.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); nullableTimeSpanArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableTimeSpanArray", "TestNamespace") }); @@ -14309,7 +14328,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (Nullable v) => v.HasValue ? (Nullable)(ushort)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -14390,7 +14409,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (Nullable v) => v.HasValue ? (Nullable)(uint)v : default(Nullable)), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), converter: new ValueConverter( (uint v) => (long)v, @@ -14440,7 +14459,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (Nullable v) => v.HasValue ? (Nullable)(uint)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -14470,7 +14489,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (uint v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), converter: new ValueConverter( (uint v) => (long)v, @@ -14513,15 +14532,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableUInt64.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (ulong)v1 == (ulong)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((ulong)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(ulong)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(ulong)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (ulong)v1 == (ulong)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((ulong)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(ulong)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(ulong)v : default(Nullable)), providerValueComparer: new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "decimal(20,0)", @@ -14567,15 +14586,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableUInt64Array.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (ulong)v1 == (ulong)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((ulong)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(ulong)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(ulong)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (ulong)v1 == (ulong)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((ulong)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(ulong)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(ulong)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -14597,15 +14616,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerDecimalTypeMapping.Default.Clone( comparer: new ValueComparer( (ulong v1, ulong v2) => v1 == v2, - (ulong v) => v.GetHashCode(), + (ulong v) => ((object)v).GetHashCode(), (ulong v) => v), keyComparer: new ValueComparer( (ulong v1, ulong v2) => v1 == v2, - (ulong v) => v.GetHashCode(), + (ulong v) => ((object)v).GetHashCode(), (ulong v) => v), providerValueComparer: new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "decimal(20,0)", @@ -14702,7 +14721,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (Nullable v) => v.HasValue ? (Nullable)(byte)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -14735,17 +14754,17 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("NullableUInt8NestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); nullableUInt8NestedCollection.SetGetter( - (CompiledModelTestBase.ManyTypes entity) => ReadNullableUInt8NestedCollection(entity), - (CompiledModelTestBase.ManyTypes entity) => ReadNullableUInt8NestedCollection(entity) == null, - (CompiledModelTestBase.ManyTypes instance) => ReadNullableUInt8NestedCollection(instance), - (CompiledModelTestBase.ManyTypes instance) => ReadNullableUInt8NestedCollection(instance) == null); + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUInt8NestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUInt8NestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUInt8NestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUInt8NestedCollection(instance) == null); nullableUInt8NestedCollection.SetSetter( - (CompiledModelTestBase.ManyTypes entity, Nullable[][] value) => WriteNullableUInt8NestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, Nullable[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUInt8NestedCollection(entity) = value); nullableUInt8NestedCollection.SetMaterializationSetter( - (CompiledModelTestBase.ManyTypes entity, Nullable[][] value) => WriteNullableUInt8NestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, Nullable[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUInt8NestedCollection(entity) = value); nullableUInt8NestedCollection.SetAccessors( - (InternalEntityEntry entry) => ReadNullableUInt8NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => ReadNullableUInt8NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUInt8NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUInt8NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => entry.ReadOriginalValue[][]>(nullableUInt8NestedCollection, 214), (InternalEntityEntry entry) => entry.GetCurrentValue[][]>(nullableUInt8NestedCollection), (ValueBuffer valueBuffer) => valueBuffer[214]); @@ -14766,7 +14785,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (Nullable v) => v.HasValue ? (Nullable)(byte)v : default(Nullable)))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -14790,7 +14809,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (Nullable v) => v.HasValue ? (Nullable)(byte)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -14815,6 +14834,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (byte v) => (int)v, (byte v) => v)))); nullableUInt8NestedCollection.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + nullableUInt8NestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUInt8NestedCollection", "TestNamespace") }); var nullableUri = runtimeEntityType.AddProperty( "NullableUri", @@ -14846,28 +14866,28 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableUri.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (Uri v1, Uri v2) => v1 == v2, - (Uri v) => v.GetHashCode(), + (Uri v) => ((object)v).GetHashCode(), (Uri v) => v), keyComparer: new ValueComparer( (Uri v1, Uri v2) => v1 == v2, - (Uri v) => v.GetHashCode(), + (Uri v) => ((object)v).GetHashCode(), (Uri v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (Uri v) => v.ToString(), + (Uri v) => ((object)v).ToString(), (string v) => new Uri(v, UriKind.RelativeOrAbsolute)), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (Uri v) => v.ToString(), + (Uri v) => ((object)v).ToString(), (string v) => new Uri(v, UriKind.RelativeOrAbsolute)))); nullableUri.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); nullableUri.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUri", "TestNamespace") }); @@ -14901,15 +14921,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableUriArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer(new ValueComparer( (Uri v1, Uri v2) => v1 == v2, - (Uri v) => v.GetHashCode(), + (Uri v) => ((object)v).GetHashCode(), (Uri v) => v)), keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( (Uri v1, Uri v2) => v1 == v2, - (Uri v) => v.GetHashCode(), + (Uri v) => ((object)v).GetHashCode(), (Uri v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -14919,40 +14939,40 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (Uri v) => v.ToString(), + (Uri v) => ((object)v).ToString(), (string v) => new Uri(v, UriKind.RelativeOrAbsolute))))), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (Uri v) => v.ToString(), + (Uri v) => ((object)v).ToString(), (string v) => new Uri(v, UriKind.RelativeOrAbsolute)))), elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (Uri v1, Uri v2) => v1 == v2, - (Uri v) => v.GetHashCode(), + (Uri v) => ((object)v).GetHashCode(), (Uri v) => v), keyComparer: new ValueComparer( (Uri v1, Uri v2) => v1 == v2, - (Uri v) => v.GetHashCode(), + (Uri v) => ((object)v).GetHashCode(), (Uri v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (Uri v) => v.ToString(), + (Uri v) => ((object)v).ToString(), (string v) => new Uri(v, UriKind.RelativeOrAbsolute)), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (Uri v) => v.ToString(), + (Uri v) => ((object)v).ToString(), (string v) => new Uri(v, UriKind.RelativeOrAbsolute))))); nullableUriArray.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); nullableUriArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUriArray", "TestNamespace") }); @@ -14986,15 +15006,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas physicalAddress.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), - (PhysicalAddress v) => v.GetHashCode(), + (PhysicalAddress v) => ((object)v).GetHashCode(), (PhysicalAddress v) => v), keyComparer: new ValueComparer( (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), - (PhysicalAddress v) => v.GetHashCode(), + (PhysicalAddress v) => ((object)v).GetHashCode(), (PhysicalAddress v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(20)", @@ -15002,12 +15022,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (PhysicalAddress v) => v.ToString(), + (PhysicalAddress v) => ((object)v).ToString(), (string v) => PhysicalAddress.Parse(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (PhysicalAddress v) => v.ToString(), + (PhysicalAddress v) => ((object)v).ToString(), (string v) => PhysicalAddress.Parse(v)))); physicalAddress.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); physicalAddress.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_PhysicalAddress", "TestNamespace") }); @@ -15041,15 +15061,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas physicalAddressArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer(new ValueComparer( (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), - (PhysicalAddress v) => v.GetHashCode(), + (PhysicalAddress v) => ((object)v).GetHashCode(), (PhysicalAddress v) => v)), keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), - (PhysicalAddress v) => v.GetHashCode(), + (PhysicalAddress v) => ((object)v).GetHashCode(), (PhysicalAddress v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -15059,27 +15079,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (PhysicalAddress v) => v.ToString(), + (PhysicalAddress v) => ((object)v).ToString(), (string v) => PhysicalAddress.Parse(v))))), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (PhysicalAddress v) => v.ToString(), + (PhysicalAddress v) => ((object)v).ToString(), (string v) => PhysicalAddress.Parse(v)))), elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), - (PhysicalAddress v) => v.GetHashCode(), + (PhysicalAddress v) => ((object)v).GetHashCode(), (PhysicalAddress v) => v), keyComparer: new ValueComparer( (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), - (PhysicalAddress v) => v.GetHashCode(), + (PhysicalAddress v) => ((object)v).GetHashCode(), (PhysicalAddress v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(20)", @@ -15087,12 +15107,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (PhysicalAddress v) => v.ToString(), + (PhysicalAddress v) => ((object)v).ToString(), (string v) => PhysicalAddress.Parse(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (PhysicalAddress v) => v.ToString(), + (PhysicalAddress v) => ((object)v).ToString(), (string v) => PhysicalAddress.Parse(v))))); physicalAddressArray.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); physicalAddressArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_PhysicalAddressArray", "TestNamespace") }); @@ -15127,11 +15147,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas physicalAddressToBytesConverterProperty.TypeMapping = SqlServerByteArrayTypeMapping.Default.Clone( comparer: new ValueComparer( (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), - (PhysicalAddress v) => v.GetHashCode(), + (PhysicalAddress v) => ((object)v).GetHashCode(), (PhysicalAddress v) => v), keyComparer: new ValueComparer( (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), - (PhysicalAddress v) => v.GetHashCode(), + (PhysicalAddress v) => ((object)v).GetHashCode(), (PhysicalAddress v) => v), providerValueComparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), @@ -15181,15 +15201,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas physicalAddressToStringConverterProperty.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), - (PhysicalAddress v) => v.GetHashCode(), + (PhysicalAddress v) => ((object)v).GetHashCode(), (PhysicalAddress v) => v), keyComparer: new ValueComparer( (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), - (PhysicalAddress v) => v.GetHashCode(), + (PhysicalAddress v) => ((object)v).GetHashCode(), (PhysicalAddress v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(20)", @@ -15197,12 +15217,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (PhysicalAddress v) => v.ToString(), + (PhysicalAddress v) => ((object)v).ToString(), (string v) => PhysicalAddress.Parse(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (PhysicalAddress v) => v.ToString(), + (PhysicalAddress v) => ((object)v).ToString(), (string v) => PhysicalAddress.Parse(v)))); physicalAddressToStringConverterProperty.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); physicalAddressToStringConverterProperty.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_PhysicalAddressToStringConverterProperty", "TestNamespace") }); @@ -15236,15 +15256,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas @string.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -15283,15 +15303,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas stringArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -15305,15 +15325,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -15329,17 +15349,17 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("StringNestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); stringNestedCollection.SetGetter( - (CompiledModelTestBase.ManyTypes entity) => ReadStringNestedCollection(entity), - (CompiledModelTestBase.ManyTypes entity) => ReadStringNestedCollection(entity) == null, - (CompiledModelTestBase.ManyTypes instance) => ReadStringNestedCollection(instance), - (CompiledModelTestBase.ManyTypes instance) => ReadStringNestedCollection(instance) == null); + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringNestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringNestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringNestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringNestedCollection(instance) == null); stringNestedCollection.SetSetter( - (CompiledModelTestBase.ManyTypes entity, string[][] value) => WriteStringNestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, string[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringNestedCollection(entity) = value); stringNestedCollection.SetMaterializationSetter( - (CompiledModelTestBase.ManyTypes entity, string[][] value) => WriteStringNestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, string[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringNestedCollection(entity) = value); stringNestedCollection.SetAccessors( - (InternalEntityEntry entry) => ReadStringNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => ReadStringNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => entry.ReadOriginalValue(stringNestedCollection, 223), (InternalEntityEntry entry) => entry.GetCurrentValue(stringNestedCollection), (ValueBuffer valueBuffer) => valueBuffer[223]); @@ -15352,15 +15372,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas stringNestedCollection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer(new ListOfReferenceTypesComparer(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v))), keyComparer: new ListOfReferenceTypesComparer(new ListOfReferenceTypesComparer(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -15376,15 +15396,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -15398,15 +15418,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -15414,6 +15434,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas dbType: System.Data.DbType.String), storeTypePostfix: StoreTypePostfix.None))); stringNestedCollection.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + stringNestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringNestedCollection", "TestNamespace") }); var stringToBoolConverterProperty = runtimeEntityType.AddProperty( "StringToBoolConverterProperty", @@ -15445,15 +15466,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas stringToBoolConverterProperty.TypeMapping = SqlServerBoolTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v), converter: new ValueConverter( (string v) => Convert.ToBoolean(v), @@ -15496,11 +15517,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas stringToBytesConverterProperty.TypeMapping = SqlServerByteArrayTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), @@ -15509,14 +15530,14 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "varbinary(max)"), converter: new ValueConverter( - (string v) => Encoding.UTF32.GetBytes(v), - (byte[] v) => Encoding.UTF32.GetString(v)), + (string v) => Encoding.GetEncoding(12000).GetBytes(v), + (byte[] v) => Encoding.GetEncoding(12000).GetString(v)), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonByteArrayReaderWriter.Instance, new ValueConverter( - (string v) => Encoding.UTF32.GetBytes(v), - (byte[] v) => Encoding.UTF32.GetString(v)))); + (string v) => Encoding.GetEncoding(12000).GetBytes(v), + (byte[] v) => Encoding.GetEncoding(12000).GetString(v)))); stringToBytesConverterProperty.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); stringToBytesConverterProperty.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringToBytesConverterProperty", "TestNamespace") }); @@ -15550,15 +15571,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas stringToCharConverterProperty.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(1)", @@ -15606,15 +15627,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas stringToDateOnlyConverterProperty.TypeMapping = SqlServerDateOnlyTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (DateOnly v1, DateOnly v2) => v1.Equals(v2), - (DateOnly v) => v.GetHashCode(), + (DateOnly v) => ((object)v).GetHashCode(), (DateOnly v) => v), mappingInfo: new RelationalTypeMappingInfo( size: 10), @@ -15659,15 +15680,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas stringToDateTimeConverterProperty.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v), mappingInfo: new RelationalTypeMappingInfo( size: 48), @@ -15712,15 +15733,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas stringToDateTimeOffsetConverterProperty.TypeMapping = SqlServerDateTimeOffsetTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (DateTimeOffset v1, DateTimeOffset v2) => v1.EqualsExact(v2), - (DateTimeOffset v) => v.GetHashCode(), + (DateTimeOffset v) => ((object)v).GetHashCode(), (DateTimeOffset v) => v), mappingInfo: new RelationalTypeMappingInfo( size: 48), @@ -15765,15 +15786,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas stringToDecimalNumberConverterProperty.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v), mappingInfo: new RelationalTypeMappingInfo( size: 64), @@ -15818,15 +15839,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas stringToDoubleNumberConverterProperty.TypeMapping = SqlServerDoubleTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (double v1, double v2) => v1.Equals(v2), - (double v) => v.GetHashCode(), + (double v) => ((object)v).GetHashCode(), (double v) => v), mappingInfo: new RelationalTypeMappingInfo( size: 64), @@ -15871,24 +15892,24 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas stringToEnumConverterProperty.TypeMapping = SqlServerLongTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), converter: new ValueConverter( (string v) => (long)StringEnumConverter.ConvertToEnum(v), - (long value) => ((CompiledModelTestBase.EnumU32)value).ToString()), + (long value) => ((object)(CompiledModelTestBase.EnumU32)value).ToString()), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonInt64ReaderWriter.Instance, new ValueConverter( (string v) => (long)StringEnumConverter.ConvertToEnum(v), - (long value) => ((CompiledModelTestBase.EnumU32)value).ToString()))); + (long value) => ((object)(CompiledModelTestBase.EnumU32)value).ToString()))); stringToEnumConverterProperty.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); stringToEnumConverterProperty.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringToEnumConverterProperty", "TestNamespace") }); @@ -15921,15 +15942,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas stringToGuidConverterProperty.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -15969,11 +15990,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas stringToIntNumberConverterProperty.TypeMapping = IntTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -16022,15 +16043,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas stringToTimeOnlyConverterProperty.TypeMapping = SqlServerTimeOnlyTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (TimeOnly v1, TimeOnly v2) => v1.Equals(v2), - (TimeOnly v) => v.GetHashCode(), + (TimeOnly v) => ((object)v).GetHashCode(), (TimeOnly v) => v), mappingInfo: new RelationalTypeMappingInfo( size: 48), @@ -16075,15 +16096,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas stringToTimeSpanConverterProperty.TypeMapping = SqlServerTimeSpanTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (TimeSpan v1, TimeSpan v2) => v1.Equals(v2), - (TimeSpan v) => v.GetHashCode(), + (TimeSpan v) => ((object)v).GetHashCode(), (TimeSpan v) => v), mappingInfo: new RelationalTypeMappingInfo( size: 48), @@ -16128,29 +16149,29 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas stringToUriConverterProperty.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (string v) => new Uri(v, UriKind.RelativeOrAbsolute).ToString(), - (string v) => new Uri(v, UriKind.RelativeOrAbsolute).ToString()), + (string v) => ((object)new Uri(v, UriKind.RelativeOrAbsolute)).ToString(), + (string v) => ((object)new Uri(v, UriKind.RelativeOrAbsolute)).ToString()), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (string v) => new Uri(v, UriKind.RelativeOrAbsolute).ToString(), - (string v) => new Uri(v, UriKind.RelativeOrAbsolute).ToString()))); + (string v) => ((object)new Uri(v, UriKind.RelativeOrAbsolute)).ToString(), + (string v) => ((object)new Uri(v, UriKind.RelativeOrAbsolute)).ToString()))); stringToUriConverterProperty.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); stringToUriConverterProperty.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringToUriConverterProperty", "TestNamespace") }); @@ -16184,15 +16205,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas timeOnly.TypeMapping = SqlServerTimeOnlyTypeMapping.Default.Clone( comparer: new ValueComparer( (TimeOnly v1, TimeOnly v2) => v1.Equals(v2), - (TimeOnly v) => v.GetHashCode(), + (TimeOnly v) => ((object)v).GetHashCode(), (TimeOnly v) => v), keyComparer: new ValueComparer( (TimeOnly v1, TimeOnly v2) => v1.Equals(v2), - (TimeOnly v) => v.GetHashCode(), + (TimeOnly v) => ((object)v).GetHashCode(), (TimeOnly v) => v), providerValueComparer: new ValueComparer( (TimeOnly v1, TimeOnly v2) => v1.Equals(v2), - (TimeOnly v) => v.GetHashCode(), + (TimeOnly v) => ((object)v).GetHashCode(), (TimeOnly v) => v)); timeOnly.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); timeOnly.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_TimeOnly", "TestNamespace") }); @@ -16226,15 +16247,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas timeOnlyArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer(new ValueComparer( (TimeOnly v1, TimeOnly v2) => v1.Equals(v2), - (TimeOnly v) => v.GetHashCode(), + (TimeOnly v) => ((object)v).GetHashCode(), (TimeOnly v) => v)), keyComparer: new ListOfValueTypesComparer(new ValueComparer( (TimeOnly v1, TimeOnly v2) => v1.Equals(v2), - (TimeOnly v) => v.GetHashCode(), + (TimeOnly v) => ((object)v).GetHashCode(), (TimeOnly v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -16248,15 +16269,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerTimeOnlyTypeMapping.Default.Clone( comparer: new ValueComparer( (TimeOnly v1, TimeOnly v2) => v1.Equals(v2), - (TimeOnly v) => v.GetHashCode(), + (TimeOnly v) => ((object)v).GetHashCode(), (TimeOnly v) => v), keyComparer: new ValueComparer( (TimeOnly v1, TimeOnly v2) => v1.Equals(v2), - (TimeOnly v) => v.GetHashCode(), + (TimeOnly v) => ((object)v).GetHashCode(), (TimeOnly v) => v), providerValueComparer: new ValueComparer( (TimeOnly v1, TimeOnly v2) => v1.Equals(v2), - (TimeOnly v) => v.GetHashCode(), + (TimeOnly v) => ((object)v).GetHashCode(), (TimeOnly v) => v))); timeOnlyArray.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); timeOnlyArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_TimeOnlyArray", "TestNamespace") }); @@ -16291,15 +16312,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas timeOnlyToStringConverterProperty.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (TimeOnly v1, TimeOnly v2) => v1.Equals(v2), - (TimeOnly v) => v.GetHashCode(), + (TimeOnly v) => ((object)v).GetHashCode(), (TimeOnly v) => v), keyComparer: new ValueComparer( (TimeOnly v1, TimeOnly v2) => v1.Equals(v2), - (TimeOnly v) => v.GetHashCode(), + (TimeOnly v) => ((object)v).GetHashCode(), (TimeOnly v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(48)", @@ -16348,15 +16369,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas timeOnlyToTicksConverterProperty.TypeMapping = SqlServerLongTypeMapping.Default.Clone( comparer: new ValueComparer( (TimeOnly v1, TimeOnly v2) => v1.Equals(v2), - (TimeOnly v) => v.GetHashCode(), + (TimeOnly v) => ((object)v).GetHashCode(), (TimeOnly v) => v), keyComparer: new ValueComparer( (TimeOnly v1, TimeOnly v2) => v1.Equals(v2), - (TimeOnly v) => v.GetHashCode(), + (TimeOnly v) => ((object)v).GetHashCode(), (TimeOnly v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), converter: new ValueConverter( (TimeOnly v) => v.Ticks, @@ -16400,15 +16421,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas timeSpan.TypeMapping = SqlServerTimeSpanTypeMapping.Default.Clone( comparer: new ValueComparer( (TimeSpan v1, TimeSpan v2) => v1.Equals(v2), - (TimeSpan v) => v.GetHashCode(), + (TimeSpan v) => ((object)v).GetHashCode(), (TimeSpan v) => v), keyComparer: new ValueComparer( (TimeSpan v1, TimeSpan v2) => v1.Equals(v2), - (TimeSpan v) => v.GetHashCode(), + (TimeSpan v) => ((object)v).GetHashCode(), (TimeSpan v) => v), providerValueComparer: new ValueComparer( (TimeSpan v1, TimeSpan v2) => v1.Equals(v2), - (TimeSpan v) => v.GetHashCode(), + (TimeSpan v) => ((object)v).GetHashCode(), (TimeSpan v) => v)); timeSpan.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); timeSpan.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_TimeSpan", "TestNamespace") }); @@ -16442,15 +16463,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas timeSpanArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer(new ValueComparer( (TimeSpan v1, TimeSpan v2) => v1.Equals(v2), - (TimeSpan v) => v.GetHashCode(), + (TimeSpan v) => ((object)v).GetHashCode(), (TimeSpan v) => v)), keyComparer: new ListOfValueTypesComparer(new ValueComparer( (TimeSpan v1, TimeSpan v2) => v1.Equals(v2), - (TimeSpan v) => v.GetHashCode(), + (TimeSpan v) => ((object)v).GetHashCode(), (TimeSpan v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -16464,15 +16485,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerTimeSpanTypeMapping.Default.Clone( comparer: new ValueComparer( (TimeSpan v1, TimeSpan v2) => v1.Equals(v2), - (TimeSpan v) => v.GetHashCode(), + (TimeSpan v) => ((object)v).GetHashCode(), (TimeSpan v) => v), keyComparer: new ValueComparer( (TimeSpan v1, TimeSpan v2) => v1.Equals(v2), - (TimeSpan v) => v.GetHashCode(), + (TimeSpan v) => ((object)v).GetHashCode(), (TimeSpan v) => v), providerValueComparer: new ValueComparer( (TimeSpan v1, TimeSpan v2) => v1.Equals(v2), - (TimeSpan v) => v.GetHashCode(), + (TimeSpan v) => ((object)v).GetHashCode(), (TimeSpan v) => v))); timeSpanArray.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); timeSpanArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_TimeSpanArray", "TestNamespace") }); @@ -16507,15 +16528,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas timeSpanToStringConverterProperty.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (TimeSpan v1, TimeSpan v2) => v1.Equals(v2), - (TimeSpan v) => v.GetHashCode(), + (TimeSpan v) => ((object)v).GetHashCode(), (TimeSpan v) => v), keyComparer: new ValueComparer( (TimeSpan v1, TimeSpan v2) => v1.Equals(v2), - (TimeSpan v) => v.GetHashCode(), + (TimeSpan v) => ((object)v).GetHashCode(), (TimeSpan v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(48)", @@ -16564,15 +16585,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas timeSpanToTicksConverterProperty.TypeMapping = SqlServerLongTypeMapping.Default.Clone( comparer: new ValueComparer( (TimeSpan v1, TimeSpan v2) => v1.Equals(v2), - (TimeSpan v) => v.GetHashCode(), + (TimeSpan v) => ((object)v).GetHashCode(), (TimeSpan v) => v), keyComparer: new ValueComparer( (TimeSpan v1, TimeSpan v2) => v1.Equals(v2), - (TimeSpan v) => v.GetHashCode(), + (TimeSpan v) => ((object)v).GetHashCode(), (TimeSpan v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), converter: new ValueConverter( (TimeSpan v) => v.Ticks, @@ -16674,7 +16695,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (ushort v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -16754,7 +16775,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (uint v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), converter: new ValueConverter( (uint v) => (long)v, @@ -16805,7 +16826,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (uint v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -16835,7 +16856,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (uint v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), converter: new ValueConverter( (uint v) => (long)v, @@ -16877,15 +16898,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas uInt64.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( comparer: new ValueComparer( (ulong v1, ulong v2) => v1 == v2, - (ulong v) => v.GetHashCode(), + (ulong v) => ((object)v).GetHashCode(), (ulong v) => v), keyComparer: new ValueComparer( (ulong v1, ulong v2) => v1 == v2, - (ulong v) => v.GetHashCode(), + (ulong v) => ((object)v).GetHashCode(), (ulong v) => v), providerValueComparer: new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "decimal(20,0)", @@ -16932,15 +16953,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas uInt64Array.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer(new ValueComparer( (ulong v1, ulong v2) => v1 == v2, - (ulong v) => v.GetHashCode(), + (ulong v) => ((object)v).GetHashCode(), (ulong v) => v)), keyComparer: new ListOfValueTypesComparer(new ValueComparer( (ulong v1, ulong v2) => v1 == v2, - (ulong v) => v.GetHashCode(), + (ulong v) => ((object)v).GetHashCode(), (ulong v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -16962,15 +16983,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerDecimalTypeMapping.Default.Clone( comparer: new ValueComparer( (ulong v1, ulong v2) => v1 == v2, - (ulong v) => v.GetHashCode(), + (ulong v) => ((object)v).GetHashCode(), (ulong v) => v), keyComparer: new ValueComparer( (ulong v1, ulong v2) => v1 == v2, - (ulong v) => v.GetHashCode(), + (ulong v) => ((object)v).GetHashCode(), (ulong v) => v), providerValueComparer: new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "decimal(20,0)", @@ -17059,7 +17080,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas uInt8Array.TypeMapping = SqlServerByteArrayTypeMapping.Default.Clone( comparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), - (byte[] v) => v.GetHashCode(), + (byte[] v) => ((object)v).GetHashCode(), (byte[] v) => v), keyComparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), @@ -17081,17 +17102,17 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("UInt8NestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); uInt8NestedCollection.SetGetter( - (CompiledModelTestBase.ManyTypes entity) => ReadUInt8NestedCollection(entity), - (CompiledModelTestBase.ManyTypes entity) => ReadUInt8NestedCollection(entity) == null, - (CompiledModelTestBase.ManyTypes instance) => ReadUInt8NestedCollection(instance), - (CompiledModelTestBase.ManyTypes instance) => ReadUInt8NestedCollection(instance) == null); + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UInt8NestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UInt8NestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UInt8NestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UInt8NestedCollection(instance) == null); uInt8NestedCollection.SetSetter( - (CompiledModelTestBase.ManyTypes entity, List value) => WriteUInt8NestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, List value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UInt8NestedCollection(entity) = value); uInt8NestedCollection.SetMaterializationSetter( - (CompiledModelTestBase.ManyTypes entity, List value) => WriteUInt8NestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, List value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UInt8NestedCollection(entity) = value); uInt8NestedCollection.SetAccessors( - (InternalEntityEntry entry) => ReadUInt8NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => ReadUInt8NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UInt8NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UInt8NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => entry.ReadOriginalValue>(uInt8NestedCollection, 254), (InternalEntityEntry entry) => entry.GetCurrentValue>(uInt8NestedCollection), (ValueBuffer valueBuffer) => valueBuffer[254]); @@ -17104,15 +17125,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas uInt8NestedCollection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer, byte[]>(new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), - (byte[] v) => v.GetHashCode(), + (byte[] v) => ((object)v).GetHashCode(), (byte[] v) => v)), keyComparer: new ListOfReferenceTypesComparer, byte[]>(new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), - (byte[] v) => v.GetHashCode(), + (byte[] v) => ((object)v).GetHashCode(), (byte[] v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -17126,7 +17147,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerByteArrayTypeMapping.Default.Clone( comparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), - (byte[] v) => v.GetHashCode(), + (byte[] v) => ((object)v).GetHashCode(), (byte[] v) => v), keyComparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), @@ -17140,6 +17161,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas storeTypeName: "varbinary(max)"), storeTypePostfix: StoreTypePostfix.None)); uInt8NestedCollection.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + uInt8NestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UInt8NestedCollection", "TestNamespace") }); var uri = runtimeEntityType.AddProperty( "Uri", @@ -17170,28 +17192,28 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas uri.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (Uri v1, Uri v2) => v1 == v2, - (Uri v) => v.GetHashCode(), + (Uri v) => ((object)v).GetHashCode(), (Uri v) => v), keyComparer: new ValueComparer( (Uri v1, Uri v2) => v1 == v2, - (Uri v) => v.GetHashCode(), + (Uri v) => ((object)v).GetHashCode(), (Uri v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (Uri v) => v.ToString(), + (Uri v) => ((object)v).ToString(), (string v) => new Uri(v, UriKind.RelativeOrAbsolute)), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (Uri v) => v.ToString(), + (Uri v) => ((object)v).ToString(), (string v) => new Uri(v, UriKind.RelativeOrAbsolute)))); uri.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); uri.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Uri", "TestNamespace") }); @@ -17225,15 +17247,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas uriArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer(new ValueComparer( (Uri v1, Uri v2) => v1 == v2, - (Uri v) => v.GetHashCode(), + (Uri v) => ((object)v).GetHashCode(), (Uri v) => v)), keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( (Uri v1, Uri v2) => v1 == v2, - (Uri v) => v.GetHashCode(), + (Uri v) => ((object)v).GetHashCode(), (Uri v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -17243,40 +17265,40 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (Uri v) => v.ToString(), + (Uri v) => ((object)v).ToString(), (string v) => new Uri(v, UriKind.RelativeOrAbsolute))))), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (Uri v) => v.ToString(), + (Uri v) => ((object)v).ToString(), (string v) => new Uri(v, UriKind.RelativeOrAbsolute)))), elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (Uri v1, Uri v2) => v1 == v2, - (Uri v) => v.GetHashCode(), + (Uri v) => ((object)v).GetHashCode(), (Uri v) => v), keyComparer: new ValueComparer( (Uri v1, Uri v2) => v1 == v2, - (Uri v) => v.GetHashCode(), + (Uri v) => ((object)v).GetHashCode(), (Uri v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (Uri v) => v.ToString(), + (Uri v) => ((object)v).ToString(), (string v) => new Uri(v, UriKind.RelativeOrAbsolute)), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (Uri v) => v.ToString(), + (Uri v) => ((object)v).ToString(), (string v) => new Uri(v, UriKind.RelativeOrAbsolute))))); uriArray.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); uriArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UriArray", "TestNamespace") }); @@ -17311,28 +17333,28 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas uriToStringConverterProperty.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (Uri v1, Uri v2) => v1 == v2, - (Uri v) => v.GetHashCode(), + (Uri v) => ((object)v).GetHashCode(), (Uri v) => v), keyComparer: new ValueComparer( (Uri v1, Uri v2) => v1 == v2, - (Uri v) => v.GetHashCode(), + (Uri v) => ((object)v).GetHashCode(), (Uri v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (Uri v) => v.ToString(), + (Uri v) => ((object)v).ToString(), (string v) => new Uri(v, UriKind.RelativeOrAbsolute)), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (Uri v) => v.ToString(), + (Uri v) => ((object)v).ToString(), (string v) => new Uri(v, UriKind.RelativeOrAbsolute)))); uriToStringConverterProperty.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); uriToStringConverterProperty.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UriToStringConverterProperty", "TestNamespace") }); @@ -17608,26 +17630,26 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (CompiledModelTestBase.ManyTypes)source.Entity; - var liftedArg = (ISnapshot)new Snapshot(((ValueComparer)id.GetValueComparer()).Snapshot(source.GetCurrentValue(id)), ((ValueComparer)@bool.GetValueComparer()).Snapshot(source.GetCurrentValue(@bool)), (IEnumerable)source.GetCurrentValue(boolArray) == null ? null : (bool[])((ValueComparer>)boolArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(boolArray)), (object)source.GetCurrentValue(boolNestedCollection) == null ? null : (bool[][])((ValueComparer)boolNestedCollection.GetValueComparer()).Snapshot((object)source.GetCurrentValue(boolNestedCollection)), ((ValueComparer)boolToStringConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(boolToStringConverterProperty)), ((ValueComparer)boolToTwoValuesConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(boolToTwoValuesConverterProperty)), ((ValueComparer)boolToZeroOneConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(boolToZeroOneConverterProperty)), source.GetCurrentValue(bytes) == null ? null : ((ValueComparer)bytes.GetValueComparer()).Snapshot(source.GetCurrentValue(bytes)), (object)source.GetCurrentValue(bytesArray) == null ? null : (byte[][])((ValueComparer)bytesArray.GetValueComparer()).Snapshot((object)source.GetCurrentValue(bytesArray)), (object)source.GetCurrentValue(bytesNestedCollection) == null ? null : (byte[][][])((ValueComparer)bytesNestedCollection.GetValueComparer()).Snapshot((object)source.GetCurrentValue(bytesNestedCollection)), source.GetCurrentValue(bytesToStringConverterProperty) == null ? null : ((ValueComparer)bytesToStringConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(bytesToStringConverterProperty)), ((ValueComparer)castingConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(castingConverterProperty)), ((ValueComparer)@char.GetValueComparer()).Snapshot(source.GetCurrentValue(@char)), (IEnumerable)source.GetCurrentValue(charArray) == null ? null : (char[])((ValueComparer>)charArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(charArray)), (object)source.GetCurrentValue(charNestedCollection) == null ? null : (char[][])((ValueComparer)charNestedCollection.GetValueComparer()).Snapshot((object)source.GetCurrentValue(charNestedCollection)), ((ValueComparer)charToStringConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(charToStringConverterProperty)), ((ValueComparer)dateOnly.GetValueComparer()).Snapshot(source.GetCurrentValue(dateOnly)), (IEnumerable)source.GetCurrentValue(dateOnlyArray) == null ? null : (DateOnly[])((ValueComparer>)dateOnlyArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(dateOnlyArray)), ((ValueComparer)dateOnlyToStringConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(dateOnlyToStringConverterProperty)), ((ValueComparer)dateTime.GetValueComparer()).Snapshot(source.GetCurrentValue(dateTime)), (IEnumerable)source.GetCurrentValue(dateTimeArray) == null ? null : (DateTime[])((ValueComparer>)dateTimeArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(dateTimeArray)), ((ValueComparer)dateTimeOffsetToBinaryConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(dateTimeOffsetToBinaryConverterProperty)), ((ValueComparer)dateTimeOffsetToBytesConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(dateTimeOffsetToBytesConverterProperty)), ((ValueComparer)dateTimeOffsetToStringConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(dateTimeOffsetToStringConverterProperty)), ((ValueComparer)dateTimeToBinaryConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(dateTimeToBinaryConverterProperty)), ((ValueComparer)dateTimeToStringConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(dateTimeToStringConverterProperty)), ((ValueComparer)dateTimeToTicksConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(dateTimeToTicksConverterProperty)), ((ValueComparer)@decimal.GetValueComparer()).Snapshot(source.GetCurrentValue(@decimal)), (IEnumerable)source.GetCurrentValue(decimalArray) == null ? null : (decimal[])((ValueComparer>)decimalArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(decimalArray)), ((ValueComparer)decimalNumberToBytesConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(decimalNumberToBytesConverterProperty))); + var liftedArg = (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetValueComparer()).Snapshot(source.GetCurrentValue(id)), ((ValueComparer)((IProperty)@bool).GetValueComparer()).Snapshot(source.GetCurrentValue(@bool)), (IEnumerable)source.GetCurrentValue(boolArray) == null ? null : (bool[])((ValueComparer>)((IProperty)boolArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(boolArray)), (object)source.GetCurrentValue(boolNestedCollection) == null ? null : (bool[][])((ValueComparer)((IProperty)boolNestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue(boolNestedCollection)), ((ValueComparer)((IProperty)boolToStringConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(boolToStringConverterProperty)), ((ValueComparer)((IProperty)boolToTwoValuesConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(boolToTwoValuesConverterProperty)), ((ValueComparer)((IProperty)boolToZeroOneConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(boolToZeroOneConverterProperty)), source.GetCurrentValue(bytes) == null ? null : ((ValueComparer)((IProperty)bytes).GetValueComparer()).Snapshot(source.GetCurrentValue(bytes)), (object)source.GetCurrentValue(bytesArray) == null ? null : (byte[][])((ValueComparer)((IProperty)bytesArray).GetValueComparer()).Snapshot((object)source.GetCurrentValue(bytesArray)), (object)source.GetCurrentValue(bytesNestedCollection) == null ? null : (byte[][][])((ValueComparer)((IProperty)bytesNestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue(bytesNestedCollection)), source.GetCurrentValue(bytesToStringConverterProperty) == null ? null : ((ValueComparer)((IProperty)bytesToStringConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(bytesToStringConverterProperty)), ((ValueComparer)((IProperty)castingConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(castingConverterProperty)), ((ValueComparer)((IProperty)@char).GetValueComparer()).Snapshot(source.GetCurrentValue(@char)), (IEnumerable)source.GetCurrentValue(charArray) == null ? null : (char[])((ValueComparer>)((IProperty)charArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(charArray)), (object)source.GetCurrentValue(charNestedCollection) == null ? null : (char[][])((ValueComparer)((IProperty)charNestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue(charNestedCollection)), ((ValueComparer)((IProperty)charToStringConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(charToStringConverterProperty)), ((ValueComparer)((IProperty)dateOnly).GetValueComparer()).Snapshot(source.GetCurrentValue(dateOnly)), (IEnumerable)source.GetCurrentValue(dateOnlyArray) == null ? null : (DateOnly[])((ValueComparer>)((IProperty)dateOnlyArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(dateOnlyArray)), ((ValueComparer)((IProperty)dateOnlyToStringConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(dateOnlyToStringConverterProperty)), ((ValueComparer)((IProperty)dateTime).GetValueComparer()).Snapshot(source.GetCurrentValue(dateTime)), (IEnumerable)source.GetCurrentValue(dateTimeArray) == null ? null : (DateTime[])((ValueComparer>)((IProperty)dateTimeArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(dateTimeArray)), ((ValueComparer)((IProperty)dateTimeOffsetToBinaryConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(dateTimeOffsetToBinaryConverterProperty)), ((ValueComparer)((IProperty)dateTimeOffsetToBytesConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(dateTimeOffsetToBytesConverterProperty)), ((ValueComparer)((IProperty)dateTimeOffsetToStringConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(dateTimeOffsetToStringConverterProperty)), ((ValueComparer)((IProperty)dateTimeToBinaryConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(dateTimeToBinaryConverterProperty)), ((ValueComparer)((IProperty)dateTimeToStringConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(dateTimeToStringConverterProperty)), ((ValueComparer)((IProperty)dateTimeToTicksConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(dateTimeToTicksConverterProperty)), ((ValueComparer)((IProperty)@decimal).GetValueComparer()).Snapshot(source.GetCurrentValue(@decimal)), (IEnumerable)source.GetCurrentValue(decimalArray) == null ? null : (decimal[])((ValueComparer>)((IProperty)decimalArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(decimalArray)), ((ValueComparer)((IProperty)decimalNumberToBytesConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(decimalNumberToBytesConverterProperty))); var entity0 = (CompiledModelTestBase.ManyTypes)source.Entity; - var liftedArg0 = (ISnapshot)new Snapshot, List, CompiledModelTestBase.Enum32, CompiledModelTestBase.Enum32[], CompiledModelTestBase.Enum32, CompiledModelTestBase.Enum32[], List, List, List[][], CompiledModelTestBase.Enum64, CompiledModelTestBase.Enum64[], CompiledModelTestBase.Enum64, CompiledModelTestBase.Enum64[], List, List, CompiledModelTestBase.Enum8, CompiledModelTestBase.Enum8[], CompiledModelTestBase.Enum8, CompiledModelTestBase.Enum8[], List, List>(((ValueComparer)decimalNumberToStringConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(decimalNumberToStringConverterProperty)), ((ValueComparer)@double.GetValueComparer()).Snapshot(source.GetCurrentValue(@double)), (IEnumerable)source.GetCurrentValue(doubleArray) == null ? null : (double[])((ValueComparer>)doubleArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(doubleArray)), ((ValueComparer)doubleNumberToBytesConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(doubleNumberToBytesConverterProperty)), ((ValueComparer)doubleNumberToStringConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(doubleNumberToStringConverterProperty)), ((ValueComparer)enum16.GetValueComparer()).Snapshot(source.GetCurrentValue(enum16)), (IEnumerable)source.GetCurrentValue(enum16Array) == null ? null : (CompiledModelTestBase.Enum16[])((ValueComparer>)enum16Array.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enum16Array)), ((ValueComparer)enum16AsString.GetValueComparer()).Snapshot(source.GetCurrentValue(enum16AsString)), (IEnumerable)source.GetCurrentValue(enum16AsStringArray) == null ? null : (CompiledModelTestBase.Enum16[])((ValueComparer>)enum16AsStringArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enum16AsStringArray)), (IEnumerable)source.GetCurrentValue>(enum16AsStringCollection) == null ? null : (List)((ValueComparer>)enum16AsStringCollection.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enum16AsStringCollection)), (IEnumerable)source.GetCurrentValue>(enum16Collection) == null ? null : (List)((ValueComparer>)enum16Collection.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enum16Collection)), ((ValueComparer)enum32.GetValueComparer()).Snapshot(source.GetCurrentValue(enum32)), (IEnumerable)source.GetCurrentValue(enum32Array) == null ? null : (CompiledModelTestBase.Enum32[])((ValueComparer>)enum32Array.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enum32Array)), ((ValueComparer)enum32AsString.GetValueComparer()).Snapshot(source.GetCurrentValue(enum32AsString)), (IEnumerable)source.GetCurrentValue(enum32AsStringArray) == null ? null : (CompiledModelTestBase.Enum32[])((ValueComparer>)enum32AsStringArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enum32AsStringArray)), (IEnumerable)source.GetCurrentValue>(enum32AsStringCollection) == null ? null : (List)((ValueComparer>)enum32AsStringCollection.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enum32AsStringCollection)), (IEnumerable)source.GetCurrentValue>(enum32Collection) == null ? null : (List)((ValueComparer>)enum32Collection.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enum32Collection)), (object)source.GetCurrentValue[][]>(enum32NestedCollection) == null ? null : (List[][])((ValueComparer)enum32NestedCollection.GetValueComparer()).Snapshot((object)source.GetCurrentValue[][]>(enum32NestedCollection)), ((ValueComparer)enum64.GetValueComparer()).Snapshot(source.GetCurrentValue(enum64)), (IEnumerable)source.GetCurrentValue(enum64Array) == null ? null : (CompiledModelTestBase.Enum64[])((ValueComparer>)enum64Array.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enum64Array)), ((ValueComparer)enum64AsString.GetValueComparer()).Snapshot(source.GetCurrentValue(enum64AsString)), (IEnumerable)source.GetCurrentValue(enum64AsStringArray) == null ? null : (CompiledModelTestBase.Enum64[])((ValueComparer>)enum64AsStringArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enum64AsStringArray)), (IEnumerable)source.GetCurrentValue>(enum64AsStringCollection) == null ? null : (List)((ValueComparer>)enum64AsStringCollection.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enum64AsStringCollection)), (IEnumerable)source.GetCurrentValue>(enum64Collection) == null ? null : (List)((ValueComparer>)enum64Collection.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enum64Collection)), ((ValueComparer)enum8.GetValueComparer()).Snapshot(source.GetCurrentValue(enum8)), (IEnumerable)source.GetCurrentValue(enum8Array) == null ? null : (CompiledModelTestBase.Enum8[])((ValueComparer>)enum8Array.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enum8Array)), ((ValueComparer)enum8AsString.GetValueComparer()).Snapshot(source.GetCurrentValue(enum8AsString)), (IEnumerable)source.GetCurrentValue(enum8AsStringArray) == null ? null : (CompiledModelTestBase.Enum8[])((ValueComparer>)enum8AsStringArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enum8AsStringArray)), (IEnumerable)source.GetCurrentValue>(enum8AsStringCollection) == null ? null : (List)((ValueComparer>)enum8AsStringCollection.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enum8AsStringCollection)), (IEnumerable)source.GetCurrentValue>(enum8Collection) == null ? null : (List)((ValueComparer>)enum8Collection.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enum8Collection))); + var liftedArg0 = (ISnapshot)new Snapshot, List, CompiledModelTestBase.Enum32, CompiledModelTestBase.Enum32[], CompiledModelTestBase.Enum32, CompiledModelTestBase.Enum32[], List, List, List[][], CompiledModelTestBase.Enum64, CompiledModelTestBase.Enum64[], CompiledModelTestBase.Enum64, CompiledModelTestBase.Enum64[], List, List, CompiledModelTestBase.Enum8, CompiledModelTestBase.Enum8[], CompiledModelTestBase.Enum8, CompiledModelTestBase.Enum8[], List, List>(((ValueComparer)((IProperty)decimalNumberToStringConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(decimalNumberToStringConverterProperty)), ((ValueComparer)((IProperty)@double).GetValueComparer()).Snapshot(source.GetCurrentValue(@double)), (IEnumerable)source.GetCurrentValue(doubleArray) == null ? null : (double[])((ValueComparer>)((IProperty)doubleArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(doubleArray)), ((ValueComparer)((IProperty)doubleNumberToBytesConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(doubleNumberToBytesConverterProperty)), ((ValueComparer)((IProperty)doubleNumberToStringConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(doubleNumberToStringConverterProperty)), ((ValueComparer)((IProperty)enum16).GetValueComparer()).Snapshot(source.GetCurrentValue(enum16)), (IEnumerable)source.GetCurrentValue(enum16Array) == null ? null : (CompiledModelTestBase.Enum16[])((ValueComparer>)((IProperty)enum16Array).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enum16Array)), ((ValueComparer)((IProperty)enum16AsString).GetValueComparer()).Snapshot(source.GetCurrentValue(enum16AsString)), (IEnumerable)source.GetCurrentValue(enum16AsStringArray) == null ? null : (CompiledModelTestBase.Enum16[])((ValueComparer>)((IProperty)enum16AsStringArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enum16AsStringArray)), (IEnumerable)source.GetCurrentValue>(enum16AsStringCollection) == null ? null : (List)((ValueComparer>)((IProperty)enum16AsStringCollection).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enum16AsStringCollection)), (IEnumerable)source.GetCurrentValue>(enum16Collection) == null ? null : (List)((ValueComparer>)((IProperty)enum16Collection).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enum16Collection)), ((ValueComparer)((IProperty)enum32).GetValueComparer()).Snapshot(source.GetCurrentValue(enum32)), (IEnumerable)source.GetCurrentValue(enum32Array) == null ? null : (CompiledModelTestBase.Enum32[])((ValueComparer>)((IProperty)enum32Array).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enum32Array)), ((ValueComparer)((IProperty)enum32AsString).GetValueComparer()).Snapshot(source.GetCurrentValue(enum32AsString)), (IEnumerable)source.GetCurrentValue(enum32AsStringArray) == null ? null : (CompiledModelTestBase.Enum32[])((ValueComparer>)((IProperty)enum32AsStringArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enum32AsStringArray)), (IEnumerable)source.GetCurrentValue>(enum32AsStringCollection) == null ? null : (List)((ValueComparer>)((IProperty)enum32AsStringCollection).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enum32AsStringCollection)), (IEnumerable)source.GetCurrentValue>(enum32Collection) == null ? null : (List)((ValueComparer>)((IProperty)enum32Collection).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enum32Collection)), (object)source.GetCurrentValue[][]>(enum32NestedCollection) == null ? null : (List[][])((ValueComparer)((IProperty)enum32NestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue[][]>(enum32NestedCollection)), ((ValueComparer)((IProperty)enum64).GetValueComparer()).Snapshot(source.GetCurrentValue(enum64)), (IEnumerable)source.GetCurrentValue(enum64Array) == null ? null : (CompiledModelTestBase.Enum64[])((ValueComparer>)((IProperty)enum64Array).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enum64Array)), ((ValueComparer)((IProperty)enum64AsString).GetValueComparer()).Snapshot(source.GetCurrentValue(enum64AsString)), (IEnumerable)source.GetCurrentValue(enum64AsStringArray) == null ? null : (CompiledModelTestBase.Enum64[])((ValueComparer>)((IProperty)enum64AsStringArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enum64AsStringArray)), (IEnumerable)source.GetCurrentValue>(enum64AsStringCollection) == null ? null : (List)((ValueComparer>)((IProperty)enum64AsStringCollection).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enum64AsStringCollection)), (IEnumerable)source.GetCurrentValue>(enum64Collection) == null ? null : (List)((ValueComparer>)((IProperty)enum64Collection).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enum64Collection)), ((ValueComparer)((IProperty)enum8).GetValueComparer()).Snapshot(source.GetCurrentValue(enum8)), (IEnumerable)source.GetCurrentValue(enum8Array) == null ? null : (CompiledModelTestBase.Enum8[])((ValueComparer>)((IProperty)enum8Array).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enum8Array)), ((ValueComparer)((IProperty)enum8AsString).GetValueComparer()).Snapshot(source.GetCurrentValue(enum8AsString)), (IEnumerable)source.GetCurrentValue(enum8AsStringArray) == null ? null : (CompiledModelTestBase.Enum8[])((ValueComparer>)((IProperty)enum8AsStringArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enum8AsStringArray)), (IEnumerable)source.GetCurrentValue>(enum8AsStringCollection) == null ? null : (List)((ValueComparer>)((IProperty)enum8AsStringCollection).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enum8AsStringCollection)), (IEnumerable)source.GetCurrentValue>(enum8Collection) == null ? null : (List)((ValueComparer>)((IProperty)enum8Collection).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enum8Collection))); var entity1 = (CompiledModelTestBase.ManyTypes)source.Entity; - var liftedArg1 = (ISnapshot)new Snapshot, List, CompiledModelTestBase.EnumU32, CompiledModelTestBase.EnumU32[], CompiledModelTestBase.EnumU32, CompiledModelTestBase.EnumU32[], List, List, CompiledModelTestBase.EnumU64, CompiledModelTestBase.EnumU64[], CompiledModelTestBase.EnumU64, CompiledModelTestBase.EnumU64[], List, List, CompiledModelTestBase.EnumU64[][], CompiledModelTestBase.EnumU8, CompiledModelTestBase.EnumU8[], CompiledModelTestBase.EnumU8, CompiledModelTestBase.EnumU8[], List, List, float, float[]>((object)source.GetCurrentValue(enum8NestedCollection) == null ? null : (CompiledModelTestBase.Enum8[][])((ValueComparer)enum8NestedCollection.GetValueComparer()).Snapshot((object)source.GetCurrentValue(enum8NestedCollection)), ((ValueComparer)enumToNumberConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(enumToNumberConverterProperty)), ((ValueComparer)enumToStringConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(enumToStringConverterProperty)), ((ValueComparer)enumU16.GetValueComparer()).Snapshot(source.GetCurrentValue(enumU16)), (IEnumerable)source.GetCurrentValue(enumU16Array) == null ? null : (CompiledModelTestBase.EnumU16[])((ValueComparer>)enumU16Array.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enumU16Array)), ((ValueComparer)enumU16AsString.GetValueComparer()).Snapshot(source.GetCurrentValue(enumU16AsString)), (IEnumerable)source.GetCurrentValue(enumU16AsStringArray) == null ? null : (CompiledModelTestBase.EnumU16[])((ValueComparer>)enumU16AsStringArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enumU16AsStringArray)), (IEnumerable)source.GetCurrentValue>(enumU16AsStringCollection) == null ? null : (List)((ValueComparer>)enumU16AsStringCollection.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enumU16AsStringCollection)), (IEnumerable)source.GetCurrentValue>(enumU16Collection) == null ? null : (List)((ValueComparer>)enumU16Collection.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enumU16Collection)), ((ValueComparer)enumU32.GetValueComparer()).Snapshot(source.GetCurrentValue(enumU32)), (IEnumerable)source.GetCurrentValue(enumU32Array) == null ? null : (CompiledModelTestBase.EnumU32[])((ValueComparer>)enumU32Array.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enumU32Array)), ((ValueComparer)enumU32AsString.GetValueComparer()).Snapshot(source.GetCurrentValue(enumU32AsString)), (IEnumerable)source.GetCurrentValue(enumU32AsStringArray) == null ? null : (CompiledModelTestBase.EnumU32[])((ValueComparer>)enumU32AsStringArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enumU32AsStringArray)), (IEnumerable)source.GetCurrentValue>(enumU32AsStringCollection) == null ? null : (List)((ValueComparer>)enumU32AsStringCollection.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enumU32AsStringCollection)), (IEnumerable)source.GetCurrentValue>(enumU32Collection) == null ? null : (List)((ValueComparer>)enumU32Collection.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enumU32Collection)), ((ValueComparer)enumU64.GetValueComparer()).Snapshot(source.GetCurrentValue(enumU64)), (IEnumerable)source.GetCurrentValue(enumU64Array) == null ? null : (CompiledModelTestBase.EnumU64[])((ValueComparer>)enumU64Array.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enumU64Array)), ((ValueComparer)enumU64AsString.GetValueComparer()).Snapshot(source.GetCurrentValue(enumU64AsString)), (IEnumerable)source.GetCurrentValue(enumU64AsStringArray) == null ? null : (CompiledModelTestBase.EnumU64[])((ValueComparer>)enumU64AsStringArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enumU64AsStringArray)), (IEnumerable)source.GetCurrentValue>(enumU64AsStringCollection) == null ? null : (List)((ValueComparer>)enumU64AsStringCollection.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enumU64AsStringCollection)), (IEnumerable)source.GetCurrentValue>(enumU64Collection) == null ? null : (List)((ValueComparer>)enumU64Collection.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enumU64Collection)), (object)source.GetCurrentValue(enumU64NestedCollection) == null ? null : (CompiledModelTestBase.EnumU64[][])((ValueComparer)enumU64NestedCollection.GetValueComparer()).Snapshot((object)source.GetCurrentValue(enumU64NestedCollection)), ((ValueComparer)enumU8.GetValueComparer()).Snapshot(source.GetCurrentValue(enumU8)), (IEnumerable)source.GetCurrentValue(enumU8Array) == null ? null : (CompiledModelTestBase.EnumU8[])((ValueComparer>)enumU8Array.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enumU8Array)), ((ValueComparer)enumU8AsString.GetValueComparer()).Snapshot(source.GetCurrentValue(enumU8AsString)), (IEnumerable)source.GetCurrentValue(enumU8AsStringArray) == null ? null : (CompiledModelTestBase.EnumU8[])((ValueComparer>)enumU8AsStringArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enumU8AsStringArray)), (IEnumerable)source.GetCurrentValue>(enumU8AsStringCollection) == null ? null : (List)((ValueComparer>)enumU8AsStringCollection.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enumU8AsStringCollection)), (IEnumerable)source.GetCurrentValue>(enumU8Collection) == null ? null : (List)((ValueComparer>)enumU8Collection.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enumU8Collection)), ((ValueComparer)@float.GetValueComparer()).Snapshot(source.GetCurrentValue(@float)), (IEnumerable)source.GetCurrentValue(floatArray) == null ? null : (float[])((ValueComparer>)floatArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(floatArray))); + var liftedArg1 = (ISnapshot)new Snapshot, List, CompiledModelTestBase.EnumU32, CompiledModelTestBase.EnumU32[], CompiledModelTestBase.EnumU32, CompiledModelTestBase.EnumU32[], List, List, CompiledModelTestBase.EnumU64, CompiledModelTestBase.EnumU64[], CompiledModelTestBase.EnumU64, CompiledModelTestBase.EnumU64[], List, List, CompiledModelTestBase.EnumU64[][], CompiledModelTestBase.EnumU8, CompiledModelTestBase.EnumU8[], CompiledModelTestBase.EnumU8, CompiledModelTestBase.EnumU8[], List, List, float, float[]>((object)source.GetCurrentValue(enum8NestedCollection) == null ? null : (CompiledModelTestBase.Enum8[][])((ValueComparer)((IProperty)enum8NestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue(enum8NestedCollection)), ((ValueComparer)((IProperty)enumToNumberConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(enumToNumberConverterProperty)), ((ValueComparer)((IProperty)enumToStringConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(enumToStringConverterProperty)), ((ValueComparer)((IProperty)enumU16).GetValueComparer()).Snapshot(source.GetCurrentValue(enumU16)), (IEnumerable)source.GetCurrentValue(enumU16Array) == null ? null : (CompiledModelTestBase.EnumU16[])((ValueComparer>)((IProperty)enumU16Array).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enumU16Array)), ((ValueComparer)((IProperty)enumU16AsString).GetValueComparer()).Snapshot(source.GetCurrentValue(enumU16AsString)), (IEnumerable)source.GetCurrentValue(enumU16AsStringArray) == null ? null : (CompiledModelTestBase.EnumU16[])((ValueComparer>)((IProperty)enumU16AsStringArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enumU16AsStringArray)), (IEnumerable)source.GetCurrentValue>(enumU16AsStringCollection) == null ? null : (List)((ValueComparer>)((IProperty)enumU16AsStringCollection).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enumU16AsStringCollection)), (IEnumerable)source.GetCurrentValue>(enumU16Collection) == null ? null : (List)((ValueComparer>)((IProperty)enumU16Collection).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enumU16Collection)), ((ValueComparer)((IProperty)enumU32).GetValueComparer()).Snapshot(source.GetCurrentValue(enumU32)), (IEnumerable)source.GetCurrentValue(enumU32Array) == null ? null : (CompiledModelTestBase.EnumU32[])((ValueComparer>)((IProperty)enumU32Array).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enumU32Array)), ((ValueComparer)((IProperty)enumU32AsString).GetValueComparer()).Snapshot(source.GetCurrentValue(enumU32AsString)), (IEnumerable)source.GetCurrentValue(enumU32AsStringArray) == null ? null : (CompiledModelTestBase.EnumU32[])((ValueComparer>)((IProperty)enumU32AsStringArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enumU32AsStringArray)), (IEnumerable)source.GetCurrentValue>(enumU32AsStringCollection) == null ? null : (List)((ValueComparer>)((IProperty)enumU32AsStringCollection).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enumU32AsStringCollection)), (IEnumerable)source.GetCurrentValue>(enumU32Collection) == null ? null : (List)((ValueComparer>)((IProperty)enumU32Collection).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enumU32Collection)), ((ValueComparer)((IProperty)enumU64).GetValueComparer()).Snapshot(source.GetCurrentValue(enumU64)), (IEnumerable)source.GetCurrentValue(enumU64Array) == null ? null : (CompiledModelTestBase.EnumU64[])((ValueComparer>)((IProperty)enumU64Array).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enumU64Array)), ((ValueComparer)((IProperty)enumU64AsString).GetValueComparer()).Snapshot(source.GetCurrentValue(enumU64AsString)), (IEnumerable)source.GetCurrentValue(enumU64AsStringArray) == null ? null : (CompiledModelTestBase.EnumU64[])((ValueComparer>)((IProperty)enumU64AsStringArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enumU64AsStringArray)), (IEnumerable)source.GetCurrentValue>(enumU64AsStringCollection) == null ? null : (List)((ValueComparer>)((IProperty)enumU64AsStringCollection).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enumU64AsStringCollection)), (IEnumerable)source.GetCurrentValue>(enumU64Collection) == null ? null : (List)((ValueComparer>)((IProperty)enumU64Collection).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enumU64Collection)), (object)source.GetCurrentValue(enumU64NestedCollection) == null ? null : (CompiledModelTestBase.EnumU64[][])((ValueComparer)((IProperty)enumU64NestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue(enumU64NestedCollection)), ((ValueComparer)((IProperty)enumU8).GetValueComparer()).Snapshot(source.GetCurrentValue(enumU8)), (IEnumerable)source.GetCurrentValue(enumU8Array) == null ? null : (CompiledModelTestBase.EnumU8[])((ValueComparer>)((IProperty)enumU8Array).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enumU8Array)), ((ValueComparer)((IProperty)enumU8AsString).GetValueComparer()).Snapshot(source.GetCurrentValue(enumU8AsString)), (IEnumerable)source.GetCurrentValue(enumU8AsStringArray) == null ? null : (CompiledModelTestBase.EnumU8[])((ValueComparer>)((IProperty)enumU8AsStringArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enumU8AsStringArray)), (IEnumerable)source.GetCurrentValue>(enumU8AsStringCollection) == null ? null : (List)((ValueComparer>)((IProperty)enumU8AsStringCollection).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enumU8AsStringCollection)), (IEnumerable)source.GetCurrentValue>(enumU8Collection) == null ? null : (List)((ValueComparer>)((IProperty)enumU8Collection).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enumU8Collection)), ((ValueComparer)((IProperty)@float).GetValueComparer()).Snapshot(source.GetCurrentValue(@float)), (IEnumerable)source.GetCurrentValue(floatArray) == null ? null : (float[])((ValueComparer>)((IProperty)floatArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(floatArray))); var entity2 = (CompiledModelTestBase.ManyTypes)source.Entity; - var liftedArg2 = (ISnapshot)new Snapshot, Guid, Guid, IPAddress, IPAddress[], IPAddress, IPAddress, short, short[], int, int[], int[][], long, long[], IList[], sbyte, sbyte[], sbyte[][][], int, int, Nullable, Nullable, Nullable[], byte[], byte[][], byte[][][], Nullable, Nullable[]>(((ValueComparer)guid.GetValueComparer()).Snapshot(source.GetCurrentValue(guid)), (IEnumerable)source.GetCurrentValue(guidArray) == null ? null : (Guid[])((ValueComparer>)guidArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(guidArray)), (object)source.GetCurrentValue>(guidNestedCollection) == null ? null : (ICollection)((ValueComparer)guidNestedCollection.GetValueComparer()).Snapshot((object)source.GetCurrentValue>(guidNestedCollection)), ((ValueComparer)guidToBytesConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(guidToBytesConverterProperty)), ((ValueComparer)guidToStringConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(guidToStringConverterProperty)), source.GetCurrentValue(iPAddress) == null ? null : ((ValueComparer)iPAddress.GetValueComparer()).Snapshot(source.GetCurrentValue(iPAddress)), (object)source.GetCurrentValue(iPAddressArray) == null ? null : (IPAddress[])((ValueComparer)iPAddressArray.GetValueComparer()).Snapshot((object)source.GetCurrentValue(iPAddressArray)), source.GetCurrentValue(iPAddressToBytesConverterProperty) == null ? null : ((ValueComparer)iPAddressToBytesConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(iPAddressToBytesConverterProperty)), source.GetCurrentValue(iPAddressToStringConverterProperty) == null ? null : ((ValueComparer)iPAddressToStringConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(iPAddressToStringConverterProperty)), ((ValueComparer)int16.GetValueComparer()).Snapshot(source.GetCurrentValue(int16)), (IEnumerable)source.GetCurrentValue(int16Array) == null ? null : (short[])((ValueComparer>)int16Array.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(int16Array)), ((ValueComparer)int32.GetValueComparer()).Snapshot(source.GetCurrentValue(int32)), (IEnumerable)source.GetCurrentValue(int32Array) == null ? null : (int[])((ValueComparer>)int32Array.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(int32Array)), (object)source.GetCurrentValue(int32NestedCollection) == null ? null : (int[][])((ValueComparer)int32NestedCollection.GetValueComparer()).Snapshot((object)source.GetCurrentValue(int32NestedCollection)), ((ValueComparer)int64.GetValueComparer()).Snapshot(source.GetCurrentValue(int64)), (IEnumerable)source.GetCurrentValue(int64Array) == null ? null : (long[])((ValueComparer>)int64Array.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(int64Array)), (object)source.GetCurrentValue[]>(int64NestedCollection) == null ? null : (IList[])((ValueComparer)int64NestedCollection.GetValueComparer()).Snapshot((object)source.GetCurrentValue[]>(int64NestedCollection)), ((ValueComparer)int8.GetValueComparer()).Snapshot(source.GetCurrentValue(int8)), (IEnumerable)source.GetCurrentValue(int8Array) == null ? null : (sbyte[])((ValueComparer>)int8Array.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(int8Array)), (object)source.GetCurrentValue(int8NestedCollection) == null ? null : (sbyte[][][])((ValueComparer)int8NestedCollection.GetValueComparer()).Snapshot((object)source.GetCurrentValue(int8NestedCollection)), ((ValueComparer)intNumberToBytesConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(intNumberToBytesConverterProperty)), ((ValueComparer)intNumberToStringConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(intNumberToStringConverterProperty)), source.GetCurrentValue>(nullIntToNullStringConverterProperty) == null ? null : ((ValueComparer>)nullIntToNullStringConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullIntToNullStringConverterProperty)), source.GetCurrentValue>(nullableBool) == null ? null : ((ValueComparer>)nullableBool.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableBool)), (IEnumerable>)source.GetCurrentValue[]>(nullableBoolArray) == null ? null : (Nullable[])((ValueComparer>>)nullableBoolArray.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableBoolArray)), source.GetCurrentValue(nullableBytes) == null ? null : ((ValueComparer)nullableBytes.GetValueComparer()).Snapshot(source.GetCurrentValue(nullableBytes)), (object)source.GetCurrentValue(nullableBytesArray) == null ? null : (byte[][])((ValueComparer)nullableBytesArray.GetValueComparer()).Snapshot((object)source.GetCurrentValue(nullableBytesArray)), (object)source.GetCurrentValue(nullableBytesNestedCollection) == null ? null : (byte[][][])((ValueComparer)nullableBytesNestedCollection.GetValueComparer()).Snapshot((object)source.GetCurrentValue(nullableBytesNestedCollection)), source.GetCurrentValue>(nullableChar) == null ? null : ((ValueComparer>)nullableChar.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableChar)), (IEnumerable>)source.GetCurrentValue[]>(nullableCharArray) == null ? null : (Nullable[])((ValueComparer>>)nullableCharArray.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableCharArray))); + var liftedArg2 = (ISnapshot)new Snapshot, Guid, Guid, IPAddress, IPAddress[], IPAddress, IPAddress, short, short[], int, int[], int[][], long, long[], IList[], sbyte, sbyte[], sbyte[][][], int, int, Nullable, Nullable, Nullable[], byte[], byte[][], byte[][][], Nullable, Nullable[]>(((ValueComparer)((IProperty)guid).GetValueComparer()).Snapshot(source.GetCurrentValue(guid)), (IEnumerable)source.GetCurrentValue(guidArray) == null ? null : (Guid[])((ValueComparer>)((IProperty)guidArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(guidArray)), (object)source.GetCurrentValue>(guidNestedCollection) == null ? null : (ICollection)((ValueComparer)((IProperty)guidNestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(guidNestedCollection)), ((ValueComparer)((IProperty)guidToBytesConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(guidToBytesConverterProperty)), ((ValueComparer)((IProperty)guidToStringConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(guidToStringConverterProperty)), source.GetCurrentValue(iPAddress) == null ? null : ((ValueComparer)((IProperty)iPAddress).GetValueComparer()).Snapshot(source.GetCurrentValue(iPAddress)), (object)source.GetCurrentValue(iPAddressArray) == null ? null : (IPAddress[])((ValueComparer)((IProperty)iPAddressArray).GetValueComparer()).Snapshot((object)source.GetCurrentValue(iPAddressArray)), source.GetCurrentValue(iPAddressToBytesConverterProperty) == null ? null : ((ValueComparer)((IProperty)iPAddressToBytesConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(iPAddressToBytesConverterProperty)), source.GetCurrentValue(iPAddressToStringConverterProperty) == null ? null : ((ValueComparer)((IProperty)iPAddressToStringConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(iPAddressToStringConverterProperty)), ((ValueComparer)((IProperty)int16).GetValueComparer()).Snapshot(source.GetCurrentValue(int16)), (IEnumerable)source.GetCurrentValue(int16Array) == null ? null : (short[])((ValueComparer>)((IProperty)int16Array).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(int16Array)), ((ValueComparer)((IProperty)int32).GetValueComparer()).Snapshot(source.GetCurrentValue(int32)), (IEnumerable)source.GetCurrentValue(int32Array) == null ? null : (int[])((ValueComparer>)((IProperty)int32Array).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(int32Array)), (object)source.GetCurrentValue(int32NestedCollection) == null ? null : (int[][])((ValueComparer)((IProperty)int32NestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue(int32NestedCollection)), ((ValueComparer)((IProperty)int64).GetValueComparer()).Snapshot(source.GetCurrentValue(int64)), (IEnumerable)source.GetCurrentValue(int64Array) == null ? null : (long[])((ValueComparer>)((IProperty)int64Array).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(int64Array)), (object)source.GetCurrentValue[]>(int64NestedCollection) == null ? null : (IList[])((ValueComparer)((IProperty)int64NestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue[]>(int64NestedCollection)), ((ValueComparer)((IProperty)int8).GetValueComparer()).Snapshot(source.GetCurrentValue(int8)), (IEnumerable)source.GetCurrentValue(int8Array) == null ? null : (sbyte[])((ValueComparer>)((IProperty)int8Array).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(int8Array)), (object)source.GetCurrentValue(int8NestedCollection) == null ? null : (sbyte[][][])((ValueComparer)((IProperty)int8NestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue(int8NestedCollection)), ((ValueComparer)((IProperty)intNumberToBytesConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(intNumberToBytesConverterProperty)), ((ValueComparer)((IProperty)intNumberToStringConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(intNumberToStringConverterProperty)), source.GetCurrentValue>(nullIntToNullStringConverterProperty) == null ? null : ((ValueComparer>)((IProperty)nullIntToNullStringConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullIntToNullStringConverterProperty)), source.GetCurrentValue>(nullableBool) == null ? null : ((ValueComparer>)((IProperty)nullableBool).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableBool)), (IEnumerable>)source.GetCurrentValue[]>(nullableBoolArray) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableBoolArray).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableBoolArray)), source.GetCurrentValue(nullableBytes) == null ? null : ((ValueComparer)((IProperty)nullableBytes).GetValueComparer()).Snapshot(source.GetCurrentValue(nullableBytes)), (object)source.GetCurrentValue(nullableBytesArray) == null ? null : (byte[][])((ValueComparer)((IProperty)nullableBytesArray).GetValueComparer()).Snapshot((object)source.GetCurrentValue(nullableBytesArray)), (object)source.GetCurrentValue(nullableBytesNestedCollection) == null ? null : (byte[][][])((ValueComparer)((IProperty)nullableBytesNestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue(nullableBytesNestedCollection)), source.GetCurrentValue>(nullableChar) == null ? null : ((ValueComparer>)((IProperty)nullableChar).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableChar)), (IEnumerable>)source.GetCurrentValue[]>(nullableCharArray) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableCharArray).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableCharArray))); var entity3 = (CompiledModelTestBase.ManyTypes)source.Entity; - var liftedArg3 = (ISnapshot)new Snapshot, Nullable[], Nullable, Nullable[], Nullable, Nullable[], Nullable, Nullable[], Nullable, Nullable[], Nullable, Nullable[], List>, List>, Nullable, Nullable[], Nullable, Nullable[], List>, List>, Nullable[][][], Nullable, Nullable[], Nullable, Nullable[], List>, List>, Nullable, Nullable[], Nullable>(source.GetCurrentValue>(nullableDateOnly) == null ? null : ((ValueComparer>)nullableDateOnly.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableDateOnly)), (IEnumerable>)source.GetCurrentValue[]>(nullableDateOnlyArray) == null ? null : (Nullable[])((ValueComparer>>)nullableDateOnlyArray.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableDateOnlyArray)), source.GetCurrentValue>(nullableDateTime) == null ? null : ((ValueComparer>)nullableDateTime.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableDateTime)), (IEnumerable>)source.GetCurrentValue[]>(nullableDateTimeArray) == null ? null : (Nullable[])((ValueComparer>>)nullableDateTimeArray.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableDateTimeArray)), source.GetCurrentValue>(nullableDecimal) == null ? null : ((ValueComparer>)nullableDecimal.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableDecimal)), (IEnumerable>)source.GetCurrentValue[]>(nullableDecimalArray) == null ? null : (Nullable[])((ValueComparer>>)nullableDecimalArray.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableDecimalArray)), source.GetCurrentValue>(nullableDouble) == null ? null : ((ValueComparer>)nullableDouble.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableDouble)), (IEnumerable>)source.GetCurrentValue[]>(nullableDoubleArray) == null ? null : (Nullable[])((ValueComparer>>)nullableDoubleArray.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableDoubleArray)), source.GetCurrentValue>(nullableEnum16) == null ? null : ((ValueComparer>)nullableEnum16.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnum16)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnum16Array) == null ? null : (Nullable[])((ValueComparer>>)nullableEnum16Array.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnum16Array)), source.GetCurrentValue>(nullableEnum16AsString) == null ? null : ((ValueComparer>)nullableEnum16AsString.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnum16AsString)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnum16AsStringArray) == null ? null : (Nullable[])((ValueComparer>>)nullableEnum16AsStringArray.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnum16AsStringArray)), (IEnumerable>)source.GetCurrentValue>>(nullableEnum16AsStringCollection) == null ? null : (List>)((ValueComparer>>)nullableEnum16AsStringCollection.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnum16AsStringCollection)), (IEnumerable>)source.GetCurrentValue>>(nullableEnum16Collection) == null ? null : (List>)((ValueComparer>>)nullableEnum16Collection.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnum16Collection)), source.GetCurrentValue>(nullableEnum32) == null ? null : ((ValueComparer>)nullableEnum32.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnum32)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnum32Array) == null ? null : (Nullable[])((ValueComparer>>)nullableEnum32Array.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnum32Array)), source.GetCurrentValue>(nullableEnum32AsString) == null ? null : ((ValueComparer>)nullableEnum32AsString.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnum32AsString)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnum32AsStringArray) == null ? null : (Nullable[])((ValueComparer>>)nullableEnum32AsStringArray.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnum32AsStringArray)), (IEnumerable>)source.GetCurrentValue>>(nullableEnum32AsStringCollection) == null ? null : (List>)((ValueComparer>>)nullableEnum32AsStringCollection.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnum32AsStringCollection)), (IEnumerable>)source.GetCurrentValue>>(nullableEnum32Collection) == null ? null : (List>)((ValueComparer>>)nullableEnum32Collection.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnum32Collection)), (object)source.GetCurrentValue[][][]>(nullableEnum32NestedCollection) == null ? null : (Nullable[][][])((ValueComparer)nullableEnum32NestedCollection.GetValueComparer()).Snapshot((object)source.GetCurrentValue[][][]>(nullableEnum32NestedCollection)), source.GetCurrentValue>(nullableEnum64) == null ? null : ((ValueComparer>)nullableEnum64.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnum64)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnum64Array) == null ? null : (Nullable[])((ValueComparer>>)nullableEnum64Array.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnum64Array)), source.GetCurrentValue>(nullableEnum64AsString) == null ? null : ((ValueComparer>)nullableEnum64AsString.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnum64AsString)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnum64AsStringArray) == null ? null : (Nullable[])((ValueComparer>>)nullableEnum64AsStringArray.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnum64AsStringArray)), (IEnumerable>)source.GetCurrentValue>>(nullableEnum64AsStringCollection) == null ? null : (List>)((ValueComparer>>)nullableEnum64AsStringCollection.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnum64AsStringCollection)), (IEnumerable>)source.GetCurrentValue>>(nullableEnum64Collection) == null ? null : (List>)((ValueComparer>>)nullableEnum64Collection.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnum64Collection)), source.GetCurrentValue>(nullableEnum8) == null ? null : ((ValueComparer>)nullableEnum8.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnum8)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnum8Array) == null ? null : (Nullable[])((ValueComparer>>)nullableEnum8Array.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnum8Array)), source.GetCurrentValue>(nullableEnum8AsString) == null ? null : ((ValueComparer>)nullableEnum8AsString.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnum8AsString))); + var liftedArg3 = (ISnapshot)new Snapshot, Nullable[], Nullable, Nullable[], Nullable, Nullable[], Nullable, Nullable[], Nullable, Nullable[], Nullable, Nullable[], List>, List>, Nullable, Nullable[], Nullable, Nullable[], List>, List>, Nullable[][][], Nullable, Nullable[], Nullable, Nullable[], List>, List>, Nullable, Nullable[], Nullable>(source.GetCurrentValue>(nullableDateOnly) == null ? null : ((ValueComparer>)((IProperty)nullableDateOnly).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableDateOnly)), (IEnumerable>)source.GetCurrentValue[]>(nullableDateOnlyArray) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableDateOnlyArray).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableDateOnlyArray)), source.GetCurrentValue>(nullableDateTime) == null ? null : ((ValueComparer>)((IProperty)nullableDateTime).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableDateTime)), (IEnumerable>)source.GetCurrentValue[]>(nullableDateTimeArray) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableDateTimeArray).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableDateTimeArray)), source.GetCurrentValue>(nullableDecimal) == null ? null : ((ValueComparer>)((IProperty)nullableDecimal).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableDecimal)), (IEnumerable>)source.GetCurrentValue[]>(nullableDecimalArray) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableDecimalArray).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableDecimalArray)), source.GetCurrentValue>(nullableDouble) == null ? null : ((ValueComparer>)((IProperty)nullableDouble).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableDouble)), (IEnumerable>)source.GetCurrentValue[]>(nullableDoubleArray) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableDoubleArray).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableDoubleArray)), source.GetCurrentValue>(nullableEnum16) == null ? null : ((ValueComparer>)((IProperty)nullableEnum16).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnum16)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnum16Array) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableEnum16Array).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnum16Array)), source.GetCurrentValue>(nullableEnum16AsString) == null ? null : ((ValueComparer>)((IProperty)nullableEnum16AsString).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnum16AsString)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnum16AsStringArray) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableEnum16AsStringArray).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnum16AsStringArray)), (IEnumerable>)source.GetCurrentValue>>(nullableEnum16AsStringCollection) == null ? null : (List>)((ValueComparer>>)((IProperty)nullableEnum16AsStringCollection).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnum16AsStringCollection)), (IEnumerable>)source.GetCurrentValue>>(nullableEnum16Collection) == null ? null : (List>)((ValueComparer>>)((IProperty)nullableEnum16Collection).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnum16Collection)), source.GetCurrentValue>(nullableEnum32) == null ? null : ((ValueComparer>)((IProperty)nullableEnum32).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnum32)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnum32Array) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableEnum32Array).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnum32Array)), source.GetCurrentValue>(nullableEnum32AsString) == null ? null : ((ValueComparer>)((IProperty)nullableEnum32AsString).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnum32AsString)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnum32AsStringArray) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableEnum32AsStringArray).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnum32AsStringArray)), (IEnumerable>)source.GetCurrentValue>>(nullableEnum32AsStringCollection) == null ? null : (List>)((ValueComparer>>)((IProperty)nullableEnum32AsStringCollection).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnum32AsStringCollection)), (IEnumerable>)source.GetCurrentValue>>(nullableEnum32Collection) == null ? null : (List>)((ValueComparer>>)((IProperty)nullableEnum32Collection).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnum32Collection)), (object)source.GetCurrentValue[][][]>(nullableEnum32NestedCollection) == null ? null : (Nullable[][][])((ValueComparer)((IProperty)nullableEnum32NestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue[][][]>(nullableEnum32NestedCollection)), source.GetCurrentValue>(nullableEnum64) == null ? null : ((ValueComparer>)((IProperty)nullableEnum64).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnum64)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnum64Array) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableEnum64Array).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnum64Array)), source.GetCurrentValue>(nullableEnum64AsString) == null ? null : ((ValueComparer>)((IProperty)nullableEnum64AsString).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnum64AsString)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnum64AsStringArray) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableEnum64AsStringArray).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnum64AsStringArray)), (IEnumerable>)source.GetCurrentValue>>(nullableEnum64AsStringCollection) == null ? null : (List>)((ValueComparer>>)((IProperty)nullableEnum64AsStringCollection).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnum64AsStringCollection)), (IEnumerable>)source.GetCurrentValue>>(nullableEnum64Collection) == null ? null : (List>)((ValueComparer>>)((IProperty)nullableEnum64Collection).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnum64Collection)), source.GetCurrentValue>(nullableEnum8) == null ? null : ((ValueComparer>)((IProperty)nullableEnum8).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnum8)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnum8Array) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableEnum8Array).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnum8Array)), source.GetCurrentValue>(nullableEnum8AsString) == null ? null : ((ValueComparer>)((IProperty)nullableEnum8AsString).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnum8AsString))); var entity4 = (CompiledModelTestBase.ManyTypes)source.Entity; - var liftedArg4 = (ISnapshot)new Snapshot[], List>, List>, Nullable[][], Nullable, Nullable[], Nullable, Nullable[], List>, List>, Nullable, Nullable[], Nullable, Nullable[], List>, List>, Nullable, Nullable[], Nullable, Nullable[], List>, List>, Nullable[][], Nullable, Nullable[], Nullable, Nullable[], List>, List>, Nullable>((IEnumerable>)source.GetCurrentValue[]>(nullableEnum8AsStringArray) == null ? null : (Nullable[])((ValueComparer>>)nullableEnum8AsStringArray.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnum8AsStringArray)), (IEnumerable>)source.GetCurrentValue>>(nullableEnum8AsStringCollection) == null ? null : (List>)((ValueComparer>>)nullableEnum8AsStringCollection.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnum8AsStringCollection)), (IEnumerable>)source.GetCurrentValue>>(nullableEnum8Collection) == null ? null : (List>)((ValueComparer>>)nullableEnum8Collection.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnum8Collection)), (object)source.GetCurrentValue[][]>(nullableEnum8NestedCollection) == null ? null : (Nullable[][])((ValueComparer)nullableEnum8NestedCollection.GetValueComparer()).Snapshot((object)source.GetCurrentValue[][]>(nullableEnum8NestedCollection)), source.GetCurrentValue>(nullableEnumU16) == null ? null : ((ValueComparer>)nullableEnumU16.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnumU16)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnumU16Array) == null ? null : (Nullable[])((ValueComparer>>)nullableEnumU16Array.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnumU16Array)), source.GetCurrentValue>(nullableEnumU16AsString) == null ? null : ((ValueComparer>)nullableEnumU16AsString.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnumU16AsString)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnumU16AsStringArray) == null ? null : (Nullable[])((ValueComparer>>)nullableEnumU16AsStringArray.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnumU16AsStringArray)), (IEnumerable>)source.GetCurrentValue>>(nullableEnumU16AsStringCollection) == null ? null : (List>)((ValueComparer>>)nullableEnumU16AsStringCollection.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnumU16AsStringCollection)), (IEnumerable>)source.GetCurrentValue>>(nullableEnumU16Collection) == null ? null : (List>)((ValueComparer>>)nullableEnumU16Collection.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnumU16Collection)), source.GetCurrentValue>(nullableEnumU32) == null ? null : ((ValueComparer>)nullableEnumU32.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnumU32)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnumU32Array) == null ? null : (Nullable[])((ValueComparer>>)nullableEnumU32Array.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnumU32Array)), source.GetCurrentValue>(nullableEnumU32AsString) == null ? null : ((ValueComparer>)nullableEnumU32AsString.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnumU32AsString)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnumU32AsStringArray) == null ? null : (Nullable[])((ValueComparer>>)nullableEnumU32AsStringArray.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnumU32AsStringArray)), (IEnumerable>)source.GetCurrentValue>>(nullableEnumU32AsStringCollection) == null ? null : (List>)((ValueComparer>>)nullableEnumU32AsStringCollection.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnumU32AsStringCollection)), (IEnumerable>)source.GetCurrentValue>>(nullableEnumU32Collection) == null ? null : (List>)((ValueComparer>>)nullableEnumU32Collection.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnumU32Collection)), source.GetCurrentValue>(nullableEnumU64) == null ? null : ((ValueComparer>)nullableEnumU64.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnumU64)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnumU64Array) == null ? null : (Nullable[])((ValueComparer>>)nullableEnumU64Array.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnumU64Array)), source.GetCurrentValue>(nullableEnumU64AsString) == null ? null : ((ValueComparer>)nullableEnumU64AsString.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnumU64AsString)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnumU64AsStringArray) == null ? null : (Nullable[])((ValueComparer>>)nullableEnumU64AsStringArray.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnumU64AsStringArray)), (IEnumerable>)source.GetCurrentValue>>(nullableEnumU64AsStringCollection) == null ? null : (List>)((ValueComparer>>)nullableEnumU64AsStringCollection.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnumU64AsStringCollection)), (IEnumerable>)source.GetCurrentValue>>(nullableEnumU64Collection) == null ? null : (List>)((ValueComparer>>)nullableEnumU64Collection.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnumU64Collection)), (object)source.GetCurrentValue[][]>(nullableEnumU64NestedCollection) == null ? null : (Nullable[][])((ValueComparer)nullableEnumU64NestedCollection.GetValueComparer()).Snapshot((object)source.GetCurrentValue[][]>(nullableEnumU64NestedCollection)), source.GetCurrentValue>(nullableEnumU8) == null ? null : ((ValueComparer>)nullableEnumU8.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnumU8)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnumU8Array) == null ? null : (Nullable[])((ValueComparer>>)nullableEnumU8Array.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnumU8Array)), source.GetCurrentValue>(nullableEnumU8AsString) == null ? null : ((ValueComparer>)nullableEnumU8AsString.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnumU8AsString)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnumU8AsStringArray) == null ? null : (Nullable[])((ValueComparer>>)nullableEnumU8AsStringArray.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnumU8AsStringArray)), (IEnumerable>)source.GetCurrentValue>>(nullableEnumU8AsStringCollection) == null ? null : (List>)((ValueComparer>>)nullableEnumU8AsStringCollection.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnumU8AsStringCollection)), (IEnumerable>)source.GetCurrentValue>>(nullableEnumU8Collection) == null ? null : (List>)((ValueComparer>>)nullableEnumU8Collection.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnumU8Collection)), source.GetCurrentValue>(nullableFloat) == null ? null : ((ValueComparer>)nullableFloat.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableFloat))); + var liftedArg4 = (ISnapshot)new Snapshot[], List>, List>, Nullable[][], Nullable, Nullable[], Nullable, Nullable[], List>, List>, Nullable, Nullable[], Nullable, Nullable[], List>, List>, Nullable, Nullable[], Nullable, Nullable[], List>, List>, Nullable[][], Nullable, Nullable[], Nullable, Nullable[], List>, List>, Nullable>((IEnumerable>)source.GetCurrentValue[]>(nullableEnum8AsStringArray) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableEnum8AsStringArray).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnum8AsStringArray)), (IEnumerable>)source.GetCurrentValue>>(nullableEnum8AsStringCollection) == null ? null : (List>)((ValueComparer>>)((IProperty)nullableEnum8AsStringCollection).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnum8AsStringCollection)), (IEnumerable>)source.GetCurrentValue>>(nullableEnum8Collection) == null ? null : (List>)((ValueComparer>>)((IProperty)nullableEnum8Collection).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnum8Collection)), (object)source.GetCurrentValue[][]>(nullableEnum8NestedCollection) == null ? null : (Nullable[][])((ValueComparer)((IProperty)nullableEnum8NestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue[][]>(nullableEnum8NestedCollection)), source.GetCurrentValue>(nullableEnumU16) == null ? null : ((ValueComparer>)((IProperty)nullableEnumU16).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnumU16)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnumU16Array) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableEnumU16Array).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnumU16Array)), source.GetCurrentValue>(nullableEnumU16AsString) == null ? null : ((ValueComparer>)((IProperty)nullableEnumU16AsString).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnumU16AsString)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnumU16AsStringArray) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableEnumU16AsStringArray).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnumU16AsStringArray)), (IEnumerable>)source.GetCurrentValue>>(nullableEnumU16AsStringCollection) == null ? null : (List>)((ValueComparer>>)((IProperty)nullableEnumU16AsStringCollection).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnumU16AsStringCollection)), (IEnumerable>)source.GetCurrentValue>>(nullableEnumU16Collection) == null ? null : (List>)((ValueComparer>>)((IProperty)nullableEnumU16Collection).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnumU16Collection)), source.GetCurrentValue>(nullableEnumU32) == null ? null : ((ValueComparer>)((IProperty)nullableEnumU32).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnumU32)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnumU32Array) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableEnumU32Array).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnumU32Array)), source.GetCurrentValue>(nullableEnumU32AsString) == null ? null : ((ValueComparer>)((IProperty)nullableEnumU32AsString).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnumU32AsString)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnumU32AsStringArray) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableEnumU32AsStringArray).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnumU32AsStringArray)), (IEnumerable>)source.GetCurrentValue>>(nullableEnumU32AsStringCollection) == null ? null : (List>)((ValueComparer>>)((IProperty)nullableEnumU32AsStringCollection).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnumU32AsStringCollection)), (IEnumerable>)source.GetCurrentValue>>(nullableEnumU32Collection) == null ? null : (List>)((ValueComparer>>)((IProperty)nullableEnumU32Collection).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnumU32Collection)), source.GetCurrentValue>(nullableEnumU64) == null ? null : ((ValueComparer>)((IProperty)nullableEnumU64).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnumU64)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnumU64Array) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableEnumU64Array).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnumU64Array)), source.GetCurrentValue>(nullableEnumU64AsString) == null ? null : ((ValueComparer>)((IProperty)nullableEnumU64AsString).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnumU64AsString)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnumU64AsStringArray) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableEnumU64AsStringArray).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnumU64AsStringArray)), (IEnumerable>)source.GetCurrentValue>>(nullableEnumU64AsStringCollection) == null ? null : (List>)((ValueComparer>>)((IProperty)nullableEnumU64AsStringCollection).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnumU64AsStringCollection)), (IEnumerable>)source.GetCurrentValue>>(nullableEnumU64Collection) == null ? null : (List>)((ValueComparer>>)((IProperty)nullableEnumU64Collection).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnumU64Collection)), (object)source.GetCurrentValue[][]>(nullableEnumU64NestedCollection) == null ? null : (Nullable[][])((ValueComparer)((IProperty)nullableEnumU64NestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue[][]>(nullableEnumU64NestedCollection)), source.GetCurrentValue>(nullableEnumU8) == null ? null : ((ValueComparer>)((IProperty)nullableEnumU8).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnumU8)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnumU8Array) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableEnumU8Array).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnumU8Array)), source.GetCurrentValue>(nullableEnumU8AsString) == null ? null : ((ValueComparer>)((IProperty)nullableEnumU8AsString).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnumU8AsString)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnumU8AsStringArray) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableEnumU8AsStringArray).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnumU8AsStringArray)), (IEnumerable>)source.GetCurrentValue>>(nullableEnumU8AsStringCollection) == null ? null : (List>)((ValueComparer>>)((IProperty)nullableEnumU8AsStringCollection).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnumU8AsStringCollection)), (IEnumerable>)source.GetCurrentValue>>(nullableEnumU8Collection) == null ? null : (List>)((ValueComparer>>)((IProperty)nullableEnumU8Collection).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnumU8Collection)), source.GetCurrentValue>(nullableFloat) == null ? null : ((ValueComparer>)((IProperty)nullableFloat).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableFloat))); var entity5 = (CompiledModelTestBase.ManyTypes)source.Entity; - var liftedArg5 = (ISnapshot)new Snapshot[], Nullable, Nullable[], Nullable[][], IPAddress, IPAddress[], Nullable, Nullable[], Nullable, Nullable[], Nullable[][], Nullable, Nullable[], List[][]>, Nullable, Nullable[], PhysicalAddress, PhysicalAddress[], IEnumerable, string, string[], string[][], Nullable, Nullable[], Nullable, Nullable[], Nullable, Nullable[], Nullable, Nullable[]>((IEnumerable>)source.GetCurrentValue[]>(nullableFloatArray) == null ? null : (Nullable[])((ValueComparer>>)nullableFloatArray.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableFloatArray)), source.GetCurrentValue>(nullableGuid) == null ? null : ((ValueComparer>)nullableGuid.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableGuid)), (IEnumerable>)source.GetCurrentValue[]>(nullableGuidArray) == null ? null : (Nullable[])((ValueComparer>>)nullableGuidArray.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableGuidArray)), (object)source.GetCurrentValue[][]>(nullableGuidNestedCollection) == null ? null : (Nullable[][])((ValueComparer)nullableGuidNestedCollection.GetValueComparer()).Snapshot((object)source.GetCurrentValue[][]>(nullableGuidNestedCollection)), source.GetCurrentValue(nullableIPAddress) == null ? null : ((ValueComparer)nullableIPAddress.GetValueComparer()).Snapshot(source.GetCurrentValue(nullableIPAddress)), (object)source.GetCurrentValue(nullableIPAddressArray) == null ? null : (IPAddress[])((ValueComparer)nullableIPAddressArray.GetValueComparer()).Snapshot((object)source.GetCurrentValue(nullableIPAddressArray)), source.GetCurrentValue>(nullableInt16) == null ? null : ((ValueComparer>)nullableInt16.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableInt16)), (IEnumerable>)source.GetCurrentValue[]>(nullableInt16Array) == null ? null : (Nullable[])((ValueComparer>>)nullableInt16Array.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableInt16Array)), source.GetCurrentValue>(nullableInt32) == null ? null : ((ValueComparer>)nullableInt32.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableInt32)), (IEnumerable>)source.GetCurrentValue[]>(nullableInt32Array) == null ? null : (Nullable[])((ValueComparer>>)nullableInt32Array.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableInt32Array)), (object)source.GetCurrentValue[][]>(nullableInt32NestedCollection) == null ? null : (Nullable[][])((ValueComparer)nullableInt32NestedCollection.GetValueComparer()).Snapshot((object)source.GetCurrentValue[][]>(nullableInt32NestedCollection)), source.GetCurrentValue>(nullableInt64) == null ? null : ((ValueComparer>)nullableInt64.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableInt64)), (IEnumerable>)source.GetCurrentValue[]>(nullableInt64Array) == null ? null : (Nullable[])((ValueComparer>>)nullableInt64Array.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableInt64Array)), (object)source.GetCurrentValue[][]>>(nullableInt64NestedCollection) == null ? null : (List[][]>)((ValueComparer)nullableInt64NestedCollection.GetValueComparer()).Snapshot((object)source.GetCurrentValue[][]>>(nullableInt64NestedCollection)), source.GetCurrentValue>(nullableInt8) == null ? null : ((ValueComparer>)nullableInt8.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableInt8)), (IEnumerable>)source.GetCurrentValue[]>(nullableInt8Array) == null ? null : (Nullable[])((ValueComparer>>)nullableInt8Array.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableInt8Array)), source.GetCurrentValue(nullablePhysicalAddress) == null ? null : ((ValueComparer)nullablePhysicalAddress.GetValueComparer()).Snapshot(source.GetCurrentValue(nullablePhysicalAddress)), (object)source.GetCurrentValue(nullablePhysicalAddressArray) == null ? null : (PhysicalAddress[])((ValueComparer)nullablePhysicalAddressArray.GetValueComparer()).Snapshot((object)source.GetCurrentValue(nullablePhysicalAddressArray)), (object)source.GetCurrentValue>(nullablePhysicalAddressNestedCollection) == null ? null : (IEnumerable)((ValueComparer)nullablePhysicalAddressNestedCollection.GetValueComparer()).Snapshot((object)source.GetCurrentValue>(nullablePhysicalAddressNestedCollection)), source.GetCurrentValue(nullableString) == null ? null : ((ValueComparer)nullableString.GetValueComparer()).Snapshot(source.GetCurrentValue(nullableString)), (object)source.GetCurrentValue(nullableStringArray) == null ? null : (string[])((ValueComparer)nullableStringArray.GetValueComparer()).Snapshot((object)source.GetCurrentValue(nullableStringArray)), (object)source.GetCurrentValue(nullableStringNestedCollection) == null ? null : (string[][])((ValueComparer)nullableStringNestedCollection.GetValueComparer()).Snapshot((object)source.GetCurrentValue(nullableStringNestedCollection)), source.GetCurrentValue>(nullableTimeOnly) == null ? null : ((ValueComparer>)nullableTimeOnly.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableTimeOnly)), (IEnumerable>)source.GetCurrentValue[]>(nullableTimeOnlyArray) == null ? null : (Nullable[])((ValueComparer>>)nullableTimeOnlyArray.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableTimeOnlyArray)), source.GetCurrentValue>(nullableTimeSpan) == null ? null : ((ValueComparer>)nullableTimeSpan.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableTimeSpan)), (IEnumerable>)source.GetCurrentValue[]>(nullableTimeSpanArray) == null ? null : (Nullable[])((ValueComparer>>)nullableTimeSpanArray.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableTimeSpanArray)), source.GetCurrentValue>(nullableUInt16) == null ? null : ((ValueComparer>)nullableUInt16.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableUInt16)), (IEnumerable>)source.GetCurrentValue[]>(nullableUInt16Array) == null ? null : (Nullable[])((ValueComparer>>)nullableUInt16Array.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableUInt16Array)), source.GetCurrentValue>(nullableUInt32) == null ? null : ((ValueComparer>)nullableUInt32.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableUInt32)), (IEnumerable>)source.GetCurrentValue[]>(nullableUInt32Array) == null ? null : (Nullable[])((ValueComparer>>)nullableUInt32Array.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableUInt32Array))); + var liftedArg5 = (ISnapshot)new Snapshot[], Nullable, Nullable[], Nullable[][], IPAddress, IPAddress[], Nullable, Nullable[], Nullable, Nullable[], Nullable[][], Nullable, Nullable[], List[][]>, Nullable, Nullable[], PhysicalAddress, PhysicalAddress[], IEnumerable, string, string[], string[][], Nullable, Nullable[], Nullable, Nullable[], Nullable, Nullable[], Nullable, Nullable[]>((IEnumerable>)source.GetCurrentValue[]>(nullableFloatArray) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableFloatArray).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableFloatArray)), source.GetCurrentValue>(nullableGuid) == null ? null : ((ValueComparer>)((IProperty)nullableGuid).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableGuid)), (IEnumerable>)source.GetCurrentValue[]>(nullableGuidArray) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableGuidArray).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableGuidArray)), (object)source.GetCurrentValue[][]>(nullableGuidNestedCollection) == null ? null : (Nullable[][])((ValueComparer)((IProperty)nullableGuidNestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue[][]>(nullableGuidNestedCollection)), source.GetCurrentValue(nullableIPAddress) == null ? null : ((ValueComparer)((IProperty)nullableIPAddress).GetValueComparer()).Snapshot(source.GetCurrentValue(nullableIPAddress)), (object)source.GetCurrentValue(nullableIPAddressArray) == null ? null : (IPAddress[])((ValueComparer)((IProperty)nullableIPAddressArray).GetValueComparer()).Snapshot((object)source.GetCurrentValue(nullableIPAddressArray)), source.GetCurrentValue>(nullableInt16) == null ? null : ((ValueComparer>)((IProperty)nullableInt16).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableInt16)), (IEnumerable>)source.GetCurrentValue[]>(nullableInt16Array) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableInt16Array).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableInt16Array)), source.GetCurrentValue>(nullableInt32) == null ? null : ((ValueComparer>)((IProperty)nullableInt32).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableInt32)), (IEnumerable>)source.GetCurrentValue[]>(nullableInt32Array) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableInt32Array).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableInt32Array)), (object)source.GetCurrentValue[][]>(nullableInt32NestedCollection) == null ? null : (Nullable[][])((ValueComparer)((IProperty)nullableInt32NestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue[][]>(nullableInt32NestedCollection)), source.GetCurrentValue>(nullableInt64) == null ? null : ((ValueComparer>)((IProperty)nullableInt64).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableInt64)), (IEnumerable>)source.GetCurrentValue[]>(nullableInt64Array) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableInt64Array).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableInt64Array)), (object)source.GetCurrentValue[][]>>(nullableInt64NestedCollection) == null ? null : (List[][]>)((ValueComparer)((IProperty)nullableInt64NestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue[][]>>(nullableInt64NestedCollection)), source.GetCurrentValue>(nullableInt8) == null ? null : ((ValueComparer>)((IProperty)nullableInt8).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableInt8)), (IEnumerable>)source.GetCurrentValue[]>(nullableInt8Array) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableInt8Array).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableInt8Array)), source.GetCurrentValue(nullablePhysicalAddress) == null ? null : ((ValueComparer)((IProperty)nullablePhysicalAddress).GetValueComparer()).Snapshot(source.GetCurrentValue(nullablePhysicalAddress)), (object)source.GetCurrentValue(nullablePhysicalAddressArray) == null ? null : (PhysicalAddress[])((ValueComparer)((IProperty)nullablePhysicalAddressArray).GetValueComparer()).Snapshot((object)source.GetCurrentValue(nullablePhysicalAddressArray)), (object)source.GetCurrentValue>(nullablePhysicalAddressNestedCollection) == null ? null : (IEnumerable)((ValueComparer)((IProperty)nullablePhysicalAddressNestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(nullablePhysicalAddressNestedCollection)), source.GetCurrentValue(nullableString) == null ? null : ((ValueComparer)((IProperty)nullableString).GetValueComparer()).Snapshot(source.GetCurrentValue(nullableString)), (object)source.GetCurrentValue(nullableStringArray) == null ? null : (string[])((ValueComparer)((IProperty)nullableStringArray).GetValueComparer()).Snapshot((object)source.GetCurrentValue(nullableStringArray)), (object)source.GetCurrentValue(nullableStringNestedCollection) == null ? null : (string[][])((ValueComparer)((IProperty)nullableStringNestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue(nullableStringNestedCollection)), source.GetCurrentValue>(nullableTimeOnly) == null ? null : ((ValueComparer>)((IProperty)nullableTimeOnly).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableTimeOnly)), (IEnumerable>)source.GetCurrentValue[]>(nullableTimeOnlyArray) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableTimeOnlyArray).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableTimeOnlyArray)), source.GetCurrentValue>(nullableTimeSpan) == null ? null : ((ValueComparer>)((IProperty)nullableTimeSpan).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableTimeSpan)), (IEnumerable>)source.GetCurrentValue[]>(nullableTimeSpanArray) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableTimeSpanArray).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableTimeSpanArray)), source.GetCurrentValue>(nullableUInt16) == null ? null : ((ValueComparer>)((IProperty)nullableUInt16).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableUInt16)), (IEnumerable>)source.GetCurrentValue[]>(nullableUInt16Array) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableUInt16Array).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableUInt16Array)), source.GetCurrentValue>(nullableUInt32) == null ? null : ((ValueComparer>)((IProperty)nullableUInt32).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableUInt32)), (IEnumerable>)source.GetCurrentValue[]>(nullableUInt32Array) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableUInt32Array).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableUInt32Array))); var entity6 = (CompiledModelTestBase.ManyTypes)source.Entity; - var liftedArg6 = (ISnapshot)new Snapshot, Nullable[], Nullable, Nullable[], Nullable[][], Uri, Uri[], PhysicalAddress, PhysicalAddress[], PhysicalAddress, PhysicalAddress, string, string[], string[][], string, string, string, string, string, string, string, string, string, string, string, string, string, string, TimeOnly, TimeOnly[]>(source.GetCurrentValue>(nullableUInt64) == null ? null : ((ValueComparer>)nullableUInt64.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableUInt64)), (IEnumerable>)source.GetCurrentValue[]>(nullableUInt64Array) == null ? null : (Nullable[])((ValueComparer>>)nullableUInt64Array.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableUInt64Array)), source.GetCurrentValue>(nullableUInt8) == null ? null : ((ValueComparer>)nullableUInt8.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableUInt8)), (IEnumerable>)source.GetCurrentValue[]>(nullableUInt8Array) == null ? null : (Nullable[])((ValueComparer>>)nullableUInt8Array.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableUInt8Array)), (object)source.GetCurrentValue[][]>(nullableUInt8NestedCollection) == null ? null : (Nullable[][])((ValueComparer)nullableUInt8NestedCollection.GetValueComparer()).Snapshot((object)source.GetCurrentValue[][]>(nullableUInt8NestedCollection)), source.GetCurrentValue(nullableUri) == null ? null : ((ValueComparer)nullableUri.GetValueComparer()).Snapshot(source.GetCurrentValue(nullableUri)), (object)source.GetCurrentValue(nullableUriArray) == null ? null : (Uri[])((ValueComparer)nullableUriArray.GetValueComparer()).Snapshot((object)source.GetCurrentValue(nullableUriArray)), source.GetCurrentValue(physicalAddress) == null ? null : ((ValueComparer)physicalAddress.GetValueComparer()).Snapshot(source.GetCurrentValue(physicalAddress)), (object)source.GetCurrentValue(physicalAddressArray) == null ? null : (PhysicalAddress[])((ValueComparer)physicalAddressArray.GetValueComparer()).Snapshot((object)source.GetCurrentValue(physicalAddressArray)), source.GetCurrentValue(physicalAddressToBytesConverterProperty) == null ? null : ((ValueComparer)physicalAddressToBytesConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(physicalAddressToBytesConverterProperty)), source.GetCurrentValue(physicalAddressToStringConverterProperty) == null ? null : ((ValueComparer)physicalAddressToStringConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(physicalAddressToStringConverterProperty)), source.GetCurrentValue(@string) == null ? null : ((ValueComparer)@string.GetValueComparer()).Snapshot(source.GetCurrentValue(@string)), (object)source.GetCurrentValue(stringArray) == null ? null : (string[])((ValueComparer)stringArray.GetValueComparer()).Snapshot((object)source.GetCurrentValue(stringArray)), (object)source.GetCurrentValue(stringNestedCollection) == null ? null : (string[][])((ValueComparer)stringNestedCollection.GetValueComparer()).Snapshot((object)source.GetCurrentValue(stringNestedCollection)), source.GetCurrentValue(stringToBoolConverterProperty) == null ? null : ((ValueComparer)stringToBoolConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(stringToBoolConverterProperty)), source.GetCurrentValue(stringToBytesConverterProperty) == null ? null : ((ValueComparer)stringToBytesConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(stringToBytesConverterProperty)), source.GetCurrentValue(stringToCharConverterProperty) == null ? null : ((ValueComparer)stringToCharConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(stringToCharConverterProperty)), source.GetCurrentValue(stringToDateOnlyConverterProperty) == null ? null : ((ValueComparer)stringToDateOnlyConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(stringToDateOnlyConverterProperty)), source.GetCurrentValue(stringToDateTimeConverterProperty) == null ? null : ((ValueComparer)stringToDateTimeConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(stringToDateTimeConverterProperty)), source.GetCurrentValue(stringToDateTimeOffsetConverterProperty) == null ? null : ((ValueComparer)stringToDateTimeOffsetConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(stringToDateTimeOffsetConverterProperty)), source.GetCurrentValue(stringToDecimalNumberConverterProperty) == null ? null : ((ValueComparer)stringToDecimalNumberConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(stringToDecimalNumberConverterProperty)), source.GetCurrentValue(stringToDoubleNumberConverterProperty) == null ? null : ((ValueComparer)stringToDoubleNumberConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(stringToDoubleNumberConverterProperty)), source.GetCurrentValue(stringToEnumConverterProperty) == null ? null : ((ValueComparer)stringToEnumConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(stringToEnumConverterProperty)), source.GetCurrentValue(stringToGuidConverterProperty) == null ? null : ((ValueComparer)stringToGuidConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(stringToGuidConverterProperty)), source.GetCurrentValue(stringToIntNumberConverterProperty) == null ? null : ((ValueComparer)stringToIntNumberConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(stringToIntNumberConverterProperty)), source.GetCurrentValue(stringToTimeOnlyConverterProperty) == null ? null : ((ValueComparer)stringToTimeOnlyConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(stringToTimeOnlyConverterProperty)), source.GetCurrentValue(stringToTimeSpanConverterProperty) == null ? null : ((ValueComparer)stringToTimeSpanConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(stringToTimeSpanConverterProperty)), source.GetCurrentValue(stringToUriConverterProperty) == null ? null : ((ValueComparer)stringToUriConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(stringToUriConverterProperty)), ((ValueComparer)timeOnly.GetValueComparer()).Snapshot(source.GetCurrentValue(timeOnly)), (IEnumerable)source.GetCurrentValue(timeOnlyArray) == null ? null : (TimeOnly[])((ValueComparer>)timeOnlyArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(timeOnlyArray))); + var liftedArg6 = (ISnapshot)new Snapshot, Nullable[], Nullable, Nullable[], Nullable[][], Uri, Uri[], PhysicalAddress, PhysicalAddress[], PhysicalAddress, PhysicalAddress, string, string[], string[][], string, string, string, string, string, string, string, string, string, string, string, string, string, string, TimeOnly, TimeOnly[]>(source.GetCurrentValue>(nullableUInt64) == null ? null : ((ValueComparer>)((IProperty)nullableUInt64).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableUInt64)), (IEnumerable>)source.GetCurrentValue[]>(nullableUInt64Array) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableUInt64Array).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableUInt64Array)), source.GetCurrentValue>(nullableUInt8) == null ? null : ((ValueComparer>)((IProperty)nullableUInt8).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableUInt8)), (IEnumerable>)source.GetCurrentValue[]>(nullableUInt8Array) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableUInt8Array).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableUInt8Array)), (object)source.GetCurrentValue[][]>(nullableUInt8NestedCollection) == null ? null : (Nullable[][])((ValueComparer)((IProperty)nullableUInt8NestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue[][]>(nullableUInt8NestedCollection)), source.GetCurrentValue(nullableUri) == null ? null : ((ValueComparer)((IProperty)nullableUri).GetValueComparer()).Snapshot(source.GetCurrentValue(nullableUri)), (object)source.GetCurrentValue(nullableUriArray) == null ? null : (Uri[])((ValueComparer)((IProperty)nullableUriArray).GetValueComparer()).Snapshot((object)source.GetCurrentValue(nullableUriArray)), source.GetCurrentValue(physicalAddress) == null ? null : ((ValueComparer)((IProperty)physicalAddress).GetValueComparer()).Snapshot(source.GetCurrentValue(physicalAddress)), (object)source.GetCurrentValue(physicalAddressArray) == null ? null : (PhysicalAddress[])((ValueComparer)((IProperty)physicalAddressArray).GetValueComparer()).Snapshot((object)source.GetCurrentValue(physicalAddressArray)), source.GetCurrentValue(physicalAddressToBytesConverterProperty) == null ? null : ((ValueComparer)((IProperty)physicalAddressToBytesConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(physicalAddressToBytesConverterProperty)), source.GetCurrentValue(physicalAddressToStringConverterProperty) == null ? null : ((ValueComparer)((IProperty)physicalAddressToStringConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(physicalAddressToStringConverterProperty)), source.GetCurrentValue(@string) == null ? null : ((ValueComparer)((IProperty)@string).GetValueComparer()).Snapshot(source.GetCurrentValue(@string)), (object)source.GetCurrentValue(stringArray) == null ? null : (string[])((ValueComparer)((IProperty)stringArray).GetValueComparer()).Snapshot((object)source.GetCurrentValue(stringArray)), (object)source.GetCurrentValue(stringNestedCollection) == null ? null : (string[][])((ValueComparer)((IProperty)stringNestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue(stringNestedCollection)), source.GetCurrentValue(stringToBoolConverterProperty) == null ? null : ((ValueComparer)((IProperty)stringToBoolConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(stringToBoolConverterProperty)), source.GetCurrentValue(stringToBytesConverterProperty) == null ? null : ((ValueComparer)((IProperty)stringToBytesConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(stringToBytesConverterProperty)), source.GetCurrentValue(stringToCharConverterProperty) == null ? null : ((ValueComparer)((IProperty)stringToCharConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(stringToCharConverterProperty)), source.GetCurrentValue(stringToDateOnlyConverterProperty) == null ? null : ((ValueComparer)((IProperty)stringToDateOnlyConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(stringToDateOnlyConverterProperty)), source.GetCurrentValue(stringToDateTimeConverterProperty) == null ? null : ((ValueComparer)((IProperty)stringToDateTimeConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(stringToDateTimeConverterProperty)), source.GetCurrentValue(stringToDateTimeOffsetConverterProperty) == null ? null : ((ValueComparer)((IProperty)stringToDateTimeOffsetConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(stringToDateTimeOffsetConverterProperty)), source.GetCurrentValue(stringToDecimalNumberConverterProperty) == null ? null : ((ValueComparer)((IProperty)stringToDecimalNumberConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(stringToDecimalNumberConverterProperty)), source.GetCurrentValue(stringToDoubleNumberConverterProperty) == null ? null : ((ValueComparer)((IProperty)stringToDoubleNumberConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(stringToDoubleNumberConverterProperty)), source.GetCurrentValue(stringToEnumConverterProperty) == null ? null : ((ValueComparer)((IProperty)stringToEnumConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(stringToEnumConverterProperty)), source.GetCurrentValue(stringToGuidConverterProperty) == null ? null : ((ValueComparer)((IProperty)stringToGuidConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(stringToGuidConverterProperty)), source.GetCurrentValue(stringToIntNumberConverterProperty) == null ? null : ((ValueComparer)((IProperty)stringToIntNumberConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(stringToIntNumberConverterProperty)), source.GetCurrentValue(stringToTimeOnlyConverterProperty) == null ? null : ((ValueComparer)((IProperty)stringToTimeOnlyConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(stringToTimeOnlyConverterProperty)), source.GetCurrentValue(stringToTimeSpanConverterProperty) == null ? null : ((ValueComparer)((IProperty)stringToTimeSpanConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(stringToTimeSpanConverterProperty)), source.GetCurrentValue(stringToUriConverterProperty) == null ? null : ((ValueComparer)((IProperty)stringToUriConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(stringToUriConverterProperty)), ((ValueComparer)((IProperty)timeOnly).GetValueComparer()).Snapshot(source.GetCurrentValue(timeOnly)), (IEnumerable)source.GetCurrentValue(timeOnlyArray) == null ? null : (TimeOnly[])((ValueComparer>)((IProperty)timeOnlyArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(timeOnlyArray))); var entity7 = (CompiledModelTestBase.ManyTypes)source.Entity; - return (ISnapshot)new MultiSnapshot(new ISnapshot[] { liftedArg, liftedArg0, liftedArg1, liftedArg2, liftedArg3, liftedArg4, liftedArg5, liftedArg6, (ISnapshot)new Snapshot, Uri, Uri[], Uri>(((ValueComparer)timeOnlyToStringConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(timeOnlyToStringConverterProperty)), ((ValueComparer)timeOnlyToTicksConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(timeOnlyToTicksConverterProperty)), ((ValueComparer)timeSpan.GetValueComparer()).Snapshot(source.GetCurrentValue(timeSpan)), (IEnumerable)source.GetCurrentValue(timeSpanArray) == null ? null : (TimeSpan[])((ValueComparer>)timeSpanArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(timeSpanArray)), ((ValueComparer)timeSpanToStringConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(timeSpanToStringConverterProperty)), ((ValueComparer)timeSpanToTicksConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(timeSpanToTicksConverterProperty)), ((ValueComparer)uInt16.GetValueComparer()).Snapshot(source.GetCurrentValue(uInt16)), (IEnumerable)source.GetCurrentValue(uInt16Array) == null ? null : (ushort[])((ValueComparer>)uInt16Array.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(uInt16Array)), ((ValueComparer)uInt32.GetValueComparer()).Snapshot(source.GetCurrentValue(uInt32)), (IEnumerable)source.GetCurrentValue(uInt32Array) == null ? null : (uint[])((ValueComparer>)uInt32Array.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(uInt32Array)), ((ValueComparer)uInt64.GetValueComparer()).Snapshot(source.GetCurrentValue(uInt64)), (IEnumerable)source.GetCurrentValue(uInt64Array) == null ? null : (ulong[])((ValueComparer>)uInt64Array.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(uInt64Array)), ((ValueComparer)uInt8.GetValueComparer()).Snapshot(source.GetCurrentValue(uInt8)), source.GetCurrentValue(uInt8Array) == null ? null : ((ValueComparer)uInt8Array.GetValueComparer()).Snapshot(source.GetCurrentValue(uInt8Array)), (object)source.GetCurrentValue>(uInt8NestedCollection) == null ? null : (List)((ValueComparer)uInt8NestedCollection.GetValueComparer()).Snapshot((object)source.GetCurrentValue>(uInt8NestedCollection)), source.GetCurrentValue(uri) == null ? null : ((ValueComparer)uri.GetValueComparer()).Snapshot(source.GetCurrentValue(uri)), (object)source.GetCurrentValue(uriArray) == null ? null : (Uri[])((ValueComparer)uriArray.GetValueComparer()).Snapshot((object)source.GetCurrentValue(uriArray)), source.GetCurrentValue(uriToStringConverterProperty) == null ? null : ((ValueComparer)uriToStringConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(uriToStringConverterProperty))) }); + return (ISnapshot)new MultiSnapshot(new ISnapshot[] { liftedArg, liftedArg0, liftedArg1, liftedArg2, liftedArg3, liftedArg4, liftedArg5, liftedArg6, (ISnapshot)new Snapshot, Uri, Uri[], Uri>(((ValueComparer)((IProperty)timeOnlyToStringConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(timeOnlyToStringConverterProperty)), ((ValueComparer)((IProperty)timeOnlyToTicksConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(timeOnlyToTicksConverterProperty)), ((ValueComparer)((IProperty)timeSpan).GetValueComparer()).Snapshot(source.GetCurrentValue(timeSpan)), (IEnumerable)source.GetCurrentValue(timeSpanArray) == null ? null : (TimeSpan[])((ValueComparer>)((IProperty)timeSpanArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(timeSpanArray)), ((ValueComparer)((IProperty)timeSpanToStringConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(timeSpanToStringConverterProperty)), ((ValueComparer)((IProperty)timeSpanToTicksConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(timeSpanToTicksConverterProperty)), ((ValueComparer)((IProperty)uInt16).GetValueComparer()).Snapshot(source.GetCurrentValue(uInt16)), (IEnumerable)source.GetCurrentValue(uInt16Array) == null ? null : (ushort[])((ValueComparer>)((IProperty)uInt16Array).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(uInt16Array)), ((ValueComparer)((IProperty)uInt32).GetValueComparer()).Snapshot(source.GetCurrentValue(uInt32)), (IEnumerable)source.GetCurrentValue(uInt32Array) == null ? null : (uint[])((ValueComparer>)((IProperty)uInt32Array).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(uInt32Array)), ((ValueComparer)((IProperty)uInt64).GetValueComparer()).Snapshot(source.GetCurrentValue(uInt64)), (IEnumerable)source.GetCurrentValue(uInt64Array) == null ? null : (ulong[])((ValueComparer>)((IProperty)uInt64Array).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(uInt64Array)), ((ValueComparer)((IProperty)uInt8).GetValueComparer()).Snapshot(source.GetCurrentValue(uInt8)), source.GetCurrentValue(uInt8Array) == null ? null : ((ValueComparer)((IProperty)uInt8Array).GetValueComparer()).Snapshot(source.GetCurrentValue(uInt8Array)), (object)source.GetCurrentValue>(uInt8NestedCollection) == null ? null : (List)((ValueComparer)((IProperty)uInt8NestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(uInt8NestedCollection)), source.GetCurrentValue(uri) == null ? null : ((ValueComparer)((IProperty)uri).GetValueComparer()).Snapshot(source.GetCurrentValue(uri)), (object)source.GetCurrentValue(uriArray) == null ? null : (Uri[])((ValueComparer)((IProperty)uriArray).GetValueComparer()).Snapshot((object)source.GetCurrentValue(uriArray)), source.GetCurrentValue(uriToStringConverterProperty) == null ? null : ((ValueComparer)((IProperty)uriToStringConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(uriToStringConverterProperty))) }); }); runtimeEntityType.SetStoreGeneratedValuesFactory( - () => (ISnapshot)new Snapshot(((ValueComparer)id.GetValueComparer()).Snapshot(default(CompiledModelTestBase.ManyTypesId)))); + () => (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetValueComparer()).Snapshot(default(CompiledModelTestBase.ManyTypesId)))); runtimeEntityType.SetTemporaryValuesFactory( (InternalEntityEntry source) => (ISnapshot)new Snapshot(default(CompiledModelTestBase.ManyTypesId))); runtimeEntityType.SetShadowValuesFactory( @@ -17637,8 +17659,8 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) runtimeEntityType.SetRelationshipSnapshotFactory( (InternalEntityEntry source) => { - var entity = (CompiledModelTestBase.ManyTypes)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)id.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(id))); + var entity8 = (CompiledModelTestBase.ManyTypes)source.Entity; + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(id))); }); runtimeEntityType.Counts = new PropertyCounts( propertyCount: 258, @@ -17670,13 +17692,7 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) public static extern ref bool[] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BoolArray(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] - extern static ref bool[][] GetBoolNestedCollection(CompiledModelTestBase.ManyTypes @this); - - public static bool[][] ReadBoolNestedCollection(CompiledModelTestBase.ManyTypes @this) - => GetBoolNestedCollection(@this); - - public static void WriteBoolNestedCollection(CompiledModelTestBase.ManyTypes @this, bool[][] value) - => GetBoolNestedCollection(@this) = value; + public static extern ref bool[][] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BoolNestedCollection(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref bool UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BoolToStringConverterProperty(CompiledModelTestBase.ManyTypes @this); @@ -17694,13 +17710,7 @@ public static void WriteBoolNestedCollection(CompiledModelTestBase.ManyTypes @th public static extern ref byte[][] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BytesArray(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] - extern static ref byte[][][] GetBytesNestedCollection(CompiledModelTestBase.ManyTypes @this); - - public static byte[][][] ReadBytesNestedCollection(CompiledModelTestBase.ManyTypes @this) - => GetBytesNestedCollection(@this); - - public static void WriteBytesNestedCollection(CompiledModelTestBase.ManyTypes @this, byte[][][] value) - => GetBytesNestedCollection(@this) = value; + public static extern ref byte[][][] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BytesNestedCollection(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref byte[] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BytesToStringConverterProperty(CompiledModelTestBase.ManyTypes @this); @@ -17715,13 +17725,7 @@ public static void WriteBytesNestedCollection(CompiledModelTestBase.ManyTypes @t public static extern ref char[] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_CharArray(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] - extern static ref char[][] GetCharNestedCollection(CompiledModelTestBase.ManyTypes @this); - - public static char[][] ReadCharNestedCollection(CompiledModelTestBase.ManyTypes @this) - => GetCharNestedCollection(@this); - - public static void WriteCharNestedCollection(CompiledModelTestBase.ManyTypes @this, char[][] value) - => GetCharNestedCollection(@this) = value; + public static extern ref char[][] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_CharNestedCollection(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref char UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_CharToStringConverterProperty(CompiledModelTestBase.ManyTypes @this); @@ -17820,13 +17824,7 @@ public static void WriteCharNestedCollection(CompiledModelTestBase.ManyTypes @th public static extern ref List UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum32Collection(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] - extern static ref List[][] GetEnum32NestedCollection(CompiledModelTestBase.ManyTypes @this); - - public static List[][] ReadEnum32NestedCollection(CompiledModelTestBase.ManyTypes @this) - => GetEnum32NestedCollection(@this); - - public static void WriteEnum32NestedCollection(CompiledModelTestBase.ManyTypes @this, List[][] value) - => GetEnum32NestedCollection(@this) = value; + public static extern ref List[][] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum32NestedCollection(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref CompiledModelTestBase.Enum64 UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum64(CompiledModelTestBase.ManyTypes @this); @@ -17865,13 +17863,7 @@ public static void WriteEnum32NestedCollection(CompiledModelTestBase.ManyTypes @ public static extern ref List UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum8Collection(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] - extern static ref CompiledModelTestBase.Enum8[][] GetEnum8NestedCollection(CompiledModelTestBase.ManyTypes @this); - - public static CompiledModelTestBase.Enum8[][] ReadEnum8NestedCollection(CompiledModelTestBase.ManyTypes @this) - => GetEnum8NestedCollection(@this); - - public static void WriteEnum8NestedCollection(CompiledModelTestBase.ManyTypes @this, CompiledModelTestBase.Enum8[][] value) - => GetEnum8NestedCollection(@this) = value; + public static extern ref CompiledModelTestBase.Enum8[][] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum8NestedCollection(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref CompiledModelTestBase.Enum32 UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumToNumberConverterProperty(CompiledModelTestBase.ManyTypes @this); @@ -17934,13 +17926,7 @@ public static void WriteEnum8NestedCollection(CompiledModelTestBase.ManyTypes @t public static extern ref List UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU64Collection(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] - extern static ref CompiledModelTestBase.EnumU64[][] GetEnumU64NestedCollection(CompiledModelTestBase.ManyTypes @this); - - public static CompiledModelTestBase.EnumU64[][] ReadEnumU64NestedCollection(CompiledModelTestBase.ManyTypes @this) - => GetEnumU64NestedCollection(@this); - - public static void WriteEnumU64NestedCollection(CompiledModelTestBase.ManyTypes @this, CompiledModelTestBase.EnumU64[][] value) - => GetEnumU64NestedCollection(@this) = value; + public static extern ref CompiledModelTestBase.EnumU64[][] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU64NestedCollection(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref CompiledModelTestBase.EnumU8 UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU8(CompiledModelTestBase.ManyTypes @this); @@ -17973,13 +17959,7 @@ public static void WriteEnumU64NestedCollection(CompiledModelTestBase.ManyTypes public static extern ref Guid[] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_GuidArray(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] - extern static ref ICollection GetGuidNestedCollection(CompiledModelTestBase.ManyTypes @this); - - public static ICollection ReadGuidNestedCollection(CompiledModelTestBase.ManyTypes @this) - => GetGuidNestedCollection(@this); - - public static void WriteGuidNestedCollection(CompiledModelTestBase.ManyTypes @this, ICollection value) - => GetGuidNestedCollection(@this) = value; + public static extern ref ICollection UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_GuidNestedCollection(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref Guid UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_GuidToBytesConverterProperty(CompiledModelTestBase.ManyTypes @this); @@ -18012,13 +17992,7 @@ public static void WriteGuidNestedCollection(CompiledModelTestBase.ManyTypes @th public static extern ref int[] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int32Array(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] - extern static ref int[][] GetInt32NestedCollection(CompiledModelTestBase.ManyTypes @this); - - public static int[][] ReadInt32NestedCollection(CompiledModelTestBase.ManyTypes @this) - => GetInt32NestedCollection(@this); - - public static void WriteInt32NestedCollection(CompiledModelTestBase.ManyTypes @this, int[][] value) - => GetInt32NestedCollection(@this) = value; + public static extern ref int[][] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int32NestedCollection(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref long UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int64(CompiledModelTestBase.ManyTypes @this); @@ -18027,13 +18001,7 @@ public static void WriteInt32NestedCollection(CompiledModelTestBase.ManyTypes @t public static extern ref long[] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int64Array(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] - extern static ref IList[] GetInt64NestedCollection(CompiledModelTestBase.ManyTypes @this); - - public static IList[] ReadInt64NestedCollection(CompiledModelTestBase.ManyTypes @this) - => GetInt64NestedCollection(@this); - - public static void WriteInt64NestedCollection(CompiledModelTestBase.ManyTypes @this, IList[] value) - => GetInt64NestedCollection(@this) = value; + public static extern ref IList[] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int64NestedCollection(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref sbyte UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int8(CompiledModelTestBase.ManyTypes @this); @@ -18042,13 +18010,7 @@ public static void WriteInt64NestedCollection(CompiledModelTestBase.ManyTypes @t public static extern ref sbyte[] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int8Array(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] - extern static ref sbyte[][][] GetInt8NestedCollection(CompiledModelTestBase.ManyTypes @this); - - public static sbyte[][][] ReadInt8NestedCollection(CompiledModelTestBase.ManyTypes @this) - => GetInt8NestedCollection(@this); - - public static void WriteInt8NestedCollection(CompiledModelTestBase.ManyTypes @this, sbyte[][][] value) - => GetInt8NestedCollection(@this) = value; + public static extern ref sbyte[][][] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int8NestedCollection(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref int UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_IntNumberToBytesConverterProperty(CompiledModelTestBase.ManyTypes @this); @@ -18072,13 +18034,7 @@ public static void WriteInt8NestedCollection(CompiledModelTestBase.ManyTypes @th public static extern ref byte[][] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableBytesArray(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] - extern static ref byte[][][] GetNullableBytesNestedCollection(CompiledModelTestBase.ManyTypes @this); - - public static byte[][][] ReadNullableBytesNestedCollection(CompiledModelTestBase.ManyTypes @this) - => GetNullableBytesNestedCollection(@this); - - public static void WriteNullableBytesNestedCollection(CompiledModelTestBase.ManyTypes @this, byte[][][] value) - => GetNullableBytesNestedCollection(@this) = value; + public static extern ref byte[][][] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableBytesNestedCollection(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref char? UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableChar(CompiledModelTestBase.ManyTypes @this); @@ -18147,13 +18103,7 @@ public static void WriteNullableBytesNestedCollection(CompiledModelTestBase.Many public static extern ref List UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum32Collection(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] - extern static ref CompiledModelTestBase.Enum32?[][][] GetNullableEnum32NestedCollection(CompiledModelTestBase.ManyTypes @this); - - public static CompiledModelTestBase.Enum32?[][][] ReadNullableEnum32NestedCollection(CompiledModelTestBase.ManyTypes @this) - => GetNullableEnum32NestedCollection(@this); - - public static void WriteNullableEnum32NestedCollection(CompiledModelTestBase.ManyTypes @this, CompiledModelTestBase.Enum32?[][][] value) - => GetNullableEnum32NestedCollection(@this) = value; + public static extern ref CompiledModelTestBase.Enum32?[][][] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum32NestedCollection(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref CompiledModelTestBase.Enum64? UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum64(CompiledModelTestBase.ManyTypes @this); @@ -18192,13 +18142,7 @@ public static void WriteNullableEnum32NestedCollection(CompiledModelTestBase.Man public static extern ref List UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum8Collection(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] - extern static ref CompiledModelTestBase.Enum8?[][] GetNullableEnum8NestedCollection(CompiledModelTestBase.ManyTypes @this); - - public static CompiledModelTestBase.Enum8?[][] ReadNullableEnum8NestedCollection(CompiledModelTestBase.ManyTypes @this) - => GetNullableEnum8NestedCollection(@this); - - public static void WriteNullableEnum8NestedCollection(CompiledModelTestBase.ManyTypes @this, CompiledModelTestBase.Enum8?[][] value) - => GetNullableEnum8NestedCollection(@this) = value; + public static extern ref CompiledModelTestBase.Enum8?[][] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum8NestedCollection(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref CompiledModelTestBase.EnumU16? UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU16(CompiledModelTestBase.ManyTypes @this); @@ -18255,13 +18199,7 @@ public static void WriteNullableEnum8NestedCollection(CompiledModelTestBase.Many public static extern ref List UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU64Collection(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] - extern static ref CompiledModelTestBase.EnumU64?[][] GetNullableEnumU64NestedCollection(CompiledModelTestBase.ManyTypes @this); - - public static CompiledModelTestBase.EnumU64?[][] ReadNullableEnumU64NestedCollection(CompiledModelTestBase.ManyTypes @this) - => GetNullableEnumU64NestedCollection(@this); - - public static void WriteNullableEnumU64NestedCollection(CompiledModelTestBase.ManyTypes @this, CompiledModelTestBase.EnumU64?[][] value) - => GetNullableEnumU64NestedCollection(@this) = value; + public static extern ref CompiledModelTestBase.EnumU64?[][] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU64NestedCollection(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref CompiledModelTestBase.EnumU8? UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU8(CompiledModelTestBase.ManyTypes @this); @@ -18294,13 +18232,7 @@ public static void WriteNullableEnumU64NestedCollection(CompiledModelTestBase.Ma public static extern ref Guid?[] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableGuidArray(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] - extern static ref Guid?[][] GetNullableGuidNestedCollection(CompiledModelTestBase.ManyTypes @this); - - public static Guid?[][] ReadNullableGuidNestedCollection(CompiledModelTestBase.ManyTypes @this) - => GetNullableGuidNestedCollection(@this); - - public static void WriteNullableGuidNestedCollection(CompiledModelTestBase.ManyTypes @this, Guid?[][] value) - => GetNullableGuidNestedCollection(@this) = value; + public static extern ref Guid?[][] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableGuidNestedCollection(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref IPAddress UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableIPAddress(CompiledModelTestBase.ManyTypes @this); @@ -18321,13 +18253,7 @@ public static void WriteNullableGuidNestedCollection(CompiledModelTestBase.ManyT public static extern ref int?[] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt32Array(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] - extern static ref int?[][] GetNullableInt32NestedCollection(CompiledModelTestBase.ManyTypes @this); - - public static int?[][] ReadNullableInt32NestedCollection(CompiledModelTestBase.ManyTypes @this) - => GetNullableInt32NestedCollection(@this); - - public static void WriteNullableInt32NestedCollection(CompiledModelTestBase.ManyTypes @this, int?[][] value) - => GetNullableInt32NestedCollection(@this) = value; + public static extern ref int?[][] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt32NestedCollection(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref long? UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt64(CompiledModelTestBase.ManyTypes @this); @@ -18336,13 +18262,7 @@ public static void WriteNullableInt32NestedCollection(CompiledModelTestBase.Many public static extern ref long?[] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt64Array(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] - extern static ref List GetNullableInt64NestedCollection(CompiledModelTestBase.ManyTypes @this); - - public static List ReadNullableInt64NestedCollection(CompiledModelTestBase.ManyTypes @this) - => GetNullableInt64NestedCollection(@this); - - public static void WriteNullableInt64NestedCollection(CompiledModelTestBase.ManyTypes @this, List value) - => GetNullableInt64NestedCollection(@this) = value; + public static extern ref List UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt64NestedCollection(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref sbyte? UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt8(CompiledModelTestBase.ManyTypes @this); @@ -18357,13 +18277,7 @@ public static void WriteNullableInt64NestedCollection(CompiledModelTestBase.Many public static extern ref PhysicalAddress[] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullablePhysicalAddressArray(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] - extern static ref IEnumerable GetNullablePhysicalAddressNestedCollection(CompiledModelTestBase.ManyTypes @this); - - public static IEnumerable ReadNullablePhysicalAddressNestedCollection(CompiledModelTestBase.ManyTypes @this) - => GetNullablePhysicalAddressNestedCollection(@this); - - public static void WriteNullablePhysicalAddressNestedCollection(CompiledModelTestBase.ManyTypes @this, IEnumerable value) - => GetNullablePhysicalAddressNestedCollection(@this) = value; + public static extern ref IEnumerable UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullablePhysicalAddressNestedCollection(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref string UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableString(CompiledModelTestBase.ManyTypes @this); @@ -18372,13 +18286,7 @@ public static void WriteNullablePhysicalAddressNestedCollection(CompiledModelTes public static extern ref string[] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableStringArray(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] - extern static ref string[][] GetNullableStringNestedCollection(CompiledModelTestBase.ManyTypes @this); - - public static string[][] ReadNullableStringNestedCollection(CompiledModelTestBase.ManyTypes @this) - => GetNullableStringNestedCollection(@this); - - public static void WriteNullableStringNestedCollection(CompiledModelTestBase.ManyTypes @this, string[][] value) - => GetNullableStringNestedCollection(@this) = value; + public static extern ref string[][] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableStringNestedCollection(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref TimeOnly? UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableTimeOnly(CompiledModelTestBase.ManyTypes @this); @@ -18417,13 +18325,7 @@ public static void WriteNullableStringNestedCollection(CompiledModelTestBase.Man public static extern ref byte?[] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUInt8Array(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] - extern static ref byte?[][] GetNullableUInt8NestedCollection(CompiledModelTestBase.ManyTypes @this); - - public static byte?[][] ReadNullableUInt8NestedCollection(CompiledModelTestBase.ManyTypes @this) - => GetNullableUInt8NestedCollection(@this); - - public static void WriteNullableUInt8NestedCollection(CompiledModelTestBase.ManyTypes @this, byte?[][] value) - => GetNullableUInt8NestedCollection(@this) = value; + public static extern ref byte?[][] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUInt8NestedCollection(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref Uri UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUri(CompiledModelTestBase.ManyTypes @this); @@ -18450,13 +18352,7 @@ public static void WriteNullableUInt8NestedCollection(CompiledModelTestBase.Many public static extern ref string[] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringArray(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] - extern static ref string[][] GetStringNestedCollection(CompiledModelTestBase.ManyTypes @this); - - public static string[][] ReadStringNestedCollection(CompiledModelTestBase.ManyTypes @this) - => GetStringNestedCollection(@this); - - public static void WriteStringNestedCollection(CompiledModelTestBase.ManyTypes @this, string[][] value) - => GetStringNestedCollection(@this) = value; + public static extern ref string[][] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringNestedCollection(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref string UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringToBoolConverterProperty(CompiledModelTestBase.ManyTypes @this); @@ -18549,13 +18445,7 @@ public static void WriteStringNestedCollection(CompiledModelTestBase.ManyTypes @ public static extern ref byte[] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UInt8Array(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] - extern static ref List GetUInt8NestedCollection(CompiledModelTestBase.ManyTypes @this); - - public static List ReadUInt8NestedCollection(CompiledModelTestBase.ManyTypes @this) - => GetUInt8NestedCollection(@this); - - public static void WriteUInt8NestedCollection(CompiledModelTestBase.ManyTypes @this, List value) - => GetUInt8NestedCollection(@this) = value; + public static extern ref List UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UInt8NestedCollection(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref Uri UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Uri(CompiledModelTestBase.ManyTypes @this); diff --git a/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/BigModel/OwnedType0EntityType.cs b/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/BigModel/OwnedType0EntityType.cs index cbc653bb819..39e5a42b884 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/BigModel/OwnedType0EntityType.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/BigModel/OwnedType0EntityType.cs @@ -50,15 +50,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas principalDerivedId.TypeMapping = SqlServerLongTypeMapping.Default.Clone( comparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), keyComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v)); principalDerivedId.SetCurrentValueComparer(new EntryCurrentValueComparer(principalDerivedId)); principalDerivedId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); @@ -77,15 +77,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas principalDerivedAlternateId.TypeMapping = GuidTypeMapping.Default.Clone( comparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), keyComparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), providerValueComparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "uniqueidentifier")); @@ -150,15 +150,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas details.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -241,15 +241,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas refTypeArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -259,27 +259,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)))), elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), keyComparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(45)", @@ -287,12 +287,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))); refTypeArray.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); refTypeArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("OwnedType0EntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_OwnedType__refTypeArray", "TestNamespace") }); @@ -327,15 +327,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas refTypeEnumerable.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer, string>(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), keyComparer: new ListOfReferenceTypesComparer, string>(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -349,15 +349,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -397,15 +397,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas refTypeIList.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer, string>(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), keyComparer: new ListOfReferenceTypesComparer, string>(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -419,15 +419,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -467,15 +467,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas refTypeList.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer, IPAddress>(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), keyComparer: new ListOfReferenceTypesComparer, IPAddress>(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -485,27 +485,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter, IPAddress>( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)))), elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), keyComparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(45)", @@ -513,12 +513,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))); refTypeList.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); refTypeList.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("OwnedType0EntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_OwnedType__refTypeList", "TestNamespace") }); @@ -553,15 +553,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas valueTypeArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer(new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v)), keyComparer: new ListOfValueTypesComparer(new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -575,15 +575,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerDateTimeTypeMapping.Default.Clone( comparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v), keyComparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v), providerValueComparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v))); valueTypeArray.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); valueTypeArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("OwnedType0EntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_OwnedType__valueTypeArray", "TestNamespace") }); @@ -626,7 +626,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (byte v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -691,7 +691,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (byte v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -756,7 +756,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (short v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -865,11 +865,11 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) runtimeEntityType.SetOriginalValuesFactory( (InternalEntityEntry source) => { - var entity = (CompiledModelTestBase.OwnedType)source.Entity; - return (ISnapshot)new Snapshot, IList, List, DateTime[], IEnumerable, IList, List>(((ValueComparer)principalDerivedId.GetValueComparer()).Snapshot(source.GetCurrentValue(principalDerivedId)), ((ValueComparer)principalDerivedAlternateId.GetValueComparer()).Snapshot(source.GetCurrentValue(principalDerivedAlternateId)), ((ValueComparer)id.GetValueComparer()).Snapshot(source.GetCurrentValue(id)), source.GetCurrentValue(details) == null ? null : ((ValueComparer)details.GetValueComparer()).Snapshot(source.GetCurrentValue(details)), ((ValueComparer)number.GetValueComparer()).Snapshot(source.GetCurrentValue(number)), (object)source.GetCurrentValue(refTypeArray) == null ? null : (IPAddress[])((ValueComparer)refTypeArray.GetValueComparer()).Snapshot((object)source.GetCurrentValue(refTypeArray)), (object)source.GetCurrentValue>(refTypeEnumerable) == null ? null : (IEnumerable)((ValueComparer)refTypeEnumerable.GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeEnumerable)), (object)source.GetCurrentValue>(refTypeIList) == null ? null : (IList)((ValueComparer)refTypeIList.GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeIList)), (object)source.GetCurrentValue>(refTypeList) == null ? null : (List)((ValueComparer)refTypeList.GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeList)), (IEnumerable)source.GetCurrentValue(valueTypeArray) == null ? null : (DateTime[])((ValueComparer>)valueTypeArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(valueTypeArray)), source.GetCurrentValue>(valueTypeEnumerable) == null ? null : ((ValueComparer>)valueTypeEnumerable.GetValueComparer()).Snapshot(source.GetCurrentValue>(valueTypeEnumerable)), (IEnumerable)source.GetCurrentValue>(valueTypeIList) == null ? null : (IList)((ValueComparer>)valueTypeIList.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeIList)), (IEnumerable)source.GetCurrentValue>(valueTypeList) == null ? null : (List)((ValueComparer>)valueTypeList.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeList))); + var entity8 = (CompiledModelTestBase.OwnedType)source.Entity; + return (ISnapshot)new Snapshot, IList, List, DateTime[], IEnumerable, IList, List>(((ValueComparer)((IProperty)principalDerivedId).GetValueComparer()).Snapshot(source.GetCurrentValue(principalDerivedId)), ((ValueComparer)((IProperty)principalDerivedAlternateId).GetValueComparer()).Snapshot(source.GetCurrentValue(principalDerivedAlternateId)), ((ValueComparer)((IProperty)id).GetValueComparer()).Snapshot(source.GetCurrentValue(id)), source.GetCurrentValue(details) == null ? null : ((ValueComparer)((IProperty)details).GetValueComparer()).Snapshot(source.GetCurrentValue(details)), ((ValueComparer)((IProperty)number).GetValueComparer()).Snapshot(source.GetCurrentValue(number)), (object)source.GetCurrentValue(refTypeArray) == null ? null : (IPAddress[])((ValueComparer)((IProperty)refTypeArray).GetValueComparer()).Snapshot((object)source.GetCurrentValue(refTypeArray)), (object)source.GetCurrentValue>(refTypeEnumerable) == null ? null : (IEnumerable)((ValueComparer)((IProperty)refTypeEnumerable).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeEnumerable)), (object)source.GetCurrentValue>(refTypeIList) == null ? null : (IList)((ValueComparer)((IProperty)refTypeIList).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeIList)), (object)source.GetCurrentValue>(refTypeList) == null ? null : (List)((ValueComparer)((IProperty)refTypeList).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeList)), (IEnumerable)source.GetCurrentValue(valueTypeArray) == null ? null : (DateTime[])((ValueComparer>)((IProperty)valueTypeArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(valueTypeArray)), source.GetCurrentValue>(valueTypeEnumerable) == null ? null : ((ValueComparer>)((IProperty)valueTypeEnumerable).GetValueComparer()).Snapshot(source.GetCurrentValue>(valueTypeEnumerable)), (IEnumerable)source.GetCurrentValue>(valueTypeIList) == null ? null : (IList)((ValueComparer>)((IProperty)valueTypeIList).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeIList)), (IEnumerable)source.GetCurrentValue>(valueTypeList) == null ? null : (List)((ValueComparer>)((IProperty)valueTypeList).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeList))); }); runtimeEntityType.SetStoreGeneratedValuesFactory( - () => (ISnapshot)new Snapshot(((ValueComparer)principalDerivedId.GetValueComparer()).Snapshot(default(long)), ((ValueComparer)principalDerivedAlternateId.GetValueComparer()).Snapshot(default(Guid)), ((ValueComparer)id.GetValueComparer()).Snapshot(default(int)))); + () => (ISnapshot)new Snapshot(((ValueComparer)((IProperty)principalDerivedId).GetValueComparer()).Snapshot(default(long)), ((ValueComparer)((IProperty)principalDerivedAlternateId).GetValueComparer()).Snapshot(default(Guid)), ((ValueComparer)((IProperty)id).GetValueComparer()).Snapshot(default(int)))); runtimeEntityType.SetTemporaryValuesFactory( (InternalEntityEntry source) => (ISnapshot)new Snapshot(default(long), default(Guid), default(int))); runtimeEntityType.SetShadowValuesFactory( @@ -879,8 +879,8 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) runtimeEntityType.SetRelationshipSnapshotFactory( (InternalEntityEntry source) => { - var entity = (CompiledModelTestBase.OwnedType)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)principalDerivedId.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalDerivedId)), ((ValueComparer)principalDerivedAlternateId.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalDerivedAlternateId)), ((ValueComparer)id.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(id))); + var entity8 = (CompiledModelTestBase.OwnedType)source.Entity; + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)principalDerivedId).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalDerivedId)), ((ValueComparer)((IProperty)principalDerivedAlternateId).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalDerivedAlternateId)), ((ValueComparer)((IProperty)id).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(id))); }); runtimeEntityType.Counts = new PropertyCounts( propertyCount: 13, diff --git a/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/BigModel/OwnedTypeEntityType.cs b/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/BigModel/OwnedTypeEntityType.cs index 26e13582cfd..74865cb3351 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/BigModel/OwnedTypeEntityType.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/BigModel/OwnedTypeEntityType.cs @@ -53,15 +53,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas principalBaseId.TypeMapping = SqlServerLongTypeMapping.Default.Clone( comparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), keyComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v)); principalBaseId.SetCurrentValueComparer(new EntryCurrentValueComparer(principalBaseId)); @@ -92,15 +92,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas principalBaseAlternateId.TypeMapping = GuidTypeMapping.Default.Clone( comparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), keyComparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), providerValueComparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "uniqueidentifier")); @@ -138,15 +138,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas details.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -241,15 +241,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas refTypeArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -259,27 +259,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)))), elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), keyComparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(45)", @@ -287,12 +287,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))); refTypeArray.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); refTypeArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("OwnedTypeEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_OwnedType__refTypeArray", "TestNamespace") }); @@ -328,15 +328,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas refTypeEnumerable.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer, string>(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), keyComparer: new ListOfReferenceTypesComparer, string>(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -350,15 +350,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -399,15 +399,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas refTypeIList.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer, string>(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), keyComparer: new ListOfReferenceTypesComparer, string>(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -421,15 +421,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -470,15 +470,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas refTypeList.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer, IPAddress>(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), keyComparer: new ListOfReferenceTypesComparer, IPAddress>(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -488,27 +488,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter, IPAddress>( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)))), elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), keyComparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(45)", @@ -516,12 +516,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))); refTypeList.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); refTypeList.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("OwnedTypeEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_OwnedType__refTypeList", "TestNamespace") }); @@ -557,15 +557,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas valueTypeArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer(new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v)), keyComparer: new ListOfValueTypesComparer(new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -579,15 +579,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerDateTimeTypeMapping.Default.Clone( comparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v), keyComparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v), providerValueComparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v))); valueTypeArray.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); valueTypeArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("OwnedTypeEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_OwnedType__valueTypeArray", "TestNamespace") }); @@ -631,7 +631,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (byte v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -697,7 +697,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (byte v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -763,7 +763,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (short v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -883,11 +883,11 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) runtimeEntityType.SetOriginalValuesFactory( (InternalEntityEntry source) => { - var entity = (CompiledModelTestBase.OwnedType)source.Entity; - return (ISnapshot)new Snapshot, IList, List, DateTime[], IEnumerable, IList, List>(((ValueComparer)principalBaseId.GetValueComparer()).Snapshot(source.GetCurrentValue(principalBaseId)), ((ValueComparer)principalBaseAlternateId.GetValueComparer()).Snapshot(source.GetCurrentValue(principalBaseAlternateId)), source.GetCurrentValue(details) == null ? null : ((ValueComparer)details.GetValueComparer()).Snapshot(source.GetCurrentValue(details)), ((ValueComparer)number.GetValueComparer()).Snapshot(source.GetCurrentValue(number)), (object)source.GetCurrentValue(refTypeArray) == null ? null : (IPAddress[])((ValueComparer)refTypeArray.GetValueComparer()).Snapshot((object)source.GetCurrentValue(refTypeArray)), (object)source.GetCurrentValue>(refTypeEnumerable) == null ? null : (IEnumerable)((ValueComparer)refTypeEnumerable.GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeEnumerable)), (object)source.GetCurrentValue>(refTypeIList) == null ? null : (IList)((ValueComparer)refTypeIList.GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeIList)), (object)source.GetCurrentValue>(refTypeList) == null ? null : (List)((ValueComparer)refTypeList.GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeList)), (IEnumerable)source.GetCurrentValue(valueTypeArray) == null ? null : (DateTime[])((ValueComparer>)valueTypeArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(valueTypeArray)), source.GetCurrentValue>(valueTypeEnumerable) == null ? null : ((ValueComparer>)valueTypeEnumerable.GetValueComparer()).Snapshot(source.GetCurrentValue>(valueTypeEnumerable)), (IEnumerable)source.GetCurrentValue>(valueTypeIList) == null ? null : (IList)((ValueComparer>)valueTypeIList.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeIList)), (IEnumerable)source.GetCurrentValue>(valueTypeList) == null ? null : (List)((ValueComparer>)valueTypeList.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeList))); + var entity8 = (CompiledModelTestBase.OwnedType)source.Entity; + return (ISnapshot)new Snapshot, IList, List, DateTime[], IEnumerable, IList, List>(((ValueComparer)((IProperty)principalBaseId).GetValueComparer()).Snapshot(source.GetCurrentValue(principalBaseId)), ((ValueComparer)((IProperty)principalBaseAlternateId).GetValueComparer()).Snapshot(source.GetCurrentValue(principalBaseAlternateId)), source.GetCurrentValue(details) == null ? null : ((ValueComparer)((IProperty)details).GetValueComparer()).Snapshot(source.GetCurrentValue(details)), ((ValueComparer)((IProperty)number).GetValueComparer()).Snapshot(source.GetCurrentValue(number)), (object)source.GetCurrentValue(refTypeArray) == null ? null : (IPAddress[])((ValueComparer)((IProperty)refTypeArray).GetValueComparer()).Snapshot((object)source.GetCurrentValue(refTypeArray)), (object)source.GetCurrentValue>(refTypeEnumerable) == null ? null : (IEnumerable)((ValueComparer)((IProperty)refTypeEnumerable).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeEnumerable)), (object)source.GetCurrentValue>(refTypeIList) == null ? null : (IList)((ValueComparer)((IProperty)refTypeIList).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeIList)), (object)source.GetCurrentValue>(refTypeList) == null ? null : (List)((ValueComparer)((IProperty)refTypeList).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeList)), (IEnumerable)source.GetCurrentValue(valueTypeArray) == null ? null : (DateTime[])((ValueComparer>)((IProperty)valueTypeArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(valueTypeArray)), source.GetCurrentValue>(valueTypeEnumerable) == null ? null : ((ValueComparer>)((IProperty)valueTypeEnumerable).GetValueComparer()).Snapshot(source.GetCurrentValue>(valueTypeEnumerable)), (IEnumerable)source.GetCurrentValue>(valueTypeIList) == null ? null : (IList)((ValueComparer>)((IProperty)valueTypeIList).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeIList)), (IEnumerable)source.GetCurrentValue>(valueTypeList) == null ? null : (List)((ValueComparer>)((IProperty)valueTypeList).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeList))); }); runtimeEntityType.SetStoreGeneratedValuesFactory( - () => (ISnapshot)new Snapshot(((ValueComparer)principalBaseId.GetValueComparer()).Snapshot(default(long)), ((ValueComparer)principalBaseAlternateId.GetValueComparer()).Snapshot(default(Guid)))); + () => (ISnapshot)new Snapshot(((ValueComparer)((IProperty)principalBaseId).GetValueComparer()).Snapshot(default(long)), ((ValueComparer)((IProperty)principalBaseAlternateId).GetValueComparer()).Snapshot(default(Guid)))); runtimeEntityType.SetTemporaryValuesFactory( (InternalEntityEntry source) => (ISnapshot)new Snapshot(default(long), default(Guid))); runtimeEntityType.SetShadowValuesFactory( @@ -897,8 +897,8 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) runtimeEntityType.SetRelationshipSnapshotFactory( (InternalEntityEntry source) => { - var entity = (CompiledModelTestBase.OwnedType)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)principalBaseId.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalBaseId)), ((ValueComparer)principalBaseAlternateId.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalBaseAlternateId))); + var entity8 = (CompiledModelTestBase.OwnedType)source.Entity; + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)principalBaseId).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalBaseId)), ((ValueComparer)((IProperty)principalBaseAlternateId).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalBaseAlternateId))); }); runtimeEntityType.Counts = new PropertyCounts( propertyCount: 12, diff --git a/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/BigModel/PrincipalBaseEntityType.cs b/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/BigModel/PrincipalBaseEntityType.cs index 9d93c7fd4f1..abd9beb39cc 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/BigModel/PrincipalBaseEntityType.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/BigModel/PrincipalBaseEntityType.cs @@ -69,15 +69,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas id.TypeMapping = SqlServerLongTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable)), providerValueComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable))); id.SetCurrentValueComparer(new EntryCurrentValueComparer(id)); @@ -125,15 +125,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas alternateId.TypeMapping = GuidTypeMapping.Default.Clone( comparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), keyComparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), providerValueComparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "uniqueidentifier")); @@ -169,11 +169,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum1.TypeMapping = IntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.AnEnum v1, CompiledModelTestBase.AnEnum v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.AnEnum v) => v.GetHashCode(), + (CompiledModelTestBase.AnEnum v) => ((object)v).GetHashCode(), (CompiledModelTestBase.AnEnum v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.AnEnum v1, CompiledModelTestBase.AnEnum v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.AnEnum v) => v.GetHashCode(), + (CompiledModelTestBase.AnEnum v) => ((object)v).GetHashCode(), (CompiledModelTestBase.AnEnum v) => v), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -221,11 +221,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum2.TypeMapping = IntTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.AnEnum)v1, (object)(CompiledModelTestBase.AnEnum)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.AnEnum)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.AnEnum)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.AnEnum)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.AnEnum)v1, (object)(CompiledModelTestBase.AnEnum)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.AnEnum)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.AnEnum)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.AnEnum)v : default(Nullable)), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -271,11 +271,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas flagsEnum1.TypeMapping = IntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.AFlagsEnum v1, CompiledModelTestBase.AFlagsEnum v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.AFlagsEnum v) => v.GetHashCode(), + (CompiledModelTestBase.AFlagsEnum v) => ((object)v).GetHashCode(), (CompiledModelTestBase.AFlagsEnum v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.AFlagsEnum v1, CompiledModelTestBase.AFlagsEnum v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.AFlagsEnum v) => v.GetHashCode(), + (CompiledModelTestBase.AFlagsEnum v) => ((object)v).GetHashCode(), (CompiledModelTestBase.AFlagsEnum v) => v), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -323,11 +323,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas flagsEnum2.TypeMapping = IntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.AFlagsEnum v1, CompiledModelTestBase.AFlagsEnum v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.AFlagsEnum v) => v.GetHashCode(), + (CompiledModelTestBase.AFlagsEnum v) => ((object)v).GetHashCode(), (CompiledModelTestBase.AFlagsEnum v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.AFlagsEnum v1, CompiledModelTestBase.AFlagsEnum v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.AFlagsEnum v) => v.GetHashCode(), + (CompiledModelTestBase.AFlagsEnum v) => ((object)v).GetHashCode(), (CompiledModelTestBase.AFlagsEnum v) => v), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -375,15 +375,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas refTypeArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -393,27 +393,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)))), elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), keyComparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(45)", @@ -421,12 +421,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))); refTypeArray.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); refTypeArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("PrincipalBaseEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalBase_RefTypeArray", "TestNamespace") }); @@ -461,15 +461,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas refTypeEnumerable.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer, string>(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), keyComparer: new ListOfReferenceTypesComparer, string>(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -483,15 +483,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -531,15 +531,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas refTypeIList.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer, string>(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), keyComparer: new ListOfReferenceTypesComparer, string>(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -553,15 +553,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -601,15 +601,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas refTypeList.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer, IPAddress>(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), keyComparer: new ListOfReferenceTypesComparer, IPAddress>(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -619,27 +619,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter, IPAddress>( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)))), elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), keyComparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(45)", @@ -647,12 +647,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))); refTypeList.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); refTypeList.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("PrincipalBaseEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalBase_RefTypeList", "TestNamespace") }); @@ -687,15 +687,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas valueTypeArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer(new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v)), keyComparer: new ListOfValueTypesComparer(new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -709,15 +709,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerDateTimeTypeMapping.Default.Clone( comparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v), keyComparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v), providerValueComparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v))); valueTypeArray.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); valueTypeArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("PrincipalBaseEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalBase_ValueTypeArray", "TestNamespace") }); @@ -760,7 +760,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (byte v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -825,7 +825,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (byte v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -890,7 +890,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (short v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -1004,11 +1004,11 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) runtimeEntityType.SetOriginalValuesFactory( (InternalEntityEntry source) => { - var entity = (CompiledModelTestBase.PrincipalBase)source.Entity; - return (ISnapshot)new Snapshot, Guid, CompiledModelTestBase.AnEnum, Nullable, CompiledModelTestBase.AFlagsEnum, CompiledModelTestBase.AFlagsEnum, IPAddress[], IEnumerable, IList, List, DateTime[], IEnumerable, IList, List>(source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)id.GetValueComparer()).Snapshot(source.GetCurrentValue>(id)), ((ValueComparer)alternateId.GetValueComparer()).Snapshot(source.GetCurrentValue(alternateId)), ((ValueComparer)enum1.GetValueComparer()).Snapshot(source.GetCurrentValue(enum1)), source.GetCurrentValue>(enum2) == null ? null : ((ValueComparer>)enum2.GetValueComparer()).Snapshot(source.GetCurrentValue>(enum2)), ((ValueComparer)flagsEnum1.GetValueComparer()).Snapshot(source.GetCurrentValue(flagsEnum1)), ((ValueComparer)flagsEnum2.GetValueComparer()).Snapshot(source.GetCurrentValue(flagsEnum2)), (object)source.GetCurrentValue(refTypeArray) == null ? null : (IPAddress[])((ValueComparer)refTypeArray.GetValueComparer()).Snapshot((object)source.GetCurrentValue(refTypeArray)), (object)source.GetCurrentValue>(refTypeEnumerable) == null ? null : (IEnumerable)((ValueComparer)refTypeEnumerable.GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeEnumerable)), (object)source.GetCurrentValue>(refTypeIList) == null ? null : (IList)((ValueComparer)refTypeIList.GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeIList)), (object)source.GetCurrentValue>(refTypeList) == null ? null : (List)((ValueComparer)refTypeList.GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeList)), (IEnumerable)source.GetCurrentValue(valueTypeArray) == null ? null : (DateTime[])((ValueComparer>)valueTypeArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(valueTypeArray)), source.GetCurrentValue>(valueTypeEnumerable) == null ? null : ((ValueComparer>)valueTypeEnumerable.GetValueComparer()).Snapshot(source.GetCurrentValue>(valueTypeEnumerable)), (IEnumerable)source.GetCurrentValue>(valueTypeIList) == null ? null : (IList)((ValueComparer>)valueTypeIList.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeIList)), (IEnumerable)source.GetCurrentValue>(valueTypeList) == null ? null : (List)((ValueComparer>)valueTypeList.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeList))); + var entity8 = (CompiledModelTestBase.PrincipalBase)source.Entity; + return (ISnapshot)new Snapshot, Guid, CompiledModelTestBase.AnEnum, Nullable, CompiledModelTestBase.AFlagsEnum, CompiledModelTestBase.AFlagsEnum, IPAddress[], IEnumerable, IList, List, DateTime[], IEnumerable, IList, List>(source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)((IProperty)id).GetValueComparer()).Snapshot(source.GetCurrentValue>(id)), ((ValueComparer)((IProperty)alternateId).GetValueComparer()).Snapshot(source.GetCurrentValue(alternateId)), ((ValueComparer)((IProperty)enum1).GetValueComparer()).Snapshot(source.GetCurrentValue(enum1)), source.GetCurrentValue>(enum2) == null ? null : ((ValueComparer>)((IProperty)enum2).GetValueComparer()).Snapshot(source.GetCurrentValue>(enum2)), ((ValueComparer)((IProperty)flagsEnum1).GetValueComparer()).Snapshot(source.GetCurrentValue(flagsEnum1)), ((ValueComparer)((IProperty)flagsEnum2).GetValueComparer()).Snapshot(source.GetCurrentValue(flagsEnum2)), (object)source.GetCurrentValue(refTypeArray) == null ? null : (IPAddress[])((ValueComparer)((IProperty)refTypeArray).GetValueComparer()).Snapshot((object)source.GetCurrentValue(refTypeArray)), (object)source.GetCurrentValue>(refTypeEnumerable) == null ? null : (IEnumerable)((ValueComparer)((IProperty)refTypeEnumerable).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeEnumerable)), (object)source.GetCurrentValue>(refTypeIList) == null ? null : (IList)((ValueComparer)((IProperty)refTypeIList).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeIList)), (object)source.GetCurrentValue>(refTypeList) == null ? null : (List)((ValueComparer)((IProperty)refTypeList).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeList)), (IEnumerable)source.GetCurrentValue(valueTypeArray) == null ? null : (DateTime[])((ValueComparer>)((IProperty)valueTypeArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(valueTypeArray)), source.GetCurrentValue>(valueTypeEnumerable) == null ? null : ((ValueComparer>)((IProperty)valueTypeEnumerable).GetValueComparer()).Snapshot(source.GetCurrentValue>(valueTypeEnumerable)), (IEnumerable)source.GetCurrentValue>(valueTypeIList) == null ? null : (IList)((ValueComparer>)((IProperty)valueTypeIList).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeIList)), (IEnumerable)source.GetCurrentValue>(valueTypeList) == null ? null : (List)((ValueComparer>)((IProperty)valueTypeList).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeList))); }); runtimeEntityType.SetStoreGeneratedValuesFactory( - () => (ISnapshot)new Snapshot, Guid>(default(Nullable) == null ? null : ((ValueComparer>)id.GetValueComparer()).Snapshot(default(Nullable)), ((ValueComparer)alternateId.GetValueComparer()).Snapshot(default(Guid)))); + () => (ISnapshot)new Snapshot, Guid>(default(Nullable) == null ? null : ((ValueComparer>)((IProperty)id).GetValueComparer()).Snapshot(default(Nullable)), ((ValueComparer)((IProperty)alternateId).GetValueComparer()).Snapshot(default(Guid)))); runtimeEntityType.SetTemporaryValuesFactory( (InternalEntityEntry source) => (ISnapshot)new Snapshot, Guid>(default(Nullable), default(Guid))); runtimeEntityType.SetShadowValuesFactory( @@ -1018,8 +1018,8 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) runtimeEntityType.SetRelationshipSnapshotFactory( (InternalEntityEntry source) => { - var entity = (CompiledModelTestBase.PrincipalBase)source.Entity; - return (ISnapshot)new Snapshot, Guid, object, object>(source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)id.GetKeyValueComparer()).Snapshot(source.GetCurrentValue>(id)), ((ValueComparer)alternateId.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(alternateId)), UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalBase__ownedField(entity), null); + var entity8 = (CompiledModelTestBase.PrincipalBase)source.Entity; + return (ISnapshot)new Snapshot, Guid, object, object>(source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)((IProperty)id).GetKeyValueComparer()).Snapshot(source.GetCurrentValue>(id)), ((ValueComparer)((IProperty)alternateId).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(alternateId)), UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalBase__ownedField(entity8), null); }); runtimeEntityType.Counts = new PropertyCounts( propertyCount: 14, diff --git a/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/BigModel/PrincipalBasePrincipalDerivedDependentBasebyteEntityType.cs b/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/BigModel/PrincipalBasePrincipalDerivedDependentBasebyteEntityType.cs index a5340f1d2b7..402eec2c194 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/BigModel/PrincipalBasePrincipalDerivedDependentBasebyteEntityType.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/BigModel/PrincipalBasePrincipalDerivedDependentBasebyteEntityType.cs @@ -41,10 +41,10 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas propertyInfo: runtimeEntityType.FindIndexerPropertyInfo(), afterSaveBehavior: PropertySaveBehavior.Throw); derivedsId.SetGetter( - (Dictionary entity) => (entity.ContainsKey("DerivedsId") ? entity["DerivedsId"] : null) == null ? 0L : (long)(entity.ContainsKey("DerivedsId") ? entity["DerivedsId"] : null), - (Dictionary entity) => (entity.ContainsKey("DerivedsId") ? entity["DerivedsId"] : null) == null, - (Dictionary instance) => (instance.ContainsKey("DerivedsId") ? instance["DerivedsId"] : null) == null ? 0L : (long)(instance.ContainsKey("DerivedsId") ? instance["DerivedsId"] : null), - (Dictionary instance) => (instance.ContainsKey("DerivedsId") ? instance["DerivedsId"] : null) == null); + (Dictionary entity) => (((IDictionary)entity).ContainsKey("DerivedsId") ? entity["DerivedsId"] : null) == null ? 0L : (long)(((IDictionary)entity).ContainsKey("DerivedsId") ? entity["DerivedsId"] : null), + (Dictionary entity) => (((IDictionary)entity).ContainsKey("DerivedsId") ? entity["DerivedsId"] : null) == null, + (Dictionary instance) => (((IDictionary)instance).ContainsKey("DerivedsId") ? instance["DerivedsId"] : null) == null ? 0L : (long)(((IDictionary)instance).ContainsKey("DerivedsId") ? instance["DerivedsId"] : null), + (Dictionary instance) => (((IDictionary)instance).ContainsKey("DerivedsId") ? instance["DerivedsId"] : null) == null); derivedsId.SetSetter( (Dictionary entity, long value) => entity["DerivedsId"] = (object)value); derivedsId.SetMaterializationSetter( @@ -59,13 +59,13 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas else { { - if (entry.FlaggedAsTemporary(0) && (((Dictionary)entry.Entity).ContainsKey("DerivedsId") ? ((Dictionary)entry.Entity)["DerivedsId"] : null) == null) + if (entry.FlaggedAsTemporary(0) && (((IDictionary)(Dictionary)entry.Entity).ContainsKey("DerivedsId") ? ((Dictionary)entry.Entity)["DerivedsId"] : null) == null) { return entry.ReadTemporaryValue(0); } else { - var nullableValue = ((Dictionary)entry.Entity).ContainsKey("DerivedsId") ? ((Dictionary)entry.Entity)["DerivedsId"] : null; + var nullableValue = ((IDictionary)(Dictionary)entry.Entity).ContainsKey("DerivedsId") ? ((Dictionary)entry.Entity)["DerivedsId"] : null; return nullableValue == null ? default(long) : (long)nullableValue; } } @@ -73,7 +73,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas }, (InternalEntityEntry entry) => { - var nullableValue = ((Dictionary)entry.Entity).ContainsKey("DerivedsId") ? ((Dictionary)entry.Entity)["DerivedsId"] : null; + var nullableValue = ((IDictionary)(Dictionary)entry.Entity).ContainsKey("DerivedsId") ? ((Dictionary)entry.Entity)["DerivedsId"] : null; return nullableValue == null ? default(long) : (long)nullableValue; }, (InternalEntityEntry entry) => entry.ReadOriginalValue(derivedsId, 0), @@ -88,15 +88,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas derivedsId.TypeMapping = SqlServerLongTypeMapping.Default.Clone( comparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), keyComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v)); derivedsId.SetCurrentValueComparer(new EntryCurrentValueComparer(derivedsId)); derivedsId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); @@ -107,10 +107,10 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas propertyInfo: runtimeEntityType.FindIndexerPropertyInfo(), afterSaveBehavior: PropertySaveBehavior.Throw); derivedsAlternateId.SetGetter( - (Dictionary entity) => (entity.ContainsKey("DerivedsAlternateId") ? entity["DerivedsAlternateId"] : null) == null ? new Guid("00000000-0000-0000-0000-000000000000") : (Guid)(entity.ContainsKey("DerivedsAlternateId") ? entity["DerivedsAlternateId"] : null), - (Dictionary entity) => (entity.ContainsKey("DerivedsAlternateId") ? entity["DerivedsAlternateId"] : null) == null, - (Dictionary instance) => (instance.ContainsKey("DerivedsAlternateId") ? instance["DerivedsAlternateId"] : null) == null ? new Guid("00000000-0000-0000-0000-000000000000") : (Guid)(instance.ContainsKey("DerivedsAlternateId") ? instance["DerivedsAlternateId"] : null), - (Dictionary instance) => (instance.ContainsKey("DerivedsAlternateId") ? instance["DerivedsAlternateId"] : null) == null); + (Dictionary entity) => (((IDictionary)entity).ContainsKey("DerivedsAlternateId") ? entity["DerivedsAlternateId"] : null) == null ? new Guid("00000000-0000-0000-0000-000000000000") : (Guid)(((IDictionary)entity).ContainsKey("DerivedsAlternateId") ? entity["DerivedsAlternateId"] : null), + (Dictionary entity) => (((IDictionary)entity).ContainsKey("DerivedsAlternateId") ? entity["DerivedsAlternateId"] : null) == null, + (Dictionary instance) => (((IDictionary)instance).ContainsKey("DerivedsAlternateId") ? instance["DerivedsAlternateId"] : null) == null ? new Guid("00000000-0000-0000-0000-000000000000") : (Guid)(((IDictionary)instance).ContainsKey("DerivedsAlternateId") ? instance["DerivedsAlternateId"] : null), + (Dictionary instance) => (((IDictionary)instance).ContainsKey("DerivedsAlternateId") ? instance["DerivedsAlternateId"] : null) == null); derivedsAlternateId.SetSetter( (Dictionary entity, Guid value) => entity["DerivedsAlternateId"] = (object)value); derivedsAlternateId.SetMaterializationSetter( @@ -125,13 +125,13 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas else { { - if (entry.FlaggedAsTemporary(1) && (((Dictionary)entry.Entity).ContainsKey("DerivedsAlternateId") ? ((Dictionary)entry.Entity)["DerivedsAlternateId"] : null) == null) + if (entry.FlaggedAsTemporary(1) && (((IDictionary)(Dictionary)entry.Entity).ContainsKey("DerivedsAlternateId") ? ((Dictionary)entry.Entity)["DerivedsAlternateId"] : null) == null) { return entry.ReadTemporaryValue(1); } else { - var nullableValue = ((Dictionary)entry.Entity).ContainsKey("DerivedsAlternateId") ? ((Dictionary)entry.Entity)["DerivedsAlternateId"] : null; + var nullableValue = ((IDictionary)(Dictionary)entry.Entity).ContainsKey("DerivedsAlternateId") ? ((Dictionary)entry.Entity)["DerivedsAlternateId"] : null; return nullableValue == null ? default(Guid) : (Guid)nullableValue; } } @@ -139,7 +139,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas }, (InternalEntityEntry entry) => { - var nullableValue = ((Dictionary)entry.Entity).ContainsKey("DerivedsAlternateId") ? ((Dictionary)entry.Entity)["DerivedsAlternateId"] : null; + var nullableValue = ((IDictionary)(Dictionary)entry.Entity).ContainsKey("DerivedsAlternateId") ? ((Dictionary)entry.Entity)["DerivedsAlternateId"] : null; return nullableValue == null ? default(Guid) : (Guid)nullableValue; }, (InternalEntityEntry entry) => entry.ReadOriginalValue(derivedsAlternateId, 1), @@ -154,15 +154,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas derivedsAlternateId.TypeMapping = GuidTypeMapping.Default.Clone( comparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), keyComparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), providerValueComparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "uniqueidentifier")); @@ -175,10 +175,10 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas propertyInfo: runtimeEntityType.FindIndexerPropertyInfo(), afterSaveBehavior: PropertySaveBehavior.Throw); principalsId.SetGetter( - (Dictionary entity) => (entity.ContainsKey("PrincipalsId") ? entity["PrincipalsId"] : null) == null ? 0L : (long)(entity.ContainsKey("PrincipalsId") ? entity["PrincipalsId"] : null), - (Dictionary entity) => (entity.ContainsKey("PrincipalsId") ? entity["PrincipalsId"] : null) == null, - (Dictionary instance) => (instance.ContainsKey("PrincipalsId") ? instance["PrincipalsId"] : null) == null ? 0L : (long)(instance.ContainsKey("PrincipalsId") ? instance["PrincipalsId"] : null), - (Dictionary instance) => (instance.ContainsKey("PrincipalsId") ? instance["PrincipalsId"] : null) == null); + (Dictionary entity) => (((IDictionary)entity).ContainsKey("PrincipalsId") ? entity["PrincipalsId"] : null) == null ? 0L : (long)(((IDictionary)entity).ContainsKey("PrincipalsId") ? entity["PrincipalsId"] : null), + (Dictionary entity) => (((IDictionary)entity).ContainsKey("PrincipalsId") ? entity["PrincipalsId"] : null) == null, + (Dictionary instance) => (((IDictionary)instance).ContainsKey("PrincipalsId") ? instance["PrincipalsId"] : null) == null ? 0L : (long)(((IDictionary)instance).ContainsKey("PrincipalsId") ? instance["PrincipalsId"] : null), + (Dictionary instance) => (((IDictionary)instance).ContainsKey("PrincipalsId") ? instance["PrincipalsId"] : null) == null); principalsId.SetSetter( (Dictionary entity, long value) => entity["PrincipalsId"] = (object)value); principalsId.SetMaterializationSetter( @@ -193,13 +193,13 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas else { { - if (entry.FlaggedAsTemporary(2) && (((Dictionary)entry.Entity).ContainsKey("PrincipalsId") ? ((Dictionary)entry.Entity)["PrincipalsId"] : null) == null) + if (entry.FlaggedAsTemporary(2) && (((IDictionary)(Dictionary)entry.Entity).ContainsKey("PrincipalsId") ? ((Dictionary)entry.Entity)["PrincipalsId"] : null) == null) { return entry.ReadTemporaryValue(2); } else { - var nullableValue = ((Dictionary)entry.Entity).ContainsKey("PrincipalsId") ? ((Dictionary)entry.Entity)["PrincipalsId"] : null; + var nullableValue = ((IDictionary)(Dictionary)entry.Entity).ContainsKey("PrincipalsId") ? ((Dictionary)entry.Entity)["PrincipalsId"] : null; return nullableValue == null ? default(long) : (long)nullableValue; } } @@ -207,7 +207,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas }, (InternalEntityEntry entry) => { - var nullableValue = ((Dictionary)entry.Entity).ContainsKey("PrincipalsId") ? ((Dictionary)entry.Entity)["PrincipalsId"] : null; + var nullableValue = ((IDictionary)(Dictionary)entry.Entity).ContainsKey("PrincipalsId") ? ((Dictionary)entry.Entity)["PrincipalsId"] : null; return nullableValue == null ? default(long) : (long)nullableValue; }, (InternalEntityEntry entry) => entry.ReadOriginalValue(principalsId, 2), @@ -222,15 +222,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas principalsId.TypeMapping = SqlServerLongTypeMapping.Default.Clone( comparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), keyComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v)); principalsId.SetCurrentValueComparer(new EntryCurrentValueComparer(principalsId)); principalsId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); @@ -241,10 +241,10 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas propertyInfo: runtimeEntityType.FindIndexerPropertyInfo(), afterSaveBehavior: PropertySaveBehavior.Throw); principalsAlternateId.SetGetter( - (Dictionary entity) => (entity.ContainsKey("PrincipalsAlternateId") ? entity["PrincipalsAlternateId"] : null) == null ? new Guid("00000000-0000-0000-0000-000000000000") : (Guid)(entity.ContainsKey("PrincipalsAlternateId") ? entity["PrincipalsAlternateId"] : null), - (Dictionary entity) => (entity.ContainsKey("PrincipalsAlternateId") ? entity["PrincipalsAlternateId"] : null) == null, - (Dictionary instance) => (instance.ContainsKey("PrincipalsAlternateId") ? instance["PrincipalsAlternateId"] : null) == null ? new Guid("00000000-0000-0000-0000-000000000000") : (Guid)(instance.ContainsKey("PrincipalsAlternateId") ? instance["PrincipalsAlternateId"] : null), - (Dictionary instance) => (instance.ContainsKey("PrincipalsAlternateId") ? instance["PrincipalsAlternateId"] : null) == null); + (Dictionary entity) => (((IDictionary)entity).ContainsKey("PrincipalsAlternateId") ? entity["PrincipalsAlternateId"] : null) == null ? new Guid("00000000-0000-0000-0000-000000000000") : (Guid)(((IDictionary)entity).ContainsKey("PrincipalsAlternateId") ? entity["PrincipalsAlternateId"] : null), + (Dictionary entity) => (((IDictionary)entity).ContainsKey("PrincipalsAlternateId") ? entity["PrincipalsAlternateId"] : null) == null, + (Dictionary instance) => (((IDictionary)instance).ContainsKey("PrincipalsAlternateId") ? instance["PrincipalsAlternateId"] : null) == null ? new Guid("00000000-0000-0000-0000-000000000000") : (Guid)(((IDictionary)instance).ContainsKey("PrincipalsAlternateId") ? instance["PrincipalsAlternateId"] : null), + (Dictionary instance) => (((IDictionary)instance).ContainsKey("PrincipalsAlternateId") ? instance["PrincipalsAlternateId"] : null) == null); principalsAlternateId.SetSetter( (Dictionary entity, Guid value) => entity["PrincipalsAlternateId"] = (object)value); principalsAlternateId.SetMaterializationSetter( @@ -259,13 +259,13 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas else { { - if (entry.FlaggedAsTemporary(3) && (((Dictionary)entry.Entity).ContainsKey("PrincipalsAlternateId") ? ((Dictionary)entry.Entity)["PrincipalsAlternateId"] : null) == null) + if (entry.FlaggedAsTemporary(3) && (((IDictionary)(Dictionary)entry.Entity).ContainsKey("PrincipalsAlternateId") ? ((Dictionary)entry.Entity)["PrincipalsAlternateId"] : null) == null) { return entry.ReadTemporaryValue(3); } else { - var nullableValue = ((Dictionary)entry.Entity).ContainsKey("PrincipalsAlternateId") ? ((Dictionary)entry.Entity)["PrincipalsAlternateId"] : null; + var nullableValue = ((IDictionary)(Dictionary)entry.Entity).ContainsKey("PrincipalsAlternateId") ? ((Dictionary)entry.Entity)["PrincipalsAlternateId"] : null; return nullableValue == null ? default(Guid) : (Guid)nullableValue; } } @@ -273,7 +273,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas }, (InternalEntityEntry entry) => { - var nullableValue = ((Dictionary)entry.Entity).ContainsKey("PrincipalsAlternateId") ? ((Dictionary)entry.Entity)["PrincipalsAlternateId"] : null; + var nullableValue = ((IDictionary)(Dictionary)entry.Entity).ContainsKey("PrincipalsAlternateId") ? ((Dictionary)entry.Entity)["PrincipalsAlternateId"] : null; return nullableValue == null ? default(Guid) : (Guid)nullableValue; }, (InternalEntityEntry entry) => entry.ReadOriginalValue(principalsAlternateId, 3), @@ -288,15 +288,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas principalsAlternateId.TypeMapping = GuidTypeMapping.Default.Clone( comparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), keyComparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), providerValueComparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "uniqueidentifier")); @@ -313,17 +313,17 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas beforeSaveBehavior: PropertySaveBehavior.Ignore, afterSaveBehavior: PropertySaveBehavior.Ignore); rowid.SetGetter( - (Dictionary entity) => (entity.ContainsKey("rowid") ? entity["rowid"] : null) == null ? null : (byte[])(entity.ContainsKey("rowid") ? entity["rowid"] : null), - (Dictionary entity) => (entity.ContainsKey("rowid") ? entity["rowid"] : null) == null, - (Dictionary instance) => (instance.ContainsKey("rowid") ? instance["rowid"] : null) == null ? null : (byte[])(instance.ContainsKey("rowid") ? instance["rowid"] : null), - (Dictionary instance) => (instance.ContainsKey("rowid") ? instance["rowid"] : null) == null); + (Dictionary entity) => (((IDictionary)entity).ContainsKey("rowid") ? entity["rowid"] : null) == null ? null : (byte[])(((IDictionary)entity).ContainsKey("rowid") ? entity["rowid"] : null), + (Dictionary entity) => (((IDictionary)entity).ContainsKey("rowid") ? entity["rowid"] : null) == null, + (Dictionary instance) => (((IDictionary)instance).ContainsKey("rowid") ? instance["rowid"] : null) == null ? null : (byte[])(((IDictionary)instance).ContainsKey("rowid") ? instance["rowid"] : null), + (Dictionary instance) => (((IDictionary)instance).ContainsKey("rowid") ? instance["rowid"] : null) == null); rowid.SetSetter( (Dictionary entity, byte[] value) => entity["rowid"] = (object)value); rowid.SetMaterializationSetter( (Dictionary entity, byte[] value) => entity["rowid"] = (object)value); rowid.SetAccessors( - (InternalEntityEntry entry) => entry.FlaggedAsStoreGenerated(4) ? entry.ReadStoreGeneratedValue(4) : entry.FlaggedAsTemporary(4) && (((Dictionary)entry.Entity).ContainsKey("rowid") ? ((Dictionary)entry.Entity)["rowid"] : null) == null ? entry.ReadTemporaryValue(4) : (byte[])(((Dictionary)entry.Entity).ContainsKey("rowid") ? ((Dictionary)entry.Entity)["rowid"] : null), - (InternalEntityEntry entry) => (byte[])(((Dictionary)entry.Entity).ContainsKey("rowid") ? ((Dictionary)entry.Entity)["rowid"] : null), + (InternalEntityEntry entry) => entry.FlaggedAsStoreGenerated(4) ? entry.ReadStoreGeneratedValue(4) : entry.FlaggedAsTemporary(4) && (((IDictionary)(Dictionary)entry.Entity).ContainsKey("rowid") ? ((Dictionary)entry.Entity)["rowid"] : null) == null ? entry.ReadTemporaryValue(4) : (byte[])(((IDictionary)(Dictionary)entry.Entity).ContainsKey("rowid") ? ((Dictionary)entry.Entity)["rowid"] : null), + (InternalEntityEntry entry) => (byte[])(((IDictionary)(Dictionary)entry.Entity).ContainsKey("rowid") ? ((Dictionary)entry.Entity)["rowid"] : null), (InternalEntityEntry entry) => entry.ReadOriginalValue(rowid, 4), (InternalEntityEntry entry) => entry.GetCurrentValue(rowid), (ValueBuffer valueBuffer) => valueBuffer[4]); @@ -394,11 +394,11 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) runtimeEntityType.SetOriginalValuesFactory( (InternalEntityEntry source) => { - var entity = (Dictionary)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)derivedsId.GetValueComparer()).Snapshot(source.GetCurrentValue(derivedsId)), ((ValueComparer)derivedsAlternateId.GetValueComparer()).Snapshot(source.GetCurrentValue(derivedsAlternateId)), ((ValueComparer)principalsId.GetValueComparer()).Snapshot(source.GetCurrentValue(principalsId)), ((ValueComparer)principalsAlternateId.GetValueComparer()).Snapshot(source.GetCurrentValue(principalsAlternateId)), source.GetCurrentValue(rowid) == null ? null : ((ValueComparer)rowid.GetValueComparer()).Snapshot(source.GetCurrentValue(rowid))); + var entity8 = (Dictionary)source.Entity; + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)derivedsId).GetValueComparer()).Snapshot(source.GetCurrentValue(derivedsId)), ((ValueComparer)((IProperty)derivedsAlternateId).GetValueComparer()).Snapshot(source.GetCurrentValue(derivedsAlternateId)), ((ValueComparer)((IProperty)principalsId).GetValueComparer()).Snapshot(source.GetCurrentValue(principalsId)), ((ValueComparer)((IProperty)principalsAlternateId).GetValueComparer()).Snapshot(source.GetCurrentValue(principalsAlternateId)), source.GetCurrentValue(rowid) == null ? null : ((ValueComparer)((IProperty)rowid).GetValueComparer()).Snapshot(source.GetCurrentValue(rowid))); }); runtimeEntityType.SetStoreGeneratedValuesFactory( - () => (ISnapshot)new Snapshot(((ValueComparer)derivedsId.GetValueComparer()).Snapshot(default(long)), ((ValueComparer)derivedsAlternateId.GetValueComparer()).Snapshot(default(Guid)), ((ValueComparer)principalsId.GetValueComparer()).Snapshot(default(long)), ((ValueComparer)principalsAlternateId.GetValueComparer()).Snapshot(default(Guid)), default(byte[]) == null ? null : ((ValueComparer)rowid.GetValueComparer()).Snapshot(default(byte[])))); + () => (ISnapshot)new Snapshot(((ValueComparer)((IProperty)derivedsId).GetValueComparer()).Snapshot(default(long)), ((ValueComparer)((IProperty)derivedsAlternateId).GetValueComparer()).Snapshot(default(Guid)), ((ValueComparer)((IProperty)principalsId).GetValueComparer()).Snapshot(default(long)), ((ValueComparer)((IProperty)principalsAlternateId).GetValueComparer()).Snapshot(default(Guid)), default(byte[]) == null ? null : ((ValueComparer)((IProperty)rowid).GetValueComparer()).Snapshot(default(byte[])))); runtimeEntityType.SetTemporaryValuesFactory( (InternalEntityEntry source) => (ISnapshot)new Snapshot(default(long), default(Guid), default(long), default(Guid), default(byte[]))); runtimeEntityType.SetShadowValuesFactory( @@ -408,8 +408,8 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) runtimeEntityType.SetRelationshipSnapshotFactory( (InternalEntityEntry source) => { - var entity = (Dictionary)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)derivedsId.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(derivedsId)), ((ValueComparer)derivedsAlternateId.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(derivedsAlternateId)), ((ValueComparer)principalsId.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalsId)), ((ValueComparer)principalsAlternateId.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalsAlternateId))); + var entity8 = (Dictionary)source.Entity; + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)derivedsId).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(derivedsId)), ((ValueComparer)((IProperty)derivedsAlternateId).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(derivedsAlternateId)), ((ValueComparer)((IProperty)principalsId).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalsId)), ((ValueComparer)((IProperty)principalsAlternateId).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalsAlternateId))); }); runtimeEntityType.Counts = new PropertyCounts( propertyCount: 5, diff --git a/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/BigModel/PrincipalDerivedEntityType.cs b/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/BigModel/PrincipalDerivedEntityType.cs index 4a5ce3ec81d..a9517d24838 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/BigModel/PrincipalDerivedEntityType.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/BigModel/PrincipalDerivedEntityType.cs @@ -122,11 +122,11 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) runtimeEntityType.SetOriginalValuesFactory( (InternalEntityEntry source) => { - var entity = (CompiledModelTestBase.PrincipalDerived>>)source.Entity; - return (ISnapshot)new Snapshot, Guid, CompiledModelTestBase.AnEnum, Nullable, CompiledModelTestBase.AFlagsEnum, CompiledModelTestBase.AFlagsEnum, IPAddress[], IEnumerable, IList, List, DateTime[], IEnumerable, IList, List>(source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)id.GetValueComparer()).Snapshot(source.GetCurrentValue>(id)), ((ValueComparer)alternateId.GetValueComparer()).Snapshot(source.GetCurrentValue(alternateId)), ((ValueComparer)enum1.GetValueComparer()).Snapshot(source.GetCurrentValue(enum1)), source.GetCurrentValue>(enum2) == null ? null : ((ValueComparer>)enum2.GetValueComparer()).Snapshot(source.GetCurrentValue>(enum2)), ((ValueComparer)flagsEnum1.GetValueComparer()).Snapshot(source.GetCurrentValue(flagsEnum1)), ((ValueComparer)flagsEnum2.GetValueComparer()).Snapshot(source.GetCurrentValue(flagsEnum2)), (object)source.GetCurrentValue(refTypeArray) == null ? null : (IPAddress[])((ValueComparer)refTypeArray.GetValueComparer()).Snapshot((object)source.GetCurrentValue(refTypeArray)), (object)source.GetCurrentValue>(refTypeEnumerable) == null ? null : (IEnumerable)((ValueComparer)refTypeEnumerable.GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeEnumerable)), (object)source.GetCurrentValue>(refTypeIList) == null ? null : (IList)((ValueComparer)refTypeIList.GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeIList)), (object)source.GetCurrentValue>(refTypeList) == null ? null : (List)((ValueComparer)refTypeList.GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeList)), (IEnumerable)source.GetCurrentValue(valueTypeArray) == null ? null : (DateTime[])((ValueComparer>)valueTypeArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(valueTypeArray)), source.GetCurrentValue>(valueTypeEnumerable) == null ? null : ((ValueComparer>)valueTypeEnumerable.GetValueComparer()).Snapshot(source.GetCurrentValue>(valueTypeEnumerable)), (IEnumerable)source.GetCurrentValue>(valueTypeIList) == null ? null : (IList)((ValueComparer>)valueTypeIList.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeIList)), (IEnumerable)source.GetCurrentValue>(valueTypeList) == null ? null : (List)((ValueComparer>)valueTypeList.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeList))); + var entity8 = (CompiledModelTestBase.PrincipalDerived>>)source.Entity; + return (ISnapshot)new Snapshot, Guid, CompiledModelTestBase.AnEnum, Nullable, CompiledModelTestBase.AFlagsEnum, CompiledModelTestBase.AFlagsEnum, IPAddress[], IEnumerable, IList, List, DateTime[], IEnumerable, IList, List>(source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)((IProperty)id).GetValueComparer()).Snapshot(source.GetCurrentValue>(id)), ((ValueComparer)((IProperty)alternateId).GetValueComparer()).Snapshot(source.GetCurrentValue(alternateId)), ((ValueComparer)((IProperty)enum1).GetValueComparer()).Snapshot(source.GetCurrentValue(enum1)), source.GetCurrentValue>(enum2) == null ? null : ((ValueComparer>)((IProperty)enum2).GetValueComparer()).Snapshot(source.GetCurrentValue>(enum2)), ((ValueComparer)((IProperty)flagsEnum1).GetValueComparer()).Snapshot(source.GetCurrentValue(flagsEnum1)), ((ValueComparer)((IProperty)flagsEnum2).GetValueComparer()).Snapshot(source.GetCurrentValue(flagsEnum2)), (object)source.GetCurrentValue(refTypeArray) == null ? null : (IPAddress[])((ValueComparer)((IProperty)refTypeArray).GetValueComparer()).Snapshot((object)source.GetCurrentValue(refTypeArray)), (object)source.GetCurrentValue>(refTypeEnumerable) == null ? null : (IEnumerable)((ValueComparer)((IProperty)refTypeEnumerable).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeEnumerable)), (object)source.GetCurrentValue>(refTypeIList) == null ? null : (IList)((ValueComparer)((IProperty)refTypeIList).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeIList)), (object)source.GetCurrentValue>(refTypeList) == null ? null : (List)((ValueComparer)((IProperty)refTypeList).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeList)), (IEnumerable)source.GetCurrentValue(valueTypeArray) == null ? null : (DateTime[])((ValueComparer>)((IProperty)valueTypeArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(valueTypeArray)), source.GetCurrentValue>(valueTypeEnumerable) == null ? null : ((ValueComparer>)((IProperty)valueTypeEnumerable).GetValueComparer()).Snapshot(source.GetCurrentValue>(valueTypeEnumerable)), (IEnumerable)source.GetCurrentValue>(valueTypeIList) == null ? null : (IList)((ValueComparer>)((IProperty)valueTypeIList).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeIList)), (IEnumerable)source.GetCurrentValue>(valueTypeList) == null ? null : (List)((ValueComparer>)((IProperty)valueTypeList).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeList))); }); runtimeEntityType.SetStoreGeneratedValuesFactory( - () => (ISnapshot)new Snapshot, Guid>(default(Nullable) == null ? null : ((ValueComparer>)id.GetValueComparer()).Snapshot(default(Nullable)), ((ValueComparer)alternateId.GetValueComparer()).Snapshot(default(Guid)))); + () => (ISnapshot)new Snapshot, Guid>(default(Nullable) == null ? null : ((ValueComparer>)((IProperty)id).GetValueComparer()).Snapshot(default(Nullable)), ((ValueComparer)((IProperty)alternateId).GetValueComparer()).Snapshot(default(Guid)))); runtimeEntityType.SetTemporaryValuesFactory( (InternalEntityEntry source) => (ISnapshot)new Snapshot, Guid>(default(Nullable), default(Guid))); runtimeEntityType.SetShadowValuesFactory( @@ -136,8 +136,8 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) runtimeEntityType.SetRelationshipSnapshotFactory( (InternalEntityEntry source) => { - var entity = (CompiledModelTestBase.PrincipalDerived>>)source.Entity; - return (ISnapshot)new Snapshot, Guid, object, object, object, object, object>(source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)id.GetKeyValueComparer()).Snapshot(source.GetCurrentValue>(id)), ((ValueComparer)alternateId.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(alternateId)), PrincipalBaseEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalBase__ownedField(entity), null, UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalDerived1_Dependent(entity), SnapshotFactoryFactory.SnapshotCollection(UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalDerived1_ManyOwned(entity)), null); + var entity8 = (CompiledModelTestBase.PrincipalDerived>>)source.Entity; + return (ISnapshot)new Snapshot, Guid, object, object, object, object, object>(source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)((IProperty)id).GetKeyValueComparer()).Snapshot(source.GetCurrentValue>(id)), ((ValueComparer)((IProperty)alternateId).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(alternateId)), PrincipalBaseEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalBase__ownedField(entity8), null, UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalDerived1_Dependent(entity8), SnapshotFactoryFactory.SnapshotCollection(UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalDerived1_ManyOwned(entity8)), null); }); runtimeEntityType.Counts = new PropertyCounts( propertyCount: 14, diff --git a/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/BigModel_with_JSON_columns/DependentBaseEntityType.cs b/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/BigModel_with_JSON_columns/DependentBaseEntityType.cs index 797d42daf95..a51f4bf5b7e 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/BigModel_with_JSON_columns/DependentBaseEntityType.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/BigModel_with_JSON_columns/DependentBaseEntityType.cs @@ -53,15 +53,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas principalId.TypeMapping = SqlServerLongTypeMapping.Default.Clone( comparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), keyComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v)); principalId.SetCurrentValueComparer(new EntryCurrentValueComparer(principalId)); principalId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); @@ -80,15 +80,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas principalAlternateId.TypeMapping = GuidTypeMapping.Default.Clone( comparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), keyComparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), providerValueComparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "uniqueidentifier")); @@ -109,11 +109,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumDiscriminator.TypeMapping = IntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum1 v1, CompiledModelTestBase.Enum1 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum1 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum1 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum1 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum1 v1, CompiledModelTestBase.Enum1 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum1 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum1 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum1 v) => v), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -277,10 +277,10 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (CompiledModelTestBase.DependentBase>)source.Entity; - return (ISnapshot)new Snapshot>(((ValueComparer)principalId.GetValueComparer()).Snapshot(source.GetCurrentValue(principalId)), ((ValueComparer)principalAlternateId.GetValueComparer()).Snapshot(source.GetCurrentValue(principalAlternateId)), ((ValueComparer)enumDiscriminator.GetValueComparer()).Snapshot(source.GetCurrentValue(enumDiscriminator)), source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)id.GetValueComparer()).Snapshot(source.GetCurrentValue>(id))); + return (ISnapshot)new Snapshot>(((ValueComparer)((IProperty)principalId).GetValueComparer()).Snapshot(source.GetCurrentValue(principalId)), ((ValueComparer)((IProperty)principalAlternateId).GetValueComparer()).Snapshot(source.GetCurrentValue(principalAlternateId)), ((ValueComparer)((IProperty)enumDiscriminator).GetValueComparer()).Snapshot(source.GetCurrentValue(enumDiscriminator)), source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)((IProperty)id).GetValueComparer()).Snapshot(source.GetCurrentValue>(id))); }); runtimeEntityType.SetStoreGeneratedValuesFactory( - () => (ISnapshot)new Snapshot(((ValueComparer)principalId.GetValueComparer()).Snapshot(default(long)), ((ValueComparer)principalAlternateId.GetValueComparer()).Snapshot(default(Guid)))); + () => (ISnapshot)new Snapshot(((ValueComparer)((IProperty)principalId).GetValueComparer()).Snapshot(default(long)), ((ValueComparer)((IProperty)principalAlternateId).GetValueComparer()).Snapshot(default(Guid)))); runtimeEntityType.SetTemporaryValuesFactory( (InternalEntityEntry source) => (ISnapshot)new Snapshot(default(long), default(Guid))); runtimeEntityType.SetShadowValuesFactory( @@ -291,7 +291,7 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (CompiledModelTestBase.DependentBase>)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)principalId.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalId)), ((ValueComparer)principalAlternateId.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalAlternateId)), UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_DependentBase1_Principal(entity)); + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)principalId).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalId)), ((ValueComparer)((IProperty)principalAlternateId).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalAlternateId)), UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_DependentBase1_Principal(entity)); }); runtimeEntityType.Counts = new PropertyCounts( propertyCount: 4, diff --git a/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/BigModel_with_JSON_columns/DependentDerivedEntityType.cs b/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/BigModel_with_JSON_columns/DependentDerivedEntityType.cs index 0ca672b10df..55ebcd56287 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/BigModel_with_JSON_columns/DependentDerivedEntityType.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/BigModel_with_JSON_columns/DependentDerivedEntityType.cs @@ -62,15 +62,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas data.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "char(20)", @@ -96,15 +96,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas money.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( comparer: new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v), keyComparer: new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v), providerValueComparer: new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "decimal(9,3)", @@ -127,11 +127,11 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) runtimeEntityType.SetOriginalValuesFactory( (InternalEntityEntry source) => { - var entity = (CompiledModelTestBase.DependentDerived>)source.Entity; - return (ISnapshot)new Snapshot, string, decimal>(((ValueComparer)principalId.GetValueComparer()).Snapshot(source.GetCurrentValue(principalId)), ((ValueComparer)principalAlternateId.GetValueComparer()).Snapshot(source.GetCurrentValue(principalAlternateId)), ((ValueComparer)enumDiscriminator.GetValueComparer()).Snapshot(source.GetCurrentValue(enumDiscriminator)), source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)id.GetValueComparer()).Snapshot(source.GetCurrentValue>(id)), source.GetCurrentValue(data) == null ? null : ((ValueComparer)data.GetValueComparer()).Snapshot(source.GetCurrentValue(data)), ((ValueComparer)money.GetValueComparer()).Snapshot(source.GetCurrentValue(money))); + var entity8 = (CompiledModelTestBase.DependentDerived>)source.Entity; + return (ISnapshot)new Snapshot, string, decimal>(((ValueComparer)((IProperty)principalId).GetValueComparer()).Snapshot(source.GetCurrentValue(principalId)), ((ValueComparer)((IProperty)principalAlternateId).GetValueComparer()).Snapshot(source.GetCurrentValue(principalAlternateId)), ((ValueComparer)((IProperty)enumDiscriminator).GetValueComparer()).Snapshot(source.GetCurrentValue(enumDiscriminator)), source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)((IProperty)id).GetValueComparer()).Snapshot(source.GetCurrentValue>(id)), source.GetCurrentValue(data) == null ? null : ((ValueComparer)((IProperty)data).GetValueComparer()).Snapshot(source.GetCurrentValue(data)), ((ValueComparer)((IProperty)money).GetValueComparer()).Snapshot(source.GetCurrentValue(money))); }); runtimeEntityType.SetStoreGeneratedValuesFactory( - () => (ISnapshot)new Snapshot(((ValueComparer)principalId.GetValueComparer()).Snapshot(default(long)), ((ValueComparer)principalAlternateId.GetValueComparer()).Snapshot(default(Guid)))); + () => (ISnapshot)new Snapshot(((ValueComparer)((IProperty)principalId).GetValueComparer()).Snapshot(default(long)), ((ValueComparer)((IProperty)principalAlternateId).GetValueComparer()).Snapshot(default(Guid)))); runtimeEntityType.SetTemporaryValuesFactory( (InternalEntityEntry source) => (ISnapshot)new Snapshot(default(long), default(Guid))); runtimeEntityType.SetShadowValuesFactory( @@ -141,8 +141,8 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) runtimeEntityType.SetRelationshipSnapshotFactory( (InternalEntityEntry source) => { - var entity = (CompiledModelTestBase.DependentDerived>)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)principalId.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalId)), ((ValueComparer)principalAlternateId.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalAlternateId)), DependentBaseEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_DependentBase1_Principal(entity)); + var entity8 = (CompiledModelTestBase.DependentDerived>)source.Entity; + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)principalId).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalId)), ((ValueComparer)((IProperty)principalAlternateId).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalAlternateId)), DependentBaseEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_DependentBase1_Principal(entity8)); }); runtimeEntityType.Counts = new PropertyCounts( propertyCount: 6, 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 3e6ffa7d0b7..afcd9c87110 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 @@ -70,11 +70,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas id.TypeMapping = IntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.ManyTypesId v1, CompiledModelTestBase.ManyTypesId v2) => v1.Equals(v2), - (CompiledModelTestBase.ManyTypesId v) => v.GetHashCode(), + (CompiledModelTestBase.ManyTypesId v) => ((object)v).GetHashCode(), (CompiledModelTestBase.ManyTypesId v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.ManyTypesId v1, CompiledModelTestBase.ManyTypesId v2) => v1.Equals(v2), - (CompiledModelTestBase.ManyTypesId v) => v.GetHashCode(), + (CompiledModelTestBase.ManyTypesId v) => ((object)v).GetHashCode(), (CompiledModelTestBase.ManyTypesId v) => v), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -123,15 +123,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas @bool.TypeMapping = SqlServerBoolTypeMapping.Default.Clone( comparer: new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v), keyComparer: new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v), providerValueComparer: new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v)); @bool.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); @bool.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Bool", "TestNamespace") }); @@ -165,15 +165,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas boolArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer(new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v)), keyComparer: new ListOfValueTypesComparer(new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -187,15 +187,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerBoolTypeMapping.Default.Clone( comparer: new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v), keyComparer: new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v), providerValueComparer: new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v))); boolArray.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); boolArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BoolArray", "TestNamespace") }); @@ -206,17 +206,17 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("BoolNestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); boolNestedCollection.SetGetter( - (CompiledModelTestBase.ManyTypes entity) => ReadBoolNestedCollection(entity), - (CompiledModelTestBase.ManyTypes entity) => ReadBoolNestedCollection(entity) == null, - (CompiledModelTestBase.ManyTypes instance) => ReadBoolNestedCollection(instance), - (CompiledModelTestBase.ManyTypes instance) => ReadBoolNestedCollection(instance) == null); + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BoolNestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BoolNestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BoolNestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BoolNestedCollection(instance) == null); boolNestedCollection.SetSetter( - (CompiledModelTestBase.ManyTypes entity, bool[][] value) => WriteBoolNestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, bool[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BoolNestedCollection(entity) = value); boolNestedCollection.SetMaterializationSetter( - (CompiledModelTestBase.ManyTypes entity, bool[][] value) => WriteBoolNestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, bool[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BoolNestedCollection(entity) = value); boolNestedCollection.SetAccessors( - (InternalEntityEntry entry) => ReadBoolNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => ReadBoolNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BoolNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BoolNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => entry.ReadOriginalValue(boolNestedCollection, 3), (InternalEntityEntry entry) => entry.GetCurrentValue(boolNestedCollection), (ValueBuffer valueBuffer) => valueBuffer[3]); @@ -229,15 +229,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas boolNestedCollection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer(new ListOfValueTypesComparer(new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v))), keyComparer: new ListOfReferenceTypesComparer(new ListOfValueTypesComparer(new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -253,15 +253,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer(new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v)), keyComparer: new ListOfValueTypesComparer(new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -275,17 +275,18 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerBoolTypeMapping.Default.Clone( comparer: new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v), keyComparer: new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v), providerValueComparer: new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v)))); boolNestedCollection.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + boolNestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BoolNestedCollection", "TestNamespace") }); var boolToStringConverterProperty = runtimeEntityType.AddProperty( "BoolToStringConverterProperty", @@ -316,15 +317,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas boolToStringConverterProperty.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v), keyComparer: new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(1)", @@ -372,11 +373,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas boolToTwoValuesConverterProperty.TypeMapping = SqlServerByteTypeMapping.Default.Clone( comparer: new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v), keyComparer: new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v), providerValueComparer: new ValueComparer( (byte v1, byte v2) => v1 == v2, @@ -424,11 +425,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas boolToZeroOneConverterProperty.TypeMapping = SqlServerShortTypeMapping.Default.Clone( comparer: new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v), keyComparer: new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v), providerValueComparer: new ValueComparer( (short v1, short v2) => v1 == v2, @@ -475,7 +476,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas bytes.TypeMapping = SqlServerByteArrayTypeMapping.Default.Clone( comparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), - (byte[] v) => v.GetHashCode(), + (byte[] v) => ((object)v).GetHashCode(), (byte[] v) => v), keyComparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), @@ -520,15 +521,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas bytesArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer(new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), - (byte[] v) => v.GetHashCode(), + (byte[] v) => ((object)v).GetHashCode(), (byte[] v) => v)), keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), - (byte[] v) => v.GetHashCode(), + (byte[] v) => ((object)v).GetHashCode(), (byte[] v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -542,7 +543,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerByteArrayTypeMapping.Default.Clone( comparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), - (byte[] v) => v.GetHashCode(), + (byte[] v) => ((object)v).GetHashCode(), (byte[] v) => v), keyComparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), @@ -564,17 +565,17 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("BytesNestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); bytesNestedCollection.SetGetter( - (CompiledModelTestBase.ManyTypes entity) => ReadBytesNestedCollection(entity), - (CompiledModelTestBase.ManyTypes entity) => ReadBytesNestedCollection(entity) == null, - (CompiledModelTestBase.ManyTypes instance) => ReadBytesNestedCollection(instance), - (CompiledModelTestBase.ManyTypes instance) => ReadBytesNestedCollection(instance) == null); + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BytesNestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BytesNestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BytesNestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BytesNestedCollection(instance) == null); bytesNestedCollection.SetSetter( - (CompiledModelTestBase.ManyTypes entity, byte[][][] value) => WriteBytesNestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, byte[][][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BytesNestedCollection(entity) = value); bytesNestedCollection.SetMaterializationSetter( - (CompiledModelTestBase.ManyTypes entity, byte[][][] value) => WriteBytesNestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, byte[][][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BytesNestedCollection(entity) = value); bytesNestedCollection.SetAccessors( - (InternalEntityEntry entry) => ReadBytesNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => ReadBytesNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BytesNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BytesNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => entry.ReadOriginalValue(bytesNestedCollection, 9), (InternalEntityEntry entry) => entry.GetCurrentValue(bytesNestedCollection), (ValueBuffer valueBuffer) => valueBuffer[9]); @@ -587,15 +588,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas bytesNestedCollection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer(new ListOfReferenceTypesComparer(new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), - (byte[] v) => v.GetHashCode(), + (byte[] v) => ((object)v).GetHashCode(), (byte[] v) => v))), keyComparer: new ListOfReferenceTypesComparer(new ListOfReferenceTypesComparer(new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), - (byte[] v) => v.GetHashCode(), + (byte[] v) => ((object)v).GetHashCode(), (byte[] v) => v))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -611,15 +612,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer(new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), - (byte[] v) => v.GetHashCode(), + (byte[] v) => ((object)v).GetHashCode(), (byte[] v) => v)), keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), - (byte[] v) => v.GetHashCode(), + (byte[] v) => ((object)v).GetHashCode(), (byte[] v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -633,7 +634,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerByteArrayTypeMapping.Default.Clone( comparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), - (byte[] v) => v.GetHashCode(), + (byte[] v) => ((object)v).GetHashCode(), (byte[] v) => v), keyComparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), @@ -647,6 +648,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas storeTypeName: "varbinary(max)"), storeTypePostfix: StoreTypePostfix.None))); bytesNestedCollection.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + bytesNestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BytesNestedCollection", "TestNamespace") }); var bytesToStringConverterProperty = runtimeEntityType.AddProperty( "BytesToStringConverterProperty", @@ -687,7 +689,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (byte[] v) => v.ToArray()), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -743,7 +745,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (int v) => v), providerValueComparer: new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v), converter: new ValueConverter( (int v) => (decimal)v, @@ -794,7 +796,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (char v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(1)", @@ -850,7 +852,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (char v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -880,7 +882,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (char v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(1)", @@ -904,17 +906,17 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("CharNestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); charNestedCollection.SetGetter( - (CompiledModelTestBase.ManyTypes entity) => ReadCharNestedCollection(entity), - (CompiledModelTestBase.ManyTypes entity) => ReadCharNestedCollection(entity) == null, - (CompiledModelTestBase.ManyTypes instance) => ReadCharNestedCollection(instance), - (CompiledModelTestBase.ManyTypes instance) => ReadCharNestedCollection(instance) == null); + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_CharNestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_CharNestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_CharNestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_CharNestedCollection(instance) == null); charNestedCollection.SetSetter( - (CompiledModelTestBase.ManyTypes entity, char[][] value) => WriteCharNestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, char[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_CharNestedCollection(entity) = value); charNestedCollection.SetMaterializationSetter( - (CompiledModelTestBase.ManyTypes entity, char[][] value) => WriteCharNestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, char[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_CharNestedCollection(entity) = value); charNestedCollection.SetAccessors( - (InternalEntityEntry entry) => ReadCharNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => ReadCharNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_CharNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_CharNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => entry.ReadOriginalValue(charNestedCollection, 14), (InternalEntityEntry entry) => entry.GetCurrentValue(charNestedCollection), (ValueBuffer valueBuffer) => valueBuffer[14]); @@ -935,7 +937,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (char v) => v))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -967,7 +969,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (char v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -997,7 +999,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (char v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(1)", @@ -1013,6 +1015,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (char v) => string.Format(CultureInfo.InvariantCulture, "{0}", (object)v), (string v) => v.Length < 1 ? '\0' : v[0]))))); charNestedCollection.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + charNestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_CharNestedCollection", "TestNamespace") }); var charToStringConverterProperty = runtimeEntityType.AddProperty( "CharToStringConverterProperty", @@ -1052,7 +1055,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (char v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nchar(1)", @@ -1103,15 +1106,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas dateOnly.TypeMapping = SqlServerDateOnlyTypeMapping.Default.Clone( comparer: new ValueComparer( (DateOnly v1, DateOnly v2) => v1.Equals(v2), - (DateOnly v) => v.GetHashCode(), + (DateOnly v) => ((object)v).GetHashCode(), (DateOnly v) => v), keyComparer: new ValueComparer( (DateOnly v1, DateOnly v2) => v1.Equals(v2), - (DateOnly v) => v.GetHashCode(), + (DateOnly v) => ((object)v).GetHashCode(), (DateOnly v) => v), providerValueComparer: new ValueComparer( (DateOnly v1, DateOnly v2) => v1.Equals(v2), - (DateOnly v) => v.GetHashCode(), + (DateOnly v) => ((object)v).GetHashCode(), (DateOnly v) => v)); dateOnly.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); dateOnly.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DateOnly", "TestNamespace") }); @@ -1145,15 +1148,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas dateOnlyArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer(new ValueComparer( (DateOnly v1, DateOnly v2) => v1.Equals(v2), - (DateOnly v) => v.GetHashCode(), + (DateOnly v) => ((object)v).GetHashCode(), (DateOnly v) => v)), keyComparer: new ListOfValueTypesComparer(new ValueComparer( (DateOnly v1, DateOnly v2) => v1.Equals(v2), - (DateOnly v) => v.GetHashCode(), + (DateOnly v) => ((object)v).GetHashCode(), (DateOnly v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -1167,15 +1170,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerDateOnlyTypeMapping.Default.Clone( comparer: new ValueComparer( (DateOnly v1, DateOnly v2) => v1.Equals(v2), - (DateOnly v) => v.GetHashCode(), + (DateOnly v) => ((object)v).GetHashCode(), (DateOnly v) => v), keyComparer: new ValueComparer( (DateOnly v1, DateOnly v2) => v1.Equals(v2), - (DateOnly v) => v.GetHashCode(), + (DateOnly v) => ((object)v).GetHashCode(), (DateOnly v) => v), providerValueComparer: new ValueComparer( (DateOnly v1, DateOnly v2) => v1.Equals(v2), - (DateOnly v) => v.GetHashCode(), + (DateOnly v) => ((object)v).GetHashCode(), (DateOnly v) => v))); dateOnlyArray.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); dateOnlyArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DateOnlyArray", "TestNamespace") }); @@ -1210,15 +1213,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas dateOnlyToStringConverterProperty.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (DateOnly v1, DateOnly v2) => v1.Equals(v2), - (DateOnly v) => v.GetHashCode(), + (DateOnly v) => ((object)v).GetHashCode(), (DateOnly v) => v), keyComparer: new ValueComparer( (DateOnly v1, DateOnly v2) => v1.Equals(v2), - (DateOnly v) => v.GetHashCode(), + (DateOnly v) => ((object)v).GetHashCode(), (DateOnly v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(10)", @@ -1267,15 +1270,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas dateTime.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( comparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v), keyComparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v), providerValueComparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v)); dateTime.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); dateTime.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DateTime", "TestNamespace") }); @@ -1309,15 +1312,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas dateTimeArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer(new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v)), keyComparer: new ListOfValueTypesComparer(new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -1331,15 +1334,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerDateTimeTypeMapping.Default.Clone( comparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v), keyComparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v), providerValueComparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v))); dateTimeArray.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); dateTimeArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DateTimeArray", "TestNamespace") }); @@ -1374,15 +1377,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas dateTimeOffsetToBinaryConverterProperty.TypeMapping = SqlServerLongTypeMapping.Default.Clone( comparer: new ValueComparer( (DateTimeOffset v1, DateTimeOffset v2) => v1.EqualsExact(v2), - (DateTimeOffset v) => v.GetHashCode(), + (DateTimeOffset v) => ((object)v).GetHashCode(), (DateTimeOffset v) => v), keyComparer: new ValueComparer( (DateTimeOffset v1, DateTimeOffset v2) => v1.EqualsExact(v2), - (DateTimeOffset v) => v.GetHashCode(), + (DateTimeOffset v) => ((object)v).GetHashCode(), (DateTimeOffset v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), converter: new ValueConverter( (DateTimeOffset v) => DateTimeOffsetToBinaryConverter.ToLong(v), @@ -1426,11 +1429,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas dateTimeOffsetToBytesConverterProperty.TypeMapping = SqlServerByteArrayTypeMapping.Default.Clone( comparer: new ValueComparer( (DateTimeOffset v1, DateTimeOffset v2) => v1.EqualsExact(v2), - (DateTimeOffset v) => v.GetHashCode(), + (DateTimeOffset v) => ((object)v).GetHashCode(), (DateTimeOffset v) => v), keyComparer: new ValueComparer( (DateTimeOffset v1, DateTimeOffset v2) => v1.EqualsExact(v2), - (DateTimeOffset v) => v.GetHashCode(), + (DateTimeOffset v) => ((object)v).GetHashCode(), (DateTimeOffset v) => v), providerValueComparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), @@ -1481,15 +1484,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas dateTimeOffsetToStringConverterProperty.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (DateTimeOffset v1, DateTimeOffset v2) => v1.EqualsExact(v2), - (DateTimeOffset v) => v.GetHashCode(), + (DateTimeOffset v) => ((object)v).GetHashCode(), (DateTimeOffset v) => v), keyComparer: new ValueComparer( (DateTimeOffset v1, DateTimeOffset v2) => v1.EqualsExact(v2), - (DateTimeOffset v) => v.GetHashCode(), + (DateTimeOffset v) => ((object)v).GetHashCode(), (DateTimeOffset v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(48)", @@ -1538,15 +1541,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas dateTimeToBinaryConverterProperty.TypeMapping = SqlServerLongTypeMapping.Default.Clone( comparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v), keyComparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), converter: new ValueConverter( (DateTime v) => v.ToBinary(), @@ -1590,15 +1593,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas dateTimeToStringConverterProperty.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v), keyComparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(48)", @@ -1647,15 +1650,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas dateTimeToTicksConverterProperty.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( comparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v), keyComparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v), providerValueComparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v)); dateTimeToTicksConverterProperty.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); dateTimeToTicksConverterProperty.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DateTimeToTicksConverterProperty", "TestNamespace") }); @@ -1690,15 +1693,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas @decimal.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( comparer: new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v), keyComparer: new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v), providerValueComparer: new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v)); @decimal.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); @decimal.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Decimal", "TestNamespace") }); @@ -1732,15 +1735,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas decimalArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer(new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v)), keyComparer: new ListOfValueTypesComparer(new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -1754,15 +1757,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerDecimalTypeMapping.Default.Clone( comparer: new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v), keyComparer: new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v), providerValueComparer: new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v))); decimalArray.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); decimalArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DecimalArray", "TestNamespace") }); @@ -1797,11 +1800,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas decimalNumberToBytesConverterProperty.TypeMapping = SqlServerByteArrayTypeMapping.Default.Clone( comparer: new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v), keyComparer: new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v), providerValueComparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), @@ -1852,15 +1855,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas decimalNumberToStringConverterProperty.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v), keyComparer: new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(64)", @@ -1909,15 +1912,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas @double.TypeMapping = SqlServerDoubleTypeMapping.Default.Clone( comparer: new ValueComparer( (double v1, double v2) => v1.Equals(v2), - (double v) => v.GetHashCode(), + (double v) => ((object)v).GetHashCode(), (double v) => v), keyComparer: new ValueComparer( (double v1, double v2) => v1.Equals(v2), - (double v) => v.GetHashCode(), + (double v) => ((object)v).GetHashCode(), (double v) => v), providerValueComparer: new ValueComparer( (double v1, double v2) => v1.Equals(v2), - (double v) => v.GetHashCode(), + (double v) => ((object)v).GetHashCode(), (double v) => v)); @double.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); @double.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Double", "TestNamespace") }); @@ -1951,15 +1954,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas doubleArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer(new ValueComparer( (double v1, double v2) => v1.Equals(v2), - (double v) => v.GetHashCode(), + (double v) => ((object)v).GetHashCode(), (double v) => v)), keyComparer: new ListOfValueTypesComparer(new ValueComparer( (double v1, double v2) => v1.Equals(v2), - (double v) => v.GetHashCode(), + (double v) => ((object)v).GetHashCode(), (double v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -1973,15 +1976,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerDoubleTypeMapping.Default.Clone( comparer: new ValueComparer( (double v1, double v2) => v1.Equals(v2), - (double v) => v.GetHashCode(), + (double v) => ((object)v).GetHashCode(), (double v) => v), keyComparer: new ValueComparer( (double v1, double v2) => v1.Equals(v2), - (double v) => v.GetHashCode(), + (double v) => ((object)v).GetHashCode(), (double v) => v), providerValueComparer: new ValueComparer( (double v1, double v2) => v1.Equals(v2), - (double v) => v.GetHashCode(), + (double v) => ((object)v).GetHashCode(), (double v) => v))); doubleArray.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); doubleArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DoubleArray", "TestNamespace") }); @@ -2016,11 +2019,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas doubleNumberToBytesConverterProperty.TypeMapping = SqlServerByteArrayTypeMapping.Default.Clone( comparer: new ValueComparer( (double v1, double v2) => v1.Equals(v2), - (double v) => v.GetHashCode(), + (double v) => ((object)v).GetHashCode(), (double v) => v), keyComparer: new ValueComparer( (double v1, double v2) => v1.Equals(v2), - (double v) => v.GetHashCode(), + (double v) => ((object)v).GetHashCode(), (double v) => v), providerValueComparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), @@ -2071,15 +2074,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas doubleNumberToStringConverterProperty.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (double v1, double v2) => v1.Equals(v2), - (double v) => v.GetHashCode(), + (double v) => ((object)v).GetHashCode(), (double v) => v), keyComparer: new ValueComparer( (double v1, double v2) => v1.Equals(v2), - (double v) => v.GetHashCode(), + (double v) => ((object)v).GetHashCode(), (double v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(64)", @@ -2127,11 +2130,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum16.TypeMapping = SqlServerShortTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v), providerValueComparer: new ValueComparer( (short v1, short v2) => v1 == v2, @@ -2178,15 +2181,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum16Array.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v)), keyComparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -2208,11 +2211,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerShortTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v), providerValueComparer: new ValueComparer( (short v1, short v2) => v1 == v2, @@ -2259,28 +2262,28 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum16AsString.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (CompiledModelTestBase.Enum16 v) => v.ToString(), + (CompiledModelTestBase.Enum16 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum16 v) => v.ToString(), + (CompiledModelTestBase.Enum16 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))); enum16AsString.SetSentinelFromProviderValue("Default"); enum16AsString.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); @@ -2315,15 +2318,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum16AsStringArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v)), keyComparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -2333,40 +2336,40 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum16 v) => v.ToString(), + (CompiledModelTestBase.Enum16 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum16 v) => v.ToString(), + (CompiledModelTestBase.Enum16 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))), elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (CompiledModelTestBase.Enum16 v) => v.ToString(), + (CompiledModelTestBase.Enum16 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum16 v) => v.ToString(), + (CompiledModelTestBase.Enum16 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))); enum16AsStringArray.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); enum16AsStringArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum16AsStringArray", "TestNamespace") }); @@ -2400,15 +2403,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum16AsStringCollection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer, CompiledModelTestBase.Enum16>(new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v)), keyComparer: new ListOfValueTypesComparer, CompiledModelTestBase.Enum16>(new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -2418,40 +2421,40 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum16 v) => v.ToString(), + (CompiledModelTestBase.Enum16 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.Enum16>( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum16 v) => v.ToString(), + (CompiledModelTestBase.Enum16 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))), elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (CompiledModelTestBase.Enum16 v) => v.ToString(), + (CompiledModelTestBase.Enum16 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum16 v) => v.ToString(), + (CompiledModelTestBase.Enum16 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))); enum16AsStringCollection.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); enum16AsStringCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum16AsStringCollection", "TestNamespace") }); @@ -2485,15 +2488,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum16Collection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer, CompiledModelTestBase.Enum16>(new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v)), keyComparer: new ListOfValueTypesComparer, CompiledModelTestBase.Enum16>(new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -2515,11 +2518,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerShortTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v), providerValueComparer: new ValueComparer( (short v1, short v2) => v1 == v2, @@ -2565,11 +2568,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum32.TypeMapping = IntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -2616,15 +2619,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum32Array.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v)), keyComparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -2646,11 +2649,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: IntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -2697,28 +2700,28 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum32AsString.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (CompiledModelTestBase.Enum32 v) => v.ToString(), + (CompiledModelTestBase.Enum32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum32 v) => v.ToString(), + (CompiledModelTestBase.Enum32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))); enum32AsString.SetSentinelFromProviderValue("Default"); enum32AsString.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); @@ -2753,15 +2756,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum32AsStringArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v)), keyComparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -2771,40 +2774,40 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum32 v) => v.ToString(), + (CompiledModelTestBase.Enum32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum32 v) => v.ToString(), + (CompiledModelTestBase.Enum32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))), elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (CompiledModelTestBase.Enum32 v) => v.ToString(), + (CompiledModelTestBase.Enum32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum32 v) => v.ToString(), + (CompiledModelTestBase.Enum32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))); enum32AsStringArray.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); enum32AsStringArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum32AsStringArray", "TestNamespace") }); @@ -2838,15 +2841,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum32AsStringCollection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer, CompiledModelTestBase.Enum32>(new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v)), keyComparer: new ListOfValueTypesComparer, CompiledModelTestBase.Enum32>(new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -2856,40 +2859,40 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum32 v) => v.ToString(), + (CompiledModelTestBase.Enum32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.Enum32>( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum32 v) => v.ToString(), + (CompiledModelTestBase.Enum32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))), elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (CompiledModelTestBase.Enum32 v) => v.ToString(), + (CompiledModelTestBase.Enum32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum32 v) => v.ToString(), + (CompiledModelTestBase.Enum32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))); enum32AsStringCollection.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); enum32AsStringCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum32AsStringCollection", "TestNamespace") }); @@ -2923,15 +2926,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum32Collection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer, CompiledModelTestBase.Enum32>(new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v)), keyComparer: new ListOfValueTypesComparer, CompiledModelTestBase.Enum32>(new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -2953,11 +2956,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: IntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -2980,17 +2983,17 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("Enum32NestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); enum32NestedCollection.SetGetter( - (CompiledModelTestBase.ManyTypes entity) => ReadEnum32NestedCollection(entity), - (CompiledModelTestBase.ManyTypes entity) => ReadEnum32NestedCollection(entity) == null, - (CompiledModelTestBase.ManyTypes instance) => ReadEnum32NestedCollection(instance), - (CompiledModelTestBase.ManyTypes instance) => ReadEnum32NestedCollection(instance) == null); + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum32NestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum32NestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum32NestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum32NestedCollection(instance) == null); enum32NestedCollection.SetSetter( - (CompiledModelTestBase.ManyTypes entity, List[][] value) => WriteEnum32NestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, List[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum32NestedCollection(entity) = value); enum32NestedCollection.SetMaterializationSetter( - (CompiledModelTestBase.ManyTypes entity, List[][] value) => WriteEnum32NestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, List[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum32NestedCollection(entity) = value); enum32NestedCollection.SetAccessors( - (InternalEntityEntry entry) => ReadEnum32NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => ReadEnum32NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum32NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum32NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => entry.ReadOriginalValue[][]>(enum32NestedCollection, 47), (InternalEntityEntry entry) => entry.GetCurrentValue[][]>(enum32NestedCollection), (ValueBuffer valueBuffer) => valueBuffer[47]); @@ -3003,15 +3006,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum32NestedCollection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer[][], List[]>(new ListOfReferenceTypesComparer[], List>(new ListOfValueTypesComparer, CompiledModelTestBase.Enum32>(new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v)))), keyComparer: new ListOfReferenceTypesComparer[][], List[]>(new ListOfReferenceTypesComparer[], List>(new ListOfValueTypesComparer, CompiledModelTestBase.Enum32>(new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v)))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -3037,15 +3040,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer[], List>(new ListOfValueTypesComparer, CompiledModelTestBase.Enum32>(new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v))), keyComparer: new ListOfReferenceTypesComparer[], List>(new ListOfValueTypesComparer, CompiledModelTestBase.Enum32>(new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -3069,15 +3072,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer, CompiledModelTestBase.Enum32>(new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v)), keyComparer: new ListOfValueTypesComparer, CompiledModelTestBase.Enum32>(new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -3099,11 +3102,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: IntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -3118,6 +3121,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (CompiledModelTestBase.Enum32 value) => (int)value, (int value) => (CompiledModelTestBase.Enum32)value)))))); enum32NestedCollection.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + enum32NestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum32NestedCollection", "TestNamespace") }); var enum64 = runtimeEntityType.AddProperty( "Enum64", @@ -3148,15 +3152,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum64.TypeMapping = SqlServerLongTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), converter: new ValueConverter( (CompiledModelTestBase.Enum64 value) => (long)value, @@ -3199,15 +3203,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum64Array.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v)), keyComparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -3229,15 +3233,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerLongTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), converter: new ValueConverter( (CompiledModelTestBase.Enum64 value) => (long)value, @@ -3280,28 +3284,28 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum64AsString.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (CompiledModelTestBase.Enum64 v) => v.ToString(), + (CompiledModelTestBase.Enum64 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum64 v) => v.ToString(), + (CompiledModelTestBase.Enum64 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))); enum64AsString.SetSentinelFromProviderValue("Default"); enum64AsString.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); @@ -3336,15 +3340,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum64AsStringArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v)), keyComparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -3354,40 +3358,40 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum64 v) => v.ToString(), + (CompiledModelTestBase.Enum64 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum64 v) => v.ToString(), + (CompiledModelTestBase.Enum64 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))), elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (CompiledModelTestBase.Enum64 v) => v.ToString(), + (CompiledModelTestBase.Enum64 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum64 v) => v.ToString(), + (CompiledModelTestBase.Enum64 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))); enum64AsStringArray.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); enum64AsStringArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum64AsStringArray", "TestNamespace") }); @@ -3421,15 +3425,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum64AsStringCollection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer, CompiledModelTestBase.Enum64>(new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v)), keyComparer: new ListOfValueTypesComparer, CompiledModelTestBase.Enum64>(new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -3439,40 +3443,40 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum64 v) => v.ToString(), + (CompiledModelTestBase.Enum64 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.Enum64>( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum64 v) => v.ToString(), + (CompiledModelTestBase.Enum64 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))), elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (CompiledModelTestBase.Enum64 v) => v.ToString(), + (CompiledModelTestBase.Enum64 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum64 v) => v.ToString(), + (CompiledModelTestBase.Enum64 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))); enum64AsStringCollection.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); enum64AsStringCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum64AsStringCollection", "TestNamespace") }); @@ -3506,15 +3510,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum64Collection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer, CompiledModelTestBase.Enum64>(new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v)), keyComparer: new ListOfValueTypesComparer, CompiledModelTestBase.Enum64>(new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -3536,15 +3540,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerLongTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), converter: new ValueConverter( (CompiledModelTestBase.Enum64 value) => (long)value, @@ -3586,11 +3590,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum8.TypeMapping = SqlServerShortTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), providerValueComparer: new ValueComparer( (short v1, short v2) => v1 == v2, @@ -3637,15 +3641,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum8Array.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v)), keyComparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -3667,11 +3671,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerShortTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), providerValueComparer: new ValueComparer( (short v1, short v2) => v1 == v2, @@ -3718,28 +3722,28 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum8AsString.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (CompiledModelTestBase.Enum8 v) => v.ToString(), + (CompiledModelTestBase.Enum8 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum8 v) => v.ToString(), + (CompiledModelTestBase.Enum8 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))); enum8AsString.SetSentinelFromProviderValue("Default"); enum8AsString.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); @@ -3774,15 +3778,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum8AsStringArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v)), keyComparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -3792,40 +3796,40 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum8 v) => v.ToString(), + (CompiledModelTestBase.Enum8 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum8 v) => v.ToString(), + (CompiledModelTestBase.Enum8 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))), elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (CompiledModelTestBase.Enum8 v) => v.ToString(), + (CompiledModelTestBase.Enum8 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum8 v) => v.ToString(), + (CompiledModelTestBase.Enum8 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))); enum8AsStringArray.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); enum8AsStringArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum8AsStringArray", "TestNamespace") }); @@ -3859,15 +3863,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum8AsStringCollection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer, CompiledModelTestBase.Enum8>(new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v)), keyComparer: new ListOfValueTypesComparer, CompiledModelTestBase.Enum8>(new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -3877,40 +3881,40 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum8 v) => v.ToString(), + (CompiledModelTestBase.Enum8 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.Enum8>( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum8 v) => v.ToString(), + (CompiledModelTestBase.Enum8 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))), elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (CompiledModelTestBase.Enum8 v) => v.ToString(), + (CompiledModelTestBase.Enum8 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum8 v) => v.ToString(), + (CompiledModelTestBase.Enum8 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))); enum8AsStringCollection.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); enum8AsStringCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum8AsStringCollection", "TestNamespace") }); @@ -3944,15 +3948,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum8Collection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer, CompiledModelTestBase.Enum8>(new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v)), keyComparer: new ListOfValueTypesComparer, CompiledModelTestBase.Enum8>(new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -3974,11 +3978,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerShortTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), providerValueComparer: new ValueComparer( (short v1, short v2) => v1 == v2, @@ -4001,17 +4005,17 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("Enum8NestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); enum8NestedCollection.SetGetter( - (CompiledModelTestBase.ManyTypes entity) => ReadEnum8NestedCollection(entity), - (CompiledModelTestBase.ManyTypes entity) => ReadEnum8NestedCollection(entity) == null, - (CompiledModelTestBase.ManyTypes instance) => ReadEnum8NestedCollection(instance), - (CompiledModelTestBase.ManyTypes instance) => ReadEnum8NestedCollection(instance) == null); + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum8NestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum8NestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum8NestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum8NestedCollection(instance) == null); enum8NestedCollection.SetSetter( - (CompiledModelTestBase.ManyTypes entity, CompiledModelTestBase.Enum8[][] value) => WriteEnum8NestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, CompiledModelTestBase.Enum8[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum8NestedCollection(entity) = value); enum8NestedCollection.SetMaterializationSetter( - (CompiledModelTestBase.ManyTypes entity, CompiledModelTestBase.Enum8[][] value) => WriteEnum8NestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, CompiledModelTestBase.Enum8[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum8NestedCollection(entity) = value); enum8NestedCollection.SetAccessors( - (InternalEntityEntry entry) => ReadEnum8NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => ReadEnum8NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum8NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum8NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => entry.ReadOriginalValue(enum8NestedCollection, 60), (InternalEntityEntry entry) => entry.GetCurrentValue(enum8NestedCollection), (ValueBuffer valueBuffer) => valueBuffer[60]); @@ -4024,15 +4028,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum8NestedCollection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer(new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v))), keyComparer: new ListOfReferenceTypesComparer(new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -4056,15 +4060,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v)), keyComparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -4086,11 +4090,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerShortTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), providerValueComparer: new ValueComparer( (short v1, short v2) => v1 == v2, @@ -4105,6 +4109,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (CompiledModelTestBase.Enum8 value) => (short)value, (short value) => (CompiledModelTestBase.Enum8)value))))); enum8NestedCollection.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + enum8NestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum8NestedCollection", "TestNamespace") }); var enumToNumberConverterProperty = runtimeEntityType.AddProperty( "EnumToNumberConverterProperty", @@ -4136,11 +4141,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumToNumberConverterProperty.TypeMapping = IntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -4188,28 +4193,28 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumToStringConverterProperty.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (CompiledModelTestBase.Enum32 v) => v.ToString(), + (CompiledModelTestBase.Enum32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum32 v) => v.ToString(), + (CompiledModelTestBase.Enum32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))); enumToStringConverterProperty.SetSentinelFromProviderValue("Default"); enumToStringConverterProperty.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); @@ -4244,11 +4249,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU16.TypeMapping = IntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -4295,15 +4300,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU16Array.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v)), keyComparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -4325,11 +4330,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: IntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -4376,28 +4381,28 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU16AsString.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (CompiledModelTestBase.EnumU16 v) => v.ToString(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU16 v) => v.ToString(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))); enumU16AsString.SetSentinelFromProviderValue("Min"); enumU16AsString.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); @@ -4432,15 +4437,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU16AsStringArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v)), keyComparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -4450,40 +4455,40 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU16 v) => v.ToString(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU16 v) => v.ToString(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))), elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (CompiledModelTestBase.EnumU16 v) => v.ToString(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU16 v) => v.ToString(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))); enumU16AsStringArray.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); enumU16AsStringArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU16AsStringArray", "TestNamespace") }); @@ -4517,15 +4522,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU16AsStringCollection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer, CompiledModelTestBase.EnumU16>(new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v)), keyComparer: new ListOfValueTypesComparer, CompiledModelTestBase.EnumU16>(new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -4535,40 +4540,40 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU16 v) => v.ToString(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.EnumU16>( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU16 v) => v.ToString(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))), elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (CompiledModelTestBase.EnumU16 v) => v.ToString(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU16 v) => v.ToString(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))); enumU16AsStringCollection.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); enumU16AsStringCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU16AsStringCollection", "TestNamespace") }); @@ -4602,15 +4607,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU16Collection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer, CompiledModelTestBase.EnumU16>(new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v)), keyComparer: new ListOfValueTypesComparer, CompiledModelTestBase.EnumU16>(new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -4632,11 +4637,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: IntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -4682,15 +4687,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU32.TypeMapping = SqlServerLongTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), converter: new ValueConverter( (CompiledModelTestBase.EnumU32 value) => (long)value, @@ -4733,15 +4738,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU32Array.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v)), keyComparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -4763,15 +4768,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerLongTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), converter: new ValueConverter( (CompiledModelTestBase.EnumU32 value) => (long)value, @@ -4814,28 +4819,28 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU32AsString.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (CompiledModelTestBase.EnumU32 v) => v.ToString(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU32 v) => v.ToString(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))); enumU32AsString.SetSentinelFromProviderValue("Min"); enumU32AsString.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); @@ -4870,15 +4875,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU32AsStringArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v)), keyComparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -4888,40 +4893,40 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU32 v) => v.ToString(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU32 v) => v.ToString(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))), elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (CompiledModelTestBase.EnumU32 v) => v.ToString(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU32 v) => v.ToString(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))); enumU32AsStringArray.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); enumU32AsStringArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU32AsStringArray", "TestNamespace") }); @@ -4955,15 +4960,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU32AsStringCollection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer, CompiledModelTestBase.EnumU32>(new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v)), keyComparer: new ListOfValueTypesComparer, CompiledModelTestBase.EnumU32>(new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -4973,40 +4978,40 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU32 v) => v.ToString(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.EnumU32>( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU32 v) => v.ToString(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))), elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (CompiledModelTestBase.EnumU32 v) => v.ToString(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU32 v) => v.ToString(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))); enumU32AsStringCollection.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); enumU32AsStringCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU32AsStringCollection", "TestNamespace") }); @@ -5040,15 +5045,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU32Collection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer, CompiledModelTestBase.EnumU32>(new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v)), keyComparer: new ListOfValueTypesComparer, CompiledModelTestBase.EnumU32>(new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -5070,15 +5075,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerLongTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), converter: new ValueConverter( (CompiledModelTestBase.EnumU32 value) => (long)value, @@ -5120,15 +5125,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU64.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), providerValueComparer: new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "decimal(20,0)", @@ -5175,15 +5180,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU64Array.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v)), keyComparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -5205,15 +5210,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerDecimalTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), providerValueComparer: new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "decimal(20,0)", @@ -5260,28 +5265,28 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU64AsString.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (CompiledModelTestBase.EnumU64 v) => v.ToString(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU64 v) => v.ToString(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))); enumU64AsString.SetSentinelFromProviderValue("Min"); enumU64AsString.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); @@ -5316,15 +5321,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU64AsStringArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v)), keyComparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -5334,40 +5339,40 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU64 v) => v.ToString(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU64 v) => v.ToString(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))), elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (CompiledModelTestBase.EnumU64 v) => v.ToString(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU64 v) => v.ToString(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))); enumU64AsStringArray.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); enumU64AsStringArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU64AsStringArray", "TestNamespace") }); @@ -5401,15 +5406,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU64AsStringCollection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer, CompiledModelTestBase.EnumU64>(new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v)), keyComparer: new ListOfValueTypesComparer, CompiledModelTestBase.EnumU64>(new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -5419,40 +5424,40 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU64 v) => v.ToString(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.EnumU64>( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU64 v) => v.ToString(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))), elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (CompiledModelTestBase.EnumU64 v) => v.ToString(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU64 v) => v.ToString(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))); enumU64AsStringCollection.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); enumU64AsStringCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU64AsStringCollection", "TestNamespace") }); @@ -5486,15 +5491,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU64Collection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer, CompiledModelTestBase.EnumU64>(new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v)), keyComparer: new ListOfValueTypesComparer, CompiledModelTestBase.EnumU64>(new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -5516,15 +5521,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerDecimalTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), providerValueComparer: new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "decimal(20,0)", @@ -5547,17 +5552,17 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("EnumU64NestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); enumU64NestedCollection.SetGetter( - (CompiledModelTestBase.ManyTypes entity) => ReadEnumU64NestedCollection(entity), - (CompiledModelTestBase.ManyTypes entity) => ReadEnumU64NestedCollection(entity) == null, - (CompiledModelTestBase.ManyTypes instance) => ReadEnumU64NestedCollection(instance), - (CompiledModelTestBase.ManyTypes instance) => ReadEnumU64NestedCollection(instance) == null); + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU64NestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU64NestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU64NestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU64NestedCollection(instance) == null); enumU64NestedCollection.SetSetter( - (CompiledModelTestBase.ManyTypes entity, CompiledModelTestBase.EnumU64[][] value) => WriteEnumU64NestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, CompiledModelTestBase.EnumU64[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU64NestedCollection(entity) = value); enumU64NestedCollection.SetMaterializationSetter( - (CompiledModelTestBase.ManyTypes entity, CompiledModelTestBase.EnumU64[][] value) => WriteEnumU64NestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, CompiledModelTestBase.EnumU64[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU64NestedCollection(entity) = value); enumU64NestedCollection.SetAccessors( - (InternalEntityEntry entry) => ReadEnumU64NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => ReadEnumU64NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU64NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU64NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => entry.ReadOriginalValue(enumU64NestedCollection, 81), (InternalEntityEntry entry) => entry.GetCurrentValue(enumU64NestedCollection), (ValueBuffer valueBuffer) => valueBuffer[81]); @@ -5570,15 +5575,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU64NestedCollection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer(new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v))), keyComparer: new ListOfReferenceTypesComparer(new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -5602,15 +5607,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v)), keyComparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -5632,15 +5637,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerDecimalTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), providerValueComparer: new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "decimal(20,0)", @@ -5655,6 +5660,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (CompiledModelTestBase.EnumU64 value) => (decimal)(long)value, (decimal value) => (CompiledModelTestBase.EnumU64)(long)value))))); enumU64NestedCollection.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + enumU64NestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU64NestedCollection", "TestNamespace") }); var enumU8 = runtimeEntityType.AddProperty( "EnumU8", @@ -5685,11 +5691,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU8.TypeMapping = SqlServerByteTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v), providerValueComparer: new ValueComparer( (byte v1, byte v2) => v1 == v2, @@ -5736,15 +5742,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU8Array.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v)), keyComparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -5766,11 +5772,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerByteTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v), providerValueComparer: new ValueComparer( (byte v1, byte v2) => v1 == v2, @@ -5817,28 +5823,28 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU8AsString.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (CompiledModelTestBase.EnumU8 v) => v.ToString(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU8 v) => v.ToString(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))); enumU8AsString.SetSentinelFromProviderValue("Min"); enumU8AsString.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); @@ -5873,15 +5879,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU8AsStringArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v)), keyComparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -5891,40 +5897,40 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU8 v) => v.ToString(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU8 v) => v.ToString(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))), elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (CompiledModelTestBase.EnumU8 v) => v.ToString(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU8 v) => v.ToString(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))); enumU8AsStringArray.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); enumU8AsStringArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU8AsStringArray", "TestNamespace") }); @@ -5958,15 +5964,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU8AsStringCollection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer, CompiledModelTestBase.EnumU8>(new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v)), keyComparer: new ListOfValueTypesComparer, CompiledModelTestBase.EnumU8>(new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -5976,40 +5982,40 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU8 v) => v.ToString(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.EnumU8>( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU8 v) => v.ToString(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))), elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (CompiledModelTestBase.EnumU8 v) => v.ToString(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU8 v) => v.ToString(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))); enumU8AsStringCollection.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); enumU8AsStringCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU8AsStringCollection", "TestNamespace") }); @@ -6043,15 +6049,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU8Collection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer, CompiledModelTestBase.EnumU8>(new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v)), keyComparer: new ListOfValueTypesComparer, CompiledModelTestBase.EnumU8>(new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -6073,11 +6079,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerByteTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v), providerValueComparer: new ValueComparer( (byte v1, byte v2) => v1 == v2, @@ -6124,15 +6130,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas @float.TypeMapping = SqlServerFloatTypeMapping.Default.Clone( comparer: new ValueComparer( (float v1, float v2) => v1.Equals(v2), - (float v) => v.GetHashCode(), + (float v) => ((object)v).GetHashCode(), (float v) => v), keyComparer: new ValueComparer( (float v1, float v2) => v1.Equals(v2), - (float v) => v.GetHashCode(), + (float v) => ((object)v).GetHashCode(), (float v) => v), providerValueComparer: new ValueComparer( (float v1, float v2) => v1.Equals(v2), - (float v) => v.GetHashCode(), + (float v) => ((object)v).GetHashCode(), (float v) => v)); @float.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); @float.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Float", "TestNamespace") }); @@ -6166,15 +6172,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas floatArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer(new ValueComparer( (float v1, float v2) => v1.Equals(v2), - (float v) => v.GetHashCode(), + (float v) => ((object)v).GetHashCode(), (float v) => v)), keyComparer: new ListOfValueTypesComparer(new ValueComparer( (float v1, float v2) => v1.Equals(v2), - (float v) => v.GetHashCode(), + (float v) => ((object)v).GetHashCode(), (float v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -6188,15 +6194,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerFloatTypeMapping.Default.Clone( comparer: new ValueComparer( (float v1, float v2) => v1.Equals(v2), - (float v) => v.GetHashCode(), + (float v) => ((object)v).GetHashCode(), (float v) => v), keyComparer: new ValueComparer( (float v1, float v2) => v1.Equals(v2), - (float v) => v.GetHashCode(), + (float v) => ((object)v).GetHashCode(), (float v) => v), providerValueComparer: new ValueComparer( (float v1, float v2) => v1.Equals(v2), - (float v) => v.GetHashCode(), + (float v) => ((object)v).GetHashCode(), (float v) => v))); floatArray.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); floatArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_FloatArray", "TestNamespace") }); @@ -6231,15 +6237,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas guid.TypeMapping = GuidTypeMapping.Default.Clone( comparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), keyComparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), providerValueComparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "uniqueidentifier")); @@ -6275,15 +6281,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas guidArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer(new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v)), keyComparer: new ListOfValueTypesComparer(new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -6297,15 +6303,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: GuidTypeMapping.Default.Clone( comparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), keyComparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), providerValueComparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "uniqueidentifier"))); @@ -6318,17 +6324,17 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("GuidNestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); guidNestedCollection.SetGetter( - (CompiledModelTestBase.ManyTypes entity) => ReadGuidNestedCollection(entity), - (CompiledModelTestBase.ManyTypes entity) => ReadGuidNestedCollection(entity) == null, - (CompiledModelTestBase.ManyTypes instance) => ReadGuidNestedCollection(instance), - (CompiledModelTestBase.ManyTypes instance) => ReadGuidNestedCollection(instance) == null); + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_GuidNestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_GuidNestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_GuidNestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_GuidNestedCollection(instance) == null); guidNestedCollection.SetSetter( - (CompiledModelTestBase.ManyTypes entity, ICollection value) => WriteGuidNestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, ICollection value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_GuidNestedCollection(entity) = value); guidNestedCollection.SetMaterializationSetter( - (CompiledModelTestBase.ManyTypes entity, ICollection value) => WriteGuidNestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, ICollection value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_GuidNestedCollection(entity) = value); guidNestedCollection.SetAccessors( - (InternalEntityEntry entry) => ReadGuidNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => ReadGuidNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_GuidNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_GuidNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => entry.ReadOriginalValue>(guidNestedCollection, 92), (InternalEntityEntry entry) => entry.GetCurrentValue>(guidNestedCollection), (ValueBuffer valueBuffer) => valueBuffer[92]); @@ -6341,15 +6347,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas guidNestedCollection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer, Guid[][]>(new ListOfReferenceTypesComparer(new ListOfValueTypesComparer(new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v)))), keyComparer: new ListOfReferenceTypesComparer, Guid[][]>(new ListOfReferenceTypesComparer(new ListOfValueTypesComparer(new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v)))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -6367,15 +6373,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer(new ListOfValueTypesComparer(new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v))), keyComparer: new ListOfReferenceTypesComparer(new ListOfValueTypesComparer(new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -6391,15 +6397,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer(new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v)), keyComparer: new ListOfValueTypesComparer(new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -6413,19 +6419,20 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: GuidTypeMapping.Default.Clone( comparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), keyComparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), providerValueComparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "uniqueidentifier"))))); guidNestedCollection.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + guidNestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_GuidNestedCollection", "TestNamespace") }); var guidToBytesConverterProperty = runtimeEntityType.AddProperty( "GuidToBytesConverterProperty", @@ -6457,11 +6464,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas guidToBytesConverterProperty.TypeMapping = SqlServerByteArrayTypeMapping.Default.Clone( comparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), keyComparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), providerValueComparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), @@ -6512,15 +6519,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas guidToStringConverterProperty.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), keyComparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(36)", @@ -6568,15 +6575,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas iPAddress.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), keyComparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(45)", @@ -6584,12 +6591,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)))); iPAddress.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); iPAddress.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_IPAddress", "TestNamespace") }); @@ -6623,15 +6630,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas iPAddressArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -6641,27 +6648,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)))), elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), keyComparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(45)", @@ -6669,12 +6676,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))); iPAddressArray.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); iPAddressArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_IPAddressArray", "TestNamespace") }); @@ -6709,11 +6716,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas iPAddressToBytesConverterProperty.TypeMapping = SqlServerByteArrayTypeMapping.Default.Clone( comparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), keyComparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), providerValueComparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), @@ -6763,15 +6770,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas iPAddressToStringConverterProperty.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), keyComparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(45)", @@ -6779,12 +6786,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)))); iPAddressToStringConverterProperty.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); iPAddressToStringConverterProperty.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_IPAddressToStringConverterProperty", "TestNamespace") }); @@ -6869,7 +6876,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (short v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -6976,7 +6983,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (int v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -7009,17 +7016,17 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("Int32NestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); int32NestedCollection.SetGetter( - (CompiledModelTestBase.ManyTypes entity) => ReadInt32NestedCollection(entity), - (CompiledModelTestBase.ManyTypes entity) => ReadInt32NestedCollection(entity) == null, - (CompiledModelTestBase.ManyTypes instance) => ReadInt32NestedCollection(instance), - (CompiledModelTestBase.ManyTypes instance) => ReadInt32NestedCollection(instance) == null); + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int32NestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int32NestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int32NestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int32NestedCollection(instance) == null); int32NestedCollection.SetSetter( - (CompiledModelTestBase.ManyTypes entity, int[][] value) => WriteInt32NestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, int[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int32NestedCollection(entity) = value); int32NestedCollection.SetMaterializationSetter( - (CompiledModelTestBase.ManyTypes entity, int[][] value) => WriteInt32NestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, int[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int32NestedCollection(entity) = value); int32NestedCollection.SetAccessors( - (InternalEntityEntry entry) => ReadInt32NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => ReadInt32NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int32NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int32NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => entry.ReadOriginalValue(int32NestedCollection, 103), (InternalEntityEntry entry) => entry.GetCurrentValue(int32NestedCollection), (ValueBuffer valueBuffer) => valueBuffer[103]); @@ -7040,7 +7047,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (int v) => v))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -7064,7 +7071,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (int v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -7089,6 +7096,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (int v) => v, (int v) => v)))); int32NestedCollection.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + int32NestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int32NestedCollection", "TestNamespace") }); var int64 = runtimeEntityType.AddProperty( "Int64", @@ -7120,15 +7128,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas int64.TypeMapping = SqlServerLongTypeMapping.Default.Clone( comparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), keyComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v)); int64.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); int64.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int64", "TestNamespace") }); @@ -7162,15 +7170,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas int64Array.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer(new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v)), keyComparer: new ListOfValueTypesComparer(new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -7184,15 +7192,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerLongTypeMapping.Default.Clone( comparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), keyComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v))); int64Array.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); int64Array.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int64Array", "TestNamespace") }); @@ -7203,17 +7211,17 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("Int64NestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); int64NestedCollection.SetGetter( - (CompiledModelTestBase.ManyTypes entity) => ReadInt64NestedCollection(entity), - (CompiledModelTestBase.ManyTypes entity) => ReadInt64NestedCollection(entity) == null, - (CompiledModelTestBase.ManyTypes instance) => ReadInt64NestedCollection(instance), - (CompiledModelTestBase.ManyTypes instance) => ReadInt64NestedCollection(instance) == null); + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int64NestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int64NestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int64NestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int64NestedCollection(instance) == null); int64NestedCollection.SetSetter( - (CompiledModelTestBase.ManyTypes entity, IList[] value) => WriteInt64NestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, IList[] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int64NestedCollection(entity) = value); int64NestedCollection.SetMaterializationSetter( - (CompiledModelTestBase.ManyTypes entity, IList[] value) => WriteInt64NestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, IList[] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int64NestedCollection(entity) = value); int64NestedCollection.SetAccessors( - (InternalEntityEntry entry) => ReadInt64NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => ReadInt64NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int64NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int64NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(int64NestedCollection, 106), (InternalEntityEntry entry) => entry.GetCurrentValue[]>(int64NestedCollection), (ValueBuffer valueBuffer) => valueBuffer[106]); @@ -7226,15 +7234,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas int64NestedCollection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer[], IList>(new ListOfReferenceTypesComparer, long[]>(new ListOfValueTypesComparer(new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v)))), keyComparer: new ListOfReferenceTypesComparer[], IList>(new ListOfReferenceTypesComparer, long[]>(new ListOfValueTypesComparer(new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v)))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -7252,15 +7260,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer, long[]>(new ListOfValueTypesComparer(new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v))), keyComparer: new ListOfReferenceTypesComparer, long[]>(new ListOfValueTypesComparer(new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -7276,15 +7284,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer(new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v)), keyComparer: new ListOfValueTypesComparer(new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -7298,17 +7306,18 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerLongTypeMapping.Default.Clone( comparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), keyComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v))))); int64NestedCollection.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + int64NestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int64NestedCollection", "TestNamespace") }); var int8 = runtimeEntityType.AddProperty( "Int8", @@ -7398,7 +7407,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (sbyte v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -7447,17 +7456,17 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("Int8NestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); int8NestedCollection.SetGetter( - (CompiledModelTestBase.ManyTypes entity) => ReadInt8NestedCollection(entity), - (CompiledModelTestBase.ManyTypes entity) => ReadInt8NestedCollection(entity) == null, - (CompiledModelTestBase.ManyTypes instance) => ReadInt8NestedCollection(instance), - (CompiledModelTestBase.ManyTypes instance) => ReadInt8NestedCollection(instance) == null); + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int8NestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int8NestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int8NestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int8NestedCollection(instance) == null); int8NestedCollection.SetSetter( - (CompiledModelTestBase.ManyTypes entity, sbyte[][][] value) => WriteInt8NestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, sbyte[][][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int8NestedCollection(entity) = value); int8NestedCollection.SetMaterializationSetter( - (CompiledModelTestBase.ManyTypes entity, sbyte[][][] value) => WriteInt8NestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, sbyte[][][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int8NestedCollection(entity) = value); int8NestedCollection.SetAccessors( - (InternalEntityEntry entry) => ReadInt8NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => ReadInt8NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int8NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int8NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => entry.ReadOriginalValue(int8NestedCollection, 109), (InternalEntityEntry entry) => entry.GetCurrentValue(int8NestedCollection), (ValueBuffer valueBuffer) => valueBuffer[109]); @@ -7478,7 +7487,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (sbyte v) => v)))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -7512,7 +7521,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (sbyte v) => v))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -7544,7 +7553,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (sbyte v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -7585,6 +7594,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (sbyte v) => (short)v, (short v) => (sbyte)v)))))); int8NestedCollection.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + int8NestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int8NestedCollection", "TestNamespace") }); var intNumberToBytesConverterProperty = runtimeEntityType.AddProperty( "IntNumberToBytesConverterProperty", @@ -7679,7 +7689,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (int v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(64)", @@ -7737,21 +7747,21 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (Nullable v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (Nullable v) => v == null ? null : v.ToString(), + (Nullable v) => v == null ? null : ((object)v).ToString(), (string v) => v == null || v == "" ? null : (Nullable)int.Parse(v), convertsNulls: true), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (Nullable v) => v == null ? null : v.ToString(), + (Nullable v) => v == null ? null : ((object)v).ToString(), (string v) => v == null || v == "" ? null : (Nullable)int.Parse(v), convertsNulls: true))); nullIntToNullStringConverterProperty.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); @@ -7787,15 +7797,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableBool.TypeMapping = SqlServerBoolTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (bool)v1 == (bool)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((bool)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(bool)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(bool)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (bool)v1 == (bool)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((bool)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(bool)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(bool)v : default(Nullable)), providerValueComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (bool)v1 == (bool)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((bool)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(bool)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(bool)v : default(Nullable))); nullableBool.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); nullableBool.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableBool", "TestNamespace") }); @@ -7829,15 +7839,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableBoolArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (bool)v1 == (bool)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((bool)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(bool)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(bool)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (bool)v1 == (bool)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((bool)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(bool)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(bool)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -7851,15 +7861,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerBoolTypeMapping.Default.Clone( comparer: new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v), keyComparer: new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v), providerValueComparer: new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v))); nullableBoolArray.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); nullableBoolArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableBoolArray", "TestNamespace") }); @@ -7894,7 +7904,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableBytes.TypeMapping = SqlServerByteArrayTypeMapping.Default.Clone( comparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), - (byte[] v) => v.GetHashCode(), + (byte[] v) => ((object)v).GetHashCode(), (byte[] v) => v), keyComparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), @@ -7939,15 +7949,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableBytesArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer(new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), - (byte[] v) => v.GetHashCode(), + (byte[] v) => ((object)v).GetHashCode(), (byte[] v) => v)), keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), - (byte[] v) => v.GetHashCode(), + (byte[] v) => ((object)v).GetHashCode(), (byte[] v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -7961,7 +7971,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerByteArrayTypeMapping.Default.Clone( comparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), - (byte[] v) => v.GetHashCode(), + (byte[] v) => ((object)v).GetHashCode(), (byte[] v) => v), keyComparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), @@ -7983,17 +7993,17 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("NullableBytesNestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); nullableBytesNestedCollection.SetGetter( - (CompiledModelTestBase.ManyTypes entity) => ReadNullableBytesNestedCollection(entity), - (CompiledModelTestBase.ManyTypes entity) => ReadNullableBytesNestedCollection(entity) == null, - (CompiledModelTestBase.ManyTypes instance) => ReadNullableBytesNestedCollection(instance), - (CompiledModelTestBase.ManyTypes instance) => ReadNullableBytesNestedCollection(instance) == null); + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableBytesNestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableBytesNestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableBytesNestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableBytesNestedCollection(instance) == null); nullableBytesNestedCollection.SetSetter( - (CompiledModelTestBase.ManyTypes entity, byte[][][] value) => WriteNullableBytesNestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, byte[][][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableBytesNestedCollection(entity) = value); nullableBytesNestedCollection.SetMaterializationSetter( - (CompiledModelTestBase.ManyTypes entity, byte[][][] value) => WriteNullableBytesNestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, byte[][][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableBytesNestedCollection(entity) = value); nullableBytesNestedCollection.SetAccessors( - (InternalEntityEntry entry) => ReadNullableBytesNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => ReadNullableBytesNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableBytesNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableBytesNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => entry.ReadOriginalValue(nullableBytesNestedCollection, 117), (InternalEntityEntry entry) => entry.GetCurrentValue(nullableBytesNestedCollection), (ValueBuffer valueBuffer) => valueBuffer[117]); @@ -8006,15 +8016,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableBytesNestedCollection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer(new ListOfReferenceTypesComparer(new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), - (byte[] v) => v.GetHashCode(), + (byte[] v) => ((object)v).GetHashCode(), (byte[] v) => v))), keyComparer: new ListOfReferenceTypesComparer(new ListOfReferenceTypesComparer(new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), - (byte[] v) => v.GetHashCode(), + (byte[] v) => ((object)v).GetHashCode(), (byte[] v) => v))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -8030,15 +8040,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer(new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), - (byte[] v) => v.GetHashCode(), + (byte[] v) => ((object)v).GetHashCode(), (byte[] v) => v)), keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), - (byte[] v) => v.GetHashCode(), + (byte[] v) => ((object)v).GetHashCode(), (byte[] v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -8052,7 +8062,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerByteArrayTypeMapping.Default.Clone( comparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), - (byte[] v) => v.GetHashCode(), + (byte[] v) => ((object)v).GetHashCode(), (byte[] v) => v), keyComparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), @@ -8066,6 +8076,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas storeTypeName: "varbinary(max)"), storeTypePostfix: StoreTypePostfix.None))); nullableBytesNestedCollection.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + nullableBytesNestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableBytesNestedCollection", "TestNamespace") }); var nullableChar = runtimeEntityType.AddProperty( "NullableChar", @@ -8105,7 +8116,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (Nullable v) => v.HasValue ? (Nullable)(char)v : default(Nullable)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(1)", @@ -8160,7 +8171,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (Nullable v) => v.HasValue ? (Nullable)(char)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -8190,7 +8201,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (char v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(1)", @@ -8238,15 +8249,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableDateOnly.TypeMapping = SqlServerDateOnlyTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateOnly)v1 == (DateOnly)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((DateOnly)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(DateOnly)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(DateOnly)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateOnly)v1 == (DateOnly)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((DateOnly)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(DateOnly)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(DateOnly)v : default(Nullable)), providerValueComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateOnly)v1 == (DateOnly)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((DateOnly)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(DateOnly)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(DateOnly)v : default(Nullable))); nullableDateOnly.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); nullableDateOnly.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableDateOnly", "TestNamespace") }); @@ -8280,15 +8291,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableDateOnlyArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateOnly)v1 == (DateOnly)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((DateOnly)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(DateOnly)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(DateOnly)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateOnly)v1 == (DateOnly)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((DateOnly)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(DateOnly)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(DateOnly)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -8302,15 +8313,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerDateOnlyTypeMapping.Default.Clone( comparer: new ValueComparer( (DateOnly v1, DateOnly v2) => v1.Equals(v2), - (DateOnly v) => v.GetHashCode(), + (DateOnly v) => ((object)v).GetHashCode(), (DateOnly v) => v), keyComparer: new ValueComparer( (DateOnly v1, DateOnly v2) => v1.Equals(v2), - (DateOnly v) => v.GetHashCode(), + (DateOnly v) => ((object)v).GetHashCode(), (DateOnly v) => v), providerValueComparer: new ValueComparer( (DateOnly v1, DateOnly v2) => v1.Equals(v2), - (DateOnly v) => v.GetHashCode(), + (DateOnly v) => ((object)v).GetHashCode(), (DateOnly v) => v))); nullableDateOnlyArray.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); nullableDateOnlyArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableDateOnlyArray", "TestNamespace") }); @@ -8345,15 +8356,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableDateTime.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(DateTime)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(DateTime)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable)), providerValueComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(DateTime)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable))); nullableDateTime.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); nullableDateTime.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableDateTime", "TestNamespace") }); @@ -8387,15 +8398,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableDateTimeArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(DateTime)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(DateTime)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -8409,15 +8420,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerDateTimeTypeMapping.Default.Clone( comparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v), keyComparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v), providerValueComparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v))); nullableDateTimeArray.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); nullableDateTimeArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableDateTimeArray", "TestNamespace") }); @@ -8452,15 +8463,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableDecimal.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(decimal)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(decimal)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable)), providerValueComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(decimal)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable))); nullableDecimal.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); nullableDecimal.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableDecimal", "TestNamespace") }); @@ -8494,15 +8505,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableDecimalArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(decimal)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(decimal)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -8516,15 +8527,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerDecimalTypeMapping.Default.Clone( comparer: new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v), keyComparer: new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v), providerValueComparer: new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v))); nullableDecimalArray.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); nullableDecimalArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableDecimalArray", "TestNamespace") }); @@ -8559,15 +8570,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableDouble.TypeMapping = SqlServerDoubleTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && ((double)v1).Equals((double)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((double)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(double)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(double)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && ((double)v1).Equals((double)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((double)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(double)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(double)v : default(Nullable)), providerValueComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && ((double)v1).Equals((double)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((double)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(double)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(double)v : default(Nullable))); nullableDouble.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); nullableDouble.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableDouble", "TestNamespace") }); @@ -8601,15 +8612,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableDoubleArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && ((double)v1).Equals((double)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((double)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(double)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(double)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && ((double)v1).Equals((double)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((double)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(double)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(double)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -8623,15 +8634,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerDoubleTypeMapping.Default.Clone( comparer: new ValueComparer( (double v1, double v2) => v1.Equals(v2), - (double v) => v.GetHashCode(), + (double v) => ((object)v).GetHashCode(), (double v) => v), keyComparer: new ValueComparer( (double v1, double v2) => v1.Equals(v2), - (double v) => v.GetHashCode(), + (double v) => ((object)v).GetHashCode(), (double v) => v), providerValueComparer: new ValueComparer( (double v1, double v2) => v1.Equals(v2), - (double v) => v.GetHashCode(), + (double v) => ((object)v).GetHashCode(), (double v) => v))); nullableDoubleArray.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); nullableDoubleArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableDoubleArray", "TestNamespace") }); @@ -8666,11 +8677,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum16.TypeMapping = SqlServerShortTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum16)v1, (object)(CompiledModelTestBase.Enum16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum16)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum16)v1, (object)(CompiledModelTestBase.Enum16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum16)v : default(Nullable)), providerValueComparer: new ValueComparer( (short v1, short v2) => v1 == v2, @@ -8716,15 +8727,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum16Array.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum16)v1, (object)(CompiledModelTestBase.Enum16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum16)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum16)v1, (object)(CompiledModelTestBase.Enum16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum16)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -8746,11 +8757,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerShortTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v), providerValueComparer: new ValueComparer( (short v1, short v2) => v1 == v2, @@ -8797,11 +8808,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum16AsString.TypeMapping = SqlServerShortTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum16)v1, (object)(CompiledModelTestBase.Enum16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum16)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum16)v1, (object)(CompiledModelTestBase.Enum16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum16)v : default(Nullable)), providerValueComparer: new ValueComparer( (short v1, short v2) => v1 == v2, @@ -8847,15 +8858,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum16AsStringArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum16)v1, (object)(CompiledModelTestBase.Enum16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum16)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum16)v1, (object)(CompiledModelTestBase.Enum16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum16)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -8877,11 +8888,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerShortTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v), providerValueComparer: new ValueComparer( (short v1, short v2) => v1 == v2, @@ -8927,15 +8938,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum16AsStringCollection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.Enum16>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum16)v1, (object)(CompiledModelTestBase.Enum16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum16)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.Enum16>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum16)v1, (object)(CompiledModelTestBase.Enum16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum16)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -8957,11 +8968,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerShortTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v), providerValueComparer: new ValueComparer( (short v1, short v2) => v1 == v2, @@ -9007,15 +9018,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum16Collection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.Enum16>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum16)v1, (object)(CompiledModelTestBase.Enum16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum16)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.Enum16>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum16)v1, (object)(CompiledModelTestBase.Enum16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum16)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -9037,11 +9048,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerShortTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v), providerValueComparer: new ValueComparer( (short v1, short v2) => v1 == v2, @@ -9088,11 +9099,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum32.TypeMapping = IntTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum32)v1, (object)(CompiledModelTestBase.Enum32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum32)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum32)v1, (object)(CompiledModelTestBase.Enum32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum32)v : default(Nullable)), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -9138,15 +9149,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum32Array.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum32)v1, (object)(CompiledModelTestBase.Enum32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum32)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum32)v1, (object)(CompiledModelTestBase.Enum32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum32)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -9168,11 +9179,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: IntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -9219,11 +9230,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum32AsString.TypeMapping = IntTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum32)v1, (object)(CompiledModelTestBase.Enum32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum32)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum32)v1, (object)(CompiledModelTestBase.Enum32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum32)v : default(Nullable)), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -9269,15 +9280,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum32AsStringArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum32)v1, (object)(CompiledModelTestBase.Enum32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum32)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum32)v1, (object)(CompiledModelTestBase.Enum32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum32)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -9299,11 +9310,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: IntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -9349,15 +9360,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum32AsStringCollection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.Enum32>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum32)v1, (object)(CompiledModelTestBase.Enum32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum32)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.Enum32>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum32)v1, (object)(CompiledModelTestBase.Enum32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum32)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -9379,11 +9390,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: IntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -9429,15 +9440,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum32Collection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.Enum32>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum32)v1, (object)(CompiledModelTestBase.Enum32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum32)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.Enum32>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum32)v1, (object)(CompiledModelTestBase.Enum32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum32)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -9459,11 +9470,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: IntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -9486,17 +9497,17 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("NullableEnum32NestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); nullableEnum32NestedCollection.SetGetter( - (CompiledModelTestBase.ManyTypes entity) => ReadNullableEnum32NestedCollection(entity), - (CompiledModelTestBase.ManyTypes entity) => ReadNullableEnum32NestedCollection(entity) == null, - (CompiledModelTestBase.ManyTypes instance) => ReadNullableEnum32NestedCollection(instance), - (CompiledModelTestBase.ManyTypes instance) => ReadNullableEnum32NestedCollection(instance) == null); + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum32NestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum32NestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum32NestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum32NestedCollection(instance) == null); nullableEnum32NestedCollection.SetSetter( - (CompiledModelTestBase.ManyTypes entity, Nullable[][][] value) => WriteNullableEnum32NestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, Nullable[][][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum32NestedCollection(entity) = value); nullableEnum32NestedCollection.SetMaterializationSetter( - (CompiledModelTestBase.ManyTypes entity, Nullable[][][] value) => WriteNullableEnum32NestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, Nullable[][][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum32NestedCollection(entity) = value); nullableEnum32NestedCollection.SetAccessors( - (InternalEntityEntry entry) => ReadNullableEnum32NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => ReadNullableEnum32NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum32NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum32NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => entry.ReadOriginalValue[][][]>(nullableEnum32NestedCollection, 140), (InternalEntityEntry entry) => entry.GetCurrentValue[][][]>(nullableEnum32NestedCollection), (ValueBuffer valueBuffer) => valueBuffer[140]); @@ -9509,15 +9520,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum32NestedCollection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer(new ListOfReferenceTypesComparer(new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum32)v1, (object)(CompiledModelTestBase.Enum32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum32)v : default(Nullable))))), keyComparer: new ListOfReferenceTypesComparer(new ListOfReferenceTypesComparer(new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum32)v1, (object)(CompiledModelTestBase.Enum32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum32)v : default(Nullable))))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -9543,15 +9554,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer(new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum32)v1, (object)(CompiledModelTestBase.Enum32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum32)v : default(Nullable)))), keyComparer: new ListOfReferenceTypesComparer(new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum32)v1, (object)(CompiledModelTestBase.Enum32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum32)v : default(Nullable)))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -9575,15 +9586,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum32)v1, (object)(CompiledModelTestBase.Enum32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum32)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum32)v1, (object)(CompiledModelTestBase.Enum32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum32)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -9605,11 +9616,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: IntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -9624,6 +9635,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (CompiledModelTestBase.Enum32 value) => (int)value, (int value) => (CompiledModelTestBase.Enum32)value)))))); nullableEnum32NestedCollection.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + nullableEnum32NestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum32NestedCollection", "TestNamespace") }); var nullableEnum64 = runtimeEntityType.AddProperty( "NullableEnum64", @@ -9655,15 +9667,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum64.TypeMapping = SqlServerLongTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum64)v1, (object)(CompiledModelTestBase.Enum64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum64)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum64)v1, (object)(CompiledModelTestBase.Enum64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum64)v : default(Nullable)), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), converter: new ValueConverter( (CompiledModelTestBase.Enum64 value) => (long)value, @@ -9705,15 +9717,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum64Array.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum64)v1, (object)(CompiledModelTestBase.Enum64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum64)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum64)v1, (object)(CompiledModelTestBase.Enum64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum64)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -9735,15 +9747,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerLongTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), converter: new ValueConverter( (CompiledModelTestBase.Enum64 value) => (long)value, @@ -9786,15 +9798,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum64AsString.TypeMapping = SqlServerLongTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum64)v1, (object)(CompiledModelTestBase.Enum64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum64)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum64)v1, (object)(CompiledModelTestBase.Enum64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum64)v : default(Nullable)), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), converter: new ValueConverter( (CompiledModelTestBase.Enum64 value) => (long)value, @@ -9836,15 +9848,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum64AsStringArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum64)v1, (object)(CompiledModelTestBase.Enum64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum64)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum64)v1, (object)(CompiledModelTestBase.Enum64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum64)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -9866,15 +9878,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerLongTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), converter: new ValueConverter( (CompiledModelTestBase.Enum64 value) => (long)value, @@ -9916,15 +9928,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum64AsStringCollection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.Enum64>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum64)v1, (object)(CompiledModelTestBase.Enum64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum64)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.Enum64>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum64)v1, (object)(CompiledModelTestBase.Enum64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum64)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -9946,15 +9958,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerLongTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), converter: new ValueConverter( (CompiledModelTestBase.Enum64 value) => (long)value, @@ -9996,15 +10008,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum64Collection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.Enum64>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum64)v1, (object)(CompiledModelTestBase.Enum64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum64)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.Enum64>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum64)v1, (object)(CompiledModelTestBase.Enum64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum64)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -10026,15 +10038,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerLongTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), converter: new ValueConverter( (CompiledModelTestBase.Enum64 value) => (long)value, @@ -10077,11 +10089,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum8.TypeMapping = SqlServerShortTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum8)v1, (object)(CompiledModelTestBase.Enum8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum8)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum8)v1, (object)(CompiledModelTestBase.Enum8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum8)v : default(Nullable)), providerValueComparer: new ValueComparer( (short v1, short v2) => v1 == v2, @@ -10127,15 +10139,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum8Array.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum8)v1, (object)(CompiledModelTestBase.Enum8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum8)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum8)v1, (object)(CompiledModelTestBase.Enum8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum8)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -10157,11 +10169,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerShortTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), providerValueComparer: new ValueComparer( (short v1, short v2) => v1 == v2, @@ -10208,11 +10220,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum8AsString.TypeMapping = SqlServerShortTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum8)v1, (object)(CompiledModelTestBase.Enum8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum8)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum8)v1, (object)(CompiledModelTestBase.Enum8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum8)v : default(Nullable)), providerValueComparer: new ValueComparer( (short v1, short v2) => v1 == v2, @@ -10258,15 +10270,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum8AsStringArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum8)v1, (object)(CompiledModelTestBase.Enum8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum8)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum8)v1, (object)(CompiledModelTestBase.Enum8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum8)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -10288,11 +10300,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerShortTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), providerValueComparer: new ValueComparer( (short v1, short v2) => v1 == v2, @@ -10338,15 +10350,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum8AsStringCollection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.Enum8>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum8)v1, (object)(CompiledModelTestBase.Enum8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum8)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.Enum8>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum8)v1, (object)(CompiledModelTestBase.Enum8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum8)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -10368,11 +10380,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerShortTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), providerValueComparer: new ValueComparer( (short v1, short v2) => v1 == v2, @@ -10418,15 +10430,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum8Collection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.Enum8>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum8)v1, (object)(CompiledModelTestBase.Enum8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum8)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.Enum8>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum8)v1, (object)(CompiledModelTestBase.Enum8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum8)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -10448,11 +10460,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerShortTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), providerValueComparer: new ValueComparer( (short v1, short v2) => v1 == v2, @@ -10475,17 +10487,17 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("NullableEnum8NestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); nullableEnum8NestedCollection.SetGetter( - (CompiledModelTestBase.ManyTypes entity) => ReadNullableEnum8NestedCollection(entity), - (CompiledModelTestBase.ManyTypes entity) => ReadNullableEnum8NestedCollection(entity) == null, - (CompiledModelTestBase.ManyTypes instance) => ReadNullableEnum8NestedCollection(instance), - (CompiledModelTestBase.ManyTypes instance) => ReadNullableEnum8NestedCollection(instance) == null); + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum8NestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum8NestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum8NestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum8NestedCollection(instance) == null); nullableEnum8NestedCollection.SetSetter( - (CompiledModelTestBase.ManyTypes entity, Nullable[][] value) => WriteNullableEnum8NestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, Nullable[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum8NestedCollection(entity) = value); nullableEnum8NestedCollection.SetMaterializationSetter( - (CompiledModelTestBase.ManyTypes entity, Nullable[][] value) => WriteNullableEnum8NestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, Nullable[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum8NestedCollection(entity) = value); nullableEnum8NestedCollection.SetAccessors( - (InternalEntityEntry entry) => ReadNullableEnum8NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => ReadNullableEnum8NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum8NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum8NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => entry.ReadOriginalValue[][]>(nullableEnum8NestedCollection, 153), (InternalEntityEntry entry) => entry.GetCurrentValue[][]>(nullableEnum8NestedCollection), (ValueBuffer valueBuffer) => valueBuffer[153]); @@ -10498,15 +10510,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum8NestedCollection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer(new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum8)v1, (object)(CompiledModelTestBase.Enum8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum8)v : default(Nullable)))), keyComparer: new ListOfReferenceTypesComparer(new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum8)v1, (object)(CompiledModelTestBase.Enum8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum8)v : default(Nullable)))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -10530,15 +10542,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum8)v1, (object)(CompiledModelTestBase.Enum8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum8)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum8)v1, (object)(CompiledModelTestBase.Enum8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum8)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -10560,11 +10572,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerShortTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), providerValueComparer: new ValueComparer( (short v1, short v2) => v1 == v2, @@ -10579,6 +10591,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (CompiledModelTestBase.Enum8 value) => (short)value, (short value) => (CompiledModelTestBase.Enum8)value))))); nullableEnum8NestedCollection.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + nullableEnum8NestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum8NestedCollection", "TestNamespace") }); var nullableEnumU16 = runtimeEntityType.AddProperty( "NullableEnumU16", @@ -10610,11 +10623,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU16.TypeMapping = IntTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU16)v1, (object)(CompiledModelTestBase.EnumU16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU16)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU16)v1, (object)(CompiledModelTestBase.EnumU16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU16)v : default(Nullable)), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -10660,15 +10673,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU16Array.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU16)v1, (object)(CompiledModelTestBase.EnumU16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU16)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU16)v1, (object)(CompiledModelTestBase.EnumU16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU16)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -10690,11 +10703,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: IntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -10741,11 +10754,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU16AsString.TypeMapping = IntTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU16)v1, (object)(CompiledModelTestBase.EnumU16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU16)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU16)v1, (object)(CompiledModelTestBase.EnumU16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU16)v : default(Nullable)), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -10791,15 +10804,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU16AsStringArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU16)v1, (object)(CompiledModelTestBase.EnumU16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU16)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU16)v1, (object)(CompiledModelTestBase.EnumU16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU16)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -10821,11 +10834,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: IntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -10871,15 +10884,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU16AsStringCollection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.EnumU16>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU16)v1, (object)(CompiledModelTestBase.EnumU16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU16)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.EnumU16>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU16)v1, (object)(CompiledModelTestBase.EnumU16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU16)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -10901,11 +10914,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: IntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -10951,15 +10964,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU16Collection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.EnumU16>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU16)v1, (object)(CompiledModelTestBase.EnumU16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU16)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.EnumU16>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU16)v1, (object)(CompiledModelTestBase.EnumU16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU16)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -10981,11 +10994,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: IntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -11032,15 +11045,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU32.TypeMapping = SqlServerLongTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU32)v1, (object)(CompiledModelTestBase.EnumU32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU32)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU32)v1, (object)(CompiledModelTestBase.EnumU32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU32)v : default(Nullable)), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), converter: new ValueConverter( (CompiledModelTestBase.EnumU32 value) => (long)value, @@ -11082,15 +11095,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU32Array.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU32)v1, (object)(CompiledModelTestBase.EnumU32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU32)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU32)v1, (object)(CompiledModelTestBase.EnumU32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU32)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -11112,15 +11125,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerLongTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), converter: new ValueConverter( (CompiledModelTestBase.EnumU32 value) => (long)value, @@ -11163,15 +11176,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU32AsString.TypeMapping = SqlServerLongTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU32)v1, (object)(CompiledModelTestBase.EnumU32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU32)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU32)v1, (object)(CompiledModelTestBase.EnumU32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU32)v : default(Nullable)), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), converter: new ValueConverter( (CompiledModelTestBase.EnumU32 value) => (long)value, @@ -11213,15 +11226,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU32AsStringArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU32)v1, (object)(CompiledModelTestBase.EnumU32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU32)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU32)v1, (object)(CompiledModelTestBase.EnumU32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU32)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -11243,15 +11256,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerLongTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), converter: new ValueConverter( (CompiledModelTestBase.EnumU32 value) => (long)value, @@ -11293,15 +11306,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU32AsStringCollection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.EnumU32>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU32)v1, (object)(CompiledModelTestBase.EnumU32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU32)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.EnumU32>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU32)v1, (object)(CompiledModelTestBase.EnumU32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU32)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -11323,15 +11336,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerLongTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), converter: new ValueConverter( (CompiledModelTestBase.EnumU32 value) => (long)value, @@ -11373,15 +11386,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU32Collection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.EnumU32>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU32)v1, (object)(CompiledModelTestBase.EnumU32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU32)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.EnumU32>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU32)v1, (object)(CompiledModelTestBase.EnumU32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU32)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -11403,15 +11416,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerLongTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), converter: new ValueConverter( (CompiledModelTestBase.EnumU32 value) => (long)value, @@ -11454,15 +11467,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU64.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU64)v1, (object)(CompiledModelTestBase.EnumU64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU64)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU64)v1, (object)(CompiledModelTestBase.EnumU64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU64)v : default(Nullable)), providerValueComparer: new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "decimal(20,0)", @@ -11508,15 +11521,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU64Array.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU64)v1, (object)(CompiledModelTestBase.EnumU64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU64)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU64)v1, (object)(CompiledModelTestBase.EnumU64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU64)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -11538,15 +11551,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerDecimalTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), providerValueComparer: new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "decimal(20,0)", @@ -11593,15 +11606,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU64AsString.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU64)v1, (object)(CompiledModelTestBase.EnumU64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU64)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU64)v1, (object)(CompiledModelTestBase.EnumU64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU64)v : default(Nullable)), providerValueComparer: new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "decimal(20,0)", @@ -11647,15 +11660,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU64AsStringArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU64)v1, (object)(CompiledModelTestBase.EnumU64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU64)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU64)v1, (object)(CompiledModelTestBase.EnumU64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU64)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -11677,15 +11690,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerDecimalTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), providerValueComparer: new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "decimal(20,0)", @@ -11731,15 +11744,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU64AsStringCollection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.EnumU64>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU64)v1, (object)(CompiledModelTestBase.EnumU64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU64)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.EnumU64>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU64)v1, (object)(CompiledModelTestBase.EnumU64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU64)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -11761,15 +11774,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerDecimalTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), providerValueComparer: new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "decimal(20,0)", @@ -11815,15 +11828,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU64Collection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.EnumU64>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU64)v1, (object)(CompiledModelTestBase.EnumU64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU64)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.EnumU64>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU64)v1, (object)(CompiledModelTestBase.EnumU64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU64)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -11845,15 +11858,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerDecimalTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), providerValueComparer: new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "decimal(20,0)", @@ -11876,17 +11889,17 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("NullableEnumU64NestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); nullableEnumU64NestedCollection.SetGetter( - (CompiledModelTestBase.ManyTypes entity) => ReadNullableEnumU64NestedCollection(entity), - (CompiledModelTestBase.ManyTypes entity) => ReadNullableEnumU64NestedCollection(entity) == null, - (CompiledModelTestBase.ManyTypes instance) => ReadNullableEnumU64NestedCollection(instance), - (CompiledModelTestBase.ManyTypes instance) => ReadNullableEnumU64NestedCollection(instance) == null); + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU64NestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU64NestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU64NestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU64NestedCollection(instance) == null); nullableEnumU64NestedCollection.SetSetter( - (CompiledModelTestBase.ManyTypes entity, Nullable[][] value) => WriteNullableEnumU64NestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, Nullable[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU64NestedCollection(entity) = value); nullableEnumU64NestedCollection.SetMaterializationSetter( - (CompiledModelTestBase.ManyTypes entity, Nullable[][] value) => WriteNullableEnumU64NestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, Nullable[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU64NestedCollection(entity) = value); nullableEnumU64NestedCollection.SetAccessors( - (InternalEntityEntry entry) => ReadNullableEnumU64NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => ReadNullableEnumU64NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU64NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU64NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => entry.ReadOriginalValue[][]>(nullableEnumU64NestedCollection, 172), (InternalEntityEntry entry) => entry.GetCurrentValue[][]>(nullableEnumU64NestedCollection), (ValueBuffer valueBuffer) => valueBuffer[172]); @@ -11899,15 +11912,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU64NestedCollection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer(new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU64)v1, (object)(CompiledModelTestBase.EnumU64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU64)v : default(Nullable)))), keyComparer: new ListOfReferenceTypesComparer(new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU64)v1, (object)(CompiledModelTestBase.EnumU64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU64)v : default(Nullable)))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -11931,15 +11944,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU64)v1, (object)(CompiledModelTestBase.EnumU64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU64)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU64)v1, (object)(CompiledModelTestBase.EnumU64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU64)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -11961,15 +11974,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerDecimalTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), providerValueComparer: new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "decimal(20,0)", @@ -11984,6 +11997,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (CompiledModelTestBase.EnumU64 value) => (decimal)(long)value, (decimal value) => (CompiledModelTestBase.EnumU64)(long)value))))); nullableEnumU64NestedCollection.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + nullableEnumU64NestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU64NestedCollection", "TestNamespace") }); var nullableEnumU8 = runtimeEntityType.AddProperty( "NullableEnumU8", @@ -12015,11 +12029,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU8.TypeMapping = SqlServerByteTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU8)v1, (object)(CompiledModelTestBase.EnumU8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU8)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU8)v1, (object)(CompiledModelTestBase.EnumU8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU8)v : default(Nullable)), providerValueComparer: new ValueComparer( (byte v1, byte v2) => v1 == v2, @@ -12065,15 +12079,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU8Array.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU8)v1, (object)(CompiledModelTestBase.EnumU8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU8)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU8)v1, (object)(CompiledModelTestBase.EnumU8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU8)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -12095,11 +12109,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerByteTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v), providerValueComparer: new ValueComparer( (byte v1, byte v2) => v1 == v2, @@ -12146,11 +12160,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU8AsString.TypeMapping = SqlServerByteTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU8)v1, (object)(CompiledModelTestBase.EnumU8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU8)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU8)v1, (object)(CompiledModelTestBase.EnumU8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU8)v : default(Nullable)), providerValueComparer: new ValueComparer( (byte v1, byte v2) => v1 == v2, @@ -12196,15 +12210,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU8AsStringArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU8)v1, (object)(CompiledModelTestBase.EnumU8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU8)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU8)v1, (object)(CompiledModelTestBase.EnumU8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU8)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -12226,11 +12240,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerByteTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v), providerValueComparer: new ValueComparer( (byte v1, byte v2) => v1 == v2, @@ -12276,15 +12290,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU8AsStringCollection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.EnumU8>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU8)v1, (object)(CompiledModelTestBase.EnumU8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU8)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.EnumU8>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU8)v1, (object)(CompiledModelTestBase.EnumU8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU8)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -12306,11 +12320,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerByteTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v), providerValueComparer: new ValueComparer( (byte v1, byte v2) => v1 == v2, @@ -12356,15 +12370,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU8Collection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.EnumU8>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU8)v1, (object)(CompiledModelTestBase.EnumU8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU8)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.EnumU8>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU8)v1, (object)(CompiledModelTestBase.EnumU8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU8)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -12386,11 +12400,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerByteTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v), providerValueComparer: new ValueComparer( (byte v1, byte v2) => v1 == v2, @@ -12437,15 +12451,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableFloat.TypeMapping = SqlServerFloatTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && ((float)v1).Equals((float)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((float)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(float)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(float)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && ((float)v1).Equals((float)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((float)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(float)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(float)v : default(Nullable)), providerValueComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && ((float)v1).Equals((float)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((float)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(float)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(float)v : default(Nullable))); nullableFloat.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); nullableFloat.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableFloat", "TestNamespace") }); @@ -12479,15 +12493,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableFloatArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && ((float)v1).Equals((float)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((float)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(float)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(float)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && ((float)v1).Equals((float)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((float)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(float)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(float)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -12501,15 +12515,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerFloatTypeMapping.Default.Clone( comparer: new ValueComparer( (float v1, float v2) => v1.Equals(v2), - (float v) => v.GetHashCode(), + (float v) => ((object)v).GetHashCode(), (float v) => v), keyComparer: new ValueComparer( (float v1, float v2) => v1.Equals(v2), - (float v) => v.GetHashCode(), + (float v) => ((object)v).GetHashCode(), (float v) => v), providerValueComparer: new ValueComparer( (float v1, float v2) => v1.Equals(v2), - (float v) => v.GetHashCode(), + (float v) => ((object)v).GetHashCode(), (float v) => v))); nullableFloatArray.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); nullableFloatArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableFloatArray", "TestNamespace") }); @@ -12544,15 +12558,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableGuid.TypeMapping = GuidTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (Guid)v1 == (Guid)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((Guid)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(Guid)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(Guid)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (Guid)v1 == (Guid)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((Guid)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(Guid)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(Guid)v : default(Nullable)), providerValueComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (Guid)v1 == (Guid)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((Guid)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(Guid)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(Guid)v : default(Nullable)), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "uniqueidentifier")); @@ -12588,15 +12602,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableGuidArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (Guid)v1 == (Guid)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((Guid)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(Guid)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(Guid)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (Guid)v1 == (Guid)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((Guid)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(Guid)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(Guid)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -12610,15 +12624,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: GuidTypeMapping.Default.Clone( comparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), keyComparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), providerValueComparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "uniqueidentifier"))); @@ -12631,17 +12645,17 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("NullableGuidNestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); nullableGuidNestedCollection.SetGetter( - (CompiledModelTestBase.ManyTypes entity) => ReadNullableGuidNestedCollection(entity), - (CompiledModelTestBase.ManyTypes entity) => ReadNullableGuidNestedCollection(entity) == null, - (CompiledModelTestBase.ManyTypes instance) => ReadNullableGuidNestedCollection(instance), - (CompiledModelTestBase.ManyTypes instance) => ReadNullableGuidNestedCollection(instance) == null); + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableGuidNestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableGuidNestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableGuidNestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableGuidNestedCollection(instance) == null); nullableGuidNestedCollection.SetSetter( - (CompiledModelTestBase.ManyTypes entity, Nullable[][] value) => WriteNullableGuidNestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, Nullable[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableGuidNestedCollection(entity) = value); nullableGuidNestedCollection.SetMaterializationSetter( - (CompiledModelTestBase.ManyTypes entity, Nullable[][] value) => WriteNullableGuidNestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, Nullable[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableGuidNestedCollection(entity) = value); nullableGuidNestedCollection.SetAccessors( - (InternalEntityEntry entry) => ReadNullableGuidNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => ReadNullableGuidNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableGuidNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableGuidNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => entry.ReadOriginalValue[][]>(nullableGuidNestedCollection, 183), (InternalEntityEntry entry) => entry.GetCurrentValue[][]>(nullableGuidNestedCollection), (ValueBuffer valueBuffer) => valueBuffer[183]); @@ -12654,15 +12668,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableGuidNestedCollection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer(new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (Guid)v1 == (Guid)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((Guid)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(Guid)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(Guid)v : default(Nullable)))), keyComparer: new ListOfReferenceTypesComparer(new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (Guid)v1 == (Guid)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((Guid)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(Guid)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(Guid)v : default(Nullable)))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -12678,15 +12692,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (Guid)v1 == (Guid)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((Guid)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(Guid)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(Guid)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (Guid)v1 == (Guid)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((Guid)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(Guid)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(Guid)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -12700,19 +12714,20 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: GuidTypeMapping.Default.Clone( comparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), keyComparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), providerValueComparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "uniqueidentifier")))); nullableGuidNestedCollection.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + nullableGuidNestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableGuidNestedCollection", "TestNamespace") }); var nullableIPAddress = runtimeEntityType.AddProperty( "NullableIPAddress", @@ -12744,15 +12759,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableIPAddress.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), keyComparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(45)", @@ -12760,12 +12775,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)))); nullableIPAddress.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); nullableIPAddress.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableIPAddress", "TestNamespace") }); @@ -12799,15 +12814,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableIPAddressArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -12817,27 +12832,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)))), elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), keyComparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(45)", @@ -12845,12 +12860,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))); nullableIPAddressArray.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); nullableIPAddressArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableIPAddressArray", "TestNamespace") }); @@ -12935,7 +12950,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -13042,7 +13057,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -13075,17 +13090,17 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("NullableInt32NestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); nullableInt32NestedCollection.SetGetter( - (CompiledModelTestBase.ManyTypes entity) => ReadNullableInt32NestedCollection(entity), - (CompiledModelTestBase.ManyTypes entity) => ReadNullableInt32NestedCollection(entity) == null, - (CompiledModelTestBase.ManyTypes instance) => ReadNullableInt32NestedCollection(instance), - (CompiledModelTestBase.ManyTypes instance) => ReadNullableInt32NestedCollection(instance) == null); + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt32NestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt32NestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt32NestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt32NestedCollection(instance) == null); nullableInt32NestedCollection.SetSetter( - (CompiledModelTestBase.ManyTypes entity, Nullable[][] value) => WriteNullableInt32NestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, Nullable[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt32NestedCollection(entity) = value); nullableInt32NestedCollection.SetMaterializationSetter( - (CompiledModelTestBase.ManyTypes entity, Nullable[][] value) => WriteNullableInt32NestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, Nullable[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt32NestedCollection(entity) = value); nullableInt32NestedCollection.SetAccessors( - (InternalEntityEntry entry) => ReadNullableInt32NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => ReadNullableInt32NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt32NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt32NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => entry.ReadOriginalValue[][]>(nullableInt32NestedCollection, 190), (InternalEntityEntry entry) => entry.GetCurrentValue[][]>(nullableInt32NestedCollection), (ValueBuffer valueBuffer) => valueBuffer[190]); @@ -13106,7 +13121,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable)))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -13130,7 +13145,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -13155,6 +13170,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (int v) => v, (int v) => v)))); nullableInt32NestedCollection.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + nullableInt32NestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt32NestedCollection", "TestNamespace") }); var nullableInt64 = runtimeEntityType.AddProperty( "NullableInt64", @@ -13186,15 +13202,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableInt64.TypeMapping = SqlServerLongTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable)), providerValueComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable))); nullableInt64.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); nullableInt64.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt64", "TestNamespace") }); @@ -13228,15 +13244,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableInt64Array.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -13250,15 +13266,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerLongTypeMapping.Default.Clone( comparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), keyComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v))); nullableInt64Array.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); nullableInt64Array.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt64Array", "TestNamespace") }); @@ -13269,17 +13285,17 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("NullableInt64NestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); nullableInt64NestedCollection.SetGetter( - (CompiledModelTestBase.ManyTypes entity) => ReadNullableInt64NestedCollection(entity), - (CompiledModelTestBase.ManyTypes entity) => ReadNullableInt64NestedCollection(entity) == null, - (CompiledModelTestBase.ManyTypes instance) => ReadNullableInt64NestedCollection(instance), - (CompiledModelTestBase.ManyTypes instance) => ReadNullableInt64NestedCollection(instance) == null); + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt64NestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt64NestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt64NestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt64NestedCollection(instance) == null); nullableInt64NestedCollection.SetSetter( - (CompiledModelTestBase.ManyTypes entity, List[][]> value) => WriteNullableInt64NestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, List[][]> value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt64NestedCollection(entity) = value); nullableInt64NestedCollection.SetMaterializationSetter( - (CompiledModelTestBase.ManyTypes entity, List[][]> value) => WriteNullableInt64NestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, List[][]> value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt64NestedCollection(entity) = value); nullableInt64NestedCollection.SetAccessors( - (InternalEntityEntry entry) => ReadNullableInt64NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => ReadNullableInt64NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt64NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt64NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => entry.ReadOriginalValue[][]>>(nullableInt64NestedCollection, 193), (InternalEntityEntry entry) => entry.GetCurrentValue[][]>>(nullableInt64NestedCollection), (ValueBuffer valueBuffer) => valueBuffer[193]); @@ -13292,15 +13308,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableInt64NestedCollection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer, long?[][]>(new ListOfReferenceTypesComparer(new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable))))), keyComparer: new ListOfReferenceTypesComparer, long?[][]>(new ListOfReferenceTypesComparer(new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable))))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -13318,15 +13334,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer(new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable)))), keyComparer: new ListOfReferenceTypesComparer(new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable)))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -13342,15 +13358,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -13364,17 +13380,18 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerLongTypeMapping.Default.Clone( comparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), keyComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v))))); nullableInt64NestedCollection.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + nullableInt64NestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt64NestedCollection", "TestNamespace") }); var nullableInt8 = runtimeEntityType.AddProperty( "NullableInt8", @@ -13464,7 +13481,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (Nullable v) => v.HasValue ? (Nullable)(sbyte)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -13537,15 +13554,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullablePhysicalAddress.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), - (PhysicalAddress v) => v.GetHashCode(), + (PhysicalAddress v) => ((object)v).GetHashCode(), (PhysicalAddress v) => v), keyComparer: new ValueComparer( (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), - (PhysicalAddress v) => v.GetHashCode(), + (PhysicalAddress v) => ((object)v).GetHashCode(), (PhysicalAddress v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(20)", @@ -13553,12 +13570,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (PhysicalAddress v) => v.ToString(), + (PhysicalAddress v) => ((object)v).ToString(), (string v) => PhysicalAddress.Parse(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (PhysicalAddress v) => v.ToString(), + (PhysicalAddress v) => ((object)v).ToString(), (string v) => PhysicalAddress.Parse(v)))); nullablePhysicalAddress.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); nullablePhysicalAddress.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullablePhysicalAddress", "TestNamespace") }); @@ -13592,15 +13609,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullablePhysicalAddressArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer(new ValueComparer( (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), - (PhysicalAddress v) => v.GetHashCode(), + (PhysicalAddress v) => ((object)v).GetHashCode(), (PhysicalAddress v) => v)), keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), - (PhysicalAddress v) => v.GetHashCode(), + (PhysicalAddress v) => ((object)v).GetHashCode(), (PhysicalAddress v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -13610,27 +13627,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (PhysicalAddress v) => v.ToString(), + (PhysicalAddress v) => ((object)v).ToString(), (string v) => PhysicalAddress.Parse(v))))), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (PhysicalAddress v) => v.ToString(), + (PhysicalAddress v) => ((object)v).ToString(), (string v) => PhysicalAddress.Parse(v)))), elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), - (PhysicalAddress v) => v.GetHashCode(), + (PhysicalAddress v) => ((object)v).GetHashCode(), (PhysicalAddress v) => v), keyComparer: new ValueComparer( (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), - (PhysicalAddress v) => v.GetHashCode(), + (PhysicalAddress v) => ((object)v).GetHashCode(), (PhysicalAddress v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(20)", @@ -13638,12 +13655,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (PhysicalAddress v) => v.ToString(), + (PhysicalAddress v) => ((object)v).ToString(), (string v) => PhysicalAddress.Parse(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (PhysicalAddress v) => v.ToString(), + (PhysicalAddress v) => ((object)v).ToString(), (string v) => PhysicalAddress.Parse(v))))); nullablePhysicalAddressArray.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); nullablePhysicalAddressArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullablePhysicalAddressArray", "TestNamespace") }); @@ -13654,17 +13671,17 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("NullablePhysicalAddressNestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); nullablePhysicalAddressNestedCollection.SetGetter( - (CompiledModelTestBase.ManyTypes entity) => ReadNullablePhysicalAddressNestedCollection(entity), - (CompiledModelTestBase.ManyTypes entity) => ReadNullablePhysicalAddressNestedCollection(entity) == null, - (CompiledModelTestBase.ManyTypes instance) => ReadNullablePhysicalAddressNestedCollection(instance), - (CompiledModelTestBase.ManyTypes instance) => ReadNullablePhysicalAddressNestedCollection(instance) == null); + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullablePhysicalAddressNestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullablePhysicalAddressNestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullablePhysicalAddressNestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullablePhysicalAddressNestedCollection(instance) == null); nullablePhysicalAddressNestedCollection.SetSetter( - (CompiledModelTestBase.ManyTypes entity, IEnumerable value) => WriteNullablePhysicalAddressNestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, IEnumerable value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullablePhysicalAddressNestedCollection(entity) = value); nullablePhysicalAddressNestedCollection.SetMaterializationSetter( - (CompiledModelTestBase.ManyTypes entity, IEnumerable value) => WriteNullablePhysicalAddressNestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, IEnumerable value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullablePhysicalAddressNestedCollection(entity) = value); nullablePhysicalAddressNestedCollection.SetAccessors( - (InternalEntityEntry entry) => ReadNullablePhysicalAddressNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => ReadNullablePhysicalAddressNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullablePhysicalAddressNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullablePhysicalAddressNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullablePhysicalAddressNestedCollection, 198), (InternalEntityEntry entry) => entry.GetCurrentValue>(nullablePhysicalAddressNestedCollection), (ValueBuffer valueBuffer) => valueBuffer[198]); @@ -13677,15 +13694,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullablePhysicalAddressNestedCollection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer, PhysicalAddress[][]>(new ListOfReferenceTypesComparer(new ListOfReferenceTypesComparer(new ValueComparer( (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), - (PhysicalAddress v) => v.GetHashCode(), + (PhysicalAddress v) => ((object)v).GetHashCode(), (PhysicalAddress v) => v)))), keyComparer: new ListOfReferenceTypesComparer, PhysicalAddress[][]>(new ListOfReferenceTypesComparer(new ListOfReferenceTypesComparer(new ValueComparer( (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), - (PhysicalAddress v) => v.GetHashCode(), + (PhysicalAddress v) => ((object)v).GetHashCode(), (PhysicalAddress v) => v)))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -13697,7 +13714,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (PhysicalAddress v) => v.ToString(), + (PhysicalAddress v) => ((object)v).ToString(), (string v) => PhysicalAddress.Parse(v))))))), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter, PhysicalAddress[][]>( @@ -13706,20 +13723,20 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (PhysicalAddress v) => v.ToString(), + (PhysicalAddress v) => ((object)v).ToString(), (string v) => PhysicalAddress.Parse(v)))))), elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer(new ListOfReferenceTypesComparer(new ValueComparer( (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), - (PhysicalAddress v) => v.GetHashCode(), + (PhysicalAddress v) => ((object)v).GetHashCode(), (PhysicalAddress v) => v))), keyComparer: new ListOfReferenceTypesComparer(new ListOfReferenceTypesComparer(new ValueComparer( (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), - (PhysicalAddress v) => v.GetHashCode(), + (PhysicalAddress v) => ((object)v).GetHashCode(), (PhysicalAddress v) => v))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -13730,7 +13747,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (PhysicalAddress v) => v.ToString(), + (PhysicalAddress v) => ((object)v).ToString(), (string v) => PhysicalAddress.Parse(v)))))), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( @@ -13738,20 +13755,20 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (PhysicalAddress v) => v.ToString(), + (PhysicalAddress v) => ((object)v).ToString(), (string v) => PhysicalAddress.Parse(v))))), elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer(new ValueComparer( (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), - (PhysicalAddress v) => v.GetHashCode(), + (PhysicalAddress v) => ((object)v).GetHashCode(), (PhysicalAddress v) => v)), keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), - (PhysicalAddress v) => v.GetHashCode(), + (PhysicalAddress v) => ((object)v).GetHashCode(), (PhysicalAddress v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -13761,27 +13778,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (PhysicalAddress v) => v.ToString(), + (PhysicalAddress v) => ((object)v).ToString(), (string v) => PhysicalAddress.Parse(v))))), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (PhysicalAddress v) => v.ToString(), + (PhysicalAddress v) => ((object)v).ToString(), (string v) => PhysicalAddress.Parse(v)))), elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), - (PhysicalAddress v) => v.GetHashCode(), + (PhysicalAddress v) => ((object)v).GetHashCode(), (PhysicalAddress v) => v), keyComparer: new ValueComparer( (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), - (PhysicalAddress v) => v.GetHashCode(), + (PhysicalAddress v) => ((object)v).GetHashCode(), (PhysicalAddress v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(20)", @@ -13789,14 +13806,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (PhysicalAddress v) => v.ToString(), + (PhysicalAddress v) => ((object)v).ToString(), (string v) => PhysicalAddress.Parse(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (PhysicalAddress v) => v.ToString(), + (PhysicalAddress v) => ((object)v).ToString(), (string v) => PhysicalAddress.Parse(v))))))); nullablePhysicalAddressNestedCollection.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + nullablePhysicalAddressNestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullablePhysicalAddressNestedCollection", "TestNamespace") }); var nullableString = runtimeEntityType.AddProperty( "NullableString", @@ -13828,15 +13846,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableString.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -13875,15 +13893,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableStringArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -13897,15 +13915,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -13921,17 +13939,17 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("NullableStringNestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); nullableStringNestedCollection.SetGetter( - (CompiledModelTestBase.ManyTypes entity) => ReadNullableStringNestedCollection(entity), - (CompiledModelTestBase.ManyTypes entity) => ReadNullableStringNestedCollection(entity) == null, - (CompiledModelTestBase.ManyTypes instance) => ReadNullableStringNestedCollection(instance), - (CompiledModelTestBase.ManyTypes instance) => ReadNullableStringNestedCollection(instance) == null); + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableStringNestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableStringNestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableStringNestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableStringNestedCollection(instance) == null); nullableStringNestedCollection.SetSetter( - (CompiledModelTestBase.ManyTypes entity, string[][] value) => WriteNullableStringNestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, string[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableStringNestedCollection(entity) = value); nullableStringNestedCollection.SetMaterializationSetter( - (CompiledModelTestBase.ManyTypes entity, string[][] value) => WriteNullableStringNestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, string[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableStringNestedCollection(entity) = value); nullableStringNestedCollection.SetAccessors( - (InternalEntityEntry entry) => ReadNullableStringNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => ReadNullableStringNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableStringNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableStringNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => entry.ReadOriginalValue(nullableStringNestedCollection, 201), (InternalEntityEntry entry) => entry.GetCurrentValue(nullableStringNestedCollection), (ValueBuffer valueBuffer) => valueBuffer[201]); @@ -13944,15 +13962,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableStringNestedCollection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer(new ListOfReferenceTypesComparer(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v))), keyComparer: new ListOfReferenceTypesComparer(new ListOfReferenceTypesComparer(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -13968,15 +13986,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -13990,15 +14008,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -14006,6 +14024,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas dbType: System.Data.DbType.String), storeTypePostfix: StoreTypePostfix.None))); nullableStringNestedCollection.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + nullableStringNestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableStringNestedCollection", "TestNamespace") }); var nullableTimeOnly = runtimeEntityType.AddProperty( "NullableTimeOnly", @@ -14037,15 +14056,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableTimeOnly.TypeMapping = SqlServerTimeOnlyTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (TimeOnly)v1 == (TimeOnly)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((TimeOnly)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(TimeOnly)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(TimeOnly)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (TimeOnly)v1 == (TimeOnly)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((TimeOnly)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(TimeOnly)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(TimeOnly)v : default(Nullable)), providerValueComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (TimeOnly)v1 == (TimeOnly)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((TimeOnly)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(TimeOnly)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(TimeOnly)v : default(Nullable))); nullableTimeOnly.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); nullableTimeOnly.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableTimeOnly", "TestNamespace") }); @@ -14079,15 +14098,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableTimeOnlyArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (TimeOnly)v1 == (TimeOnly)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((TimeOnly)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(TimeOnly)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(TimeOnly)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (TimeOnly)v1 == (TimeOnly)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((TimeOnly)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(TimeOnly)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(TimeOnly)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -14101,15 +14120,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerTimeOnlyTypeMapping.Default.Clone( comparer: new ValueComparer( (TimeOnly v1, TimeOnly v2) => v1.Equals(v2), - (TimeOnly v) => v.GetHashCode(), + (TimeOnly v) => ((object)v).GetHashCode(), (TimeOnly v) => v), keyComparer: new ValueComparer( (TimeOnly v1, TimeOnly v2) => v1.Equals(v2), - (TimeOnly v) => v.GetHashCode(), + (TimeOnly v) => ((object)v).GetHashCode(), (TimeOnly v) => v), providerValueComparer: new ValueComparer( (TimeOnly v1, TimeOnly v2) => v1.Equals(v2), - (TimeOnly v) => v.GetHashCode(), + (TimeOnly v) => ((object)v).GetHashCode(), (TimeOnly v) => v))); nullableTimeOnlyArray.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); nullableTimeOnlyArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableTimeOnlyArray", "TestNamespace") }); @@ -14144,15 +14163,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableTimeSpan.TypeMapping = SqlServerTimeSpanTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (TimeSpan)v1 == (TimeSpan)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((TimeSpan)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(TimeSpan)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(TimeSpan)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (TimeSpan)v1 == (TimeSpan)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((TimeSpan)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(TimeSpan)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(TimeSpan)v : default(Nullable)), providerValueComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (TimeSpan)v1 == (TimeSpan)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((TimeSpan)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(TimeSpan)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(TimeSpan)v : default(Nullable))); nullableTimeSpan.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); nullableTimeSpan.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableTimeSpan", "TestNamespace") }); @@ -14186,15 +14205,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableTimeSpanArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (TimeSpan)v1 == (TimeSpan)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((TimeSpan)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(TimeSpan)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(TimeSpan)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (TimeSpan)v1 == (TimeSpan)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((TimeSpan)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(TimeSpan)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(TimeSpan)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -14208,15 +14227,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerTimeSpanTypeMapping.Default.Clone( comparer: new ValueComparer( (TimeSpan v1, TimeSpan v2) => v1.Equals(v2), - (TimeSpan v) => v.GetHashCode(), + (TimeSpan v) => ((object)v).GetHashCode(), (TimeSpan v) => v), keyComparer: new ValueComparer( (TimeSpan v1, TimeSpan v2) => v1.Equals(v2), - (TimeSpan v) => v.GetHashCode(), + (TimeSpan v) => ((object)v).GetHashCode(), (TimeSpan v) => v), providerValueComparer: new ValueComparer( (TimeSpan v1, TimeSpan v2) => v1.Equals(v2), - (TimeSpan v) => v.GetHashCode(), + (TimeSpan v) => ((object)v).GetHashCode(), (TimeSpan v) => v))); nullableTimeSpanArray.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); nullableTimeSpanArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableTimeSpanArray", "TestNamespace") }); @@ -14309,7 +14328,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (Nullable v) => v.HasValue ? (Nullable)(ushort)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -14390,7 +14409,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (Nullable v) => v.HasValue ? (Nullable)(uint)v : default(Nullable)), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), converter: new ValueConverter( (uint v) => (long)v, @@ -14440,7 +14459,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (Nullable v) => v.HasValue ? (Nullable)(uint)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -14470,7 +14489,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (uint v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), converter: new ValueConverter( (uint v) => (long)v, @@ -14513,15 +14532,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableUInt64.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (ulong)v1 == (ulong)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((ulong)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(ulong)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(ulong)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (ulong)v1 == (ulong)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((ulong)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(ulong)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(ulong)v : default(Nullable)), providerValueComparer: new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "decimal(20,0)", @@ -14567,15 +14586,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableUInt64Array.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (ulong)v1 == (ulong)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((ulong)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(ulong)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(ulong)v : default(Nullable))), keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (ulong)v1 == (ulong)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((ulong)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(ulong)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(ulong)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -14597,15 +14616,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerDecimalTypeMapping.Default.Clone( comparer: new ValueComparer( (ulong v1, ulong v2) => v1 == v2, - (ulong v) => v.GetHashCode(), + (ulong v) => ((object)v).GetHashCode(), (ulong v) => v), keyComparer: new ValueComparer( (ulong v1, ulong v2) => v1 == v2, - (ulong v) => v.GetHashCode(), + (ulong v) => ((object)v).GetHashCode(), (ulong v) => v), providerValueComparer: new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "decimal(20,0)", @@ -14702,7 +14721,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (Nullable v) => v.HasValue ? (Nullable)(byte)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -14735,17 +14754,17 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("NullableUInt8NestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); nullableUInt8NestedCollection.SetGetter( - (CompiledModelTestBase.ManyTypes entity) => ReadNullableUInt8NestedCollection(entity), - (CompiledModelTestBase.ManyTypes entity) => ReadNullableUInt8NestedCollection(entity) == null, - (CompiledModelTestBase.ManyTypes instance) => ReadNullableUInt8NestedCollection(instance), - (CompiledModelTestBase.ManyTypes instance) => ReadNullableUInt8NestedCollection(instance) == null); + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUInt8NestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUInt8NestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUInt8NestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUInt8NestedCollection(instance) == null); nullableUInt8NestedCollection.SetSetter( - (CompiledModelTestBase.ManyTypes entity, Nullable[][] value) => WriteNullableUInt8NestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, Nullable[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUInt8NestedCollection(entity) = value); nullableUInt8NestedCollection.SetMaterializationSetter( - (CompiledModelTestBase.ManyTypes entity, Nullable[][] value) => WriteNullableUInt8NestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, Nullable[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUInt8NestedCollection(entity) = value); nullableUInt8NestedCollection.SetAccessors( - (InternalEntityEntry entry) => ReadNullableUInt8NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => ReadNullableUInt8NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUInt8NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUInt8NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => entry.ReadOriginalValue[][]>(nullableUInt8NestedCollection, 214), (InternalEntityEntry entry) => entry.GetCurrentValue[][]>(nullableUInt8NestedCollection), (ValueBuffer valueBuffer) => valueBuffer[214]); @@ -14766,7 +14785,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (Nullable v) => v.HasValue ? (Nullable)(byte)v : default(Nullable)))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -14790,7 +14809,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (Nullable v) => v.HasValue ? (Nullable)(byte)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -14815,6 +14834,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (byte v) => (int)v, (byte v) => v)))); nullableUInt8NestedCollection.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + nullableUInt8NestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUInt8NestedCollection", "TestNamespace") }); var nullableUri = runtimeEntityType.AddProperty( "NullableUri", @@ -14846,28 +14866,28 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableUri.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (Uri v1, Uri v2) => v1 == v2, - (Uri v) => v.GetHashCode(), + (Uri v) => ((object)v).GetHashCode(), (Uri v) => v), keyComparer: new ValueComparer( (Uri v1, Uri v2) => v1 == v2, - (Uri v) => v.GetHashCode(), + (Uri v) => ((object)v).GetHashCode(), (Uri v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (Uri v) => v.ToString(), + (Uri v) => ((object)v).ToString(), (string v) => new Uri(v, UriKind.RelativeOrAbsolute)), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (Uri v) => v.ToString(), + (Uri v) => ((object)v).ToString(), (string v) => new Uri(v, UriKind.RelativeOrAbsolute)))); nullableUri.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); nullableUri.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUri", "TestNamespace") }); @@ -14901,15 +14921,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableUriArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer(new ValueComparer( (Uri v1, Uri v2) => v1 == v2, - (Uri v) => v.GetHashCode(), + (Uri v) => ((object)v).GetHashCode(), (Uri v) => v)), keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( (Uri v1, Uri v2) => v1 == v2, - (Uri v) => v.GetHashCode(), + (Uri v) => ((object)v).GetHashCode(), (Uri v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -14919,40 +14939,40 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (Uri v) => v.ToString(), + (Uri v) => ((object)v).ToString(), (string v) => new Uri(v, UriKind.RelativeOrAbsolute))))), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (Uri v) => v.ToString(), + (Uri v) => ((object)v).ToString(), (string v) => new Uri(v, UriKind.RelativeOrAbsolute)))), elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (Uri v1, Uri v2) => v1 == v2, - (Uri v) => v.GetHashCode(), + (Uri v) => ((object)v).GetHashCode(), (Uri v) => v), keyComparer: new ValueComparer( (Uri v1, Uri v2) => v1 == v2, - (Uri v) => v.GetHashCode(), + (Uri v) => ((object)v).GetHashCode(), (Uri v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (Uri v) => v.ToString(), + (Uri v) => ((object)v).ToString(), (string v) => new Uri(v, UriKind.RelativeOrAbsolute)), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (Uri v) => v.ToString(), + (Uri v) => ((object)v).ToString(), (string v) => new Uri(v, UriKind.RelativeOrAbsolute))))); nullableUriArray.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); nullableUriArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUriArray", "TestNamespace") }); @@ -14986,15 +15006,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas physicalAddress.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), - (PhysicalAddress v) => v.GetHashCode(), + (PhysicalAddress v) => ((object)v).GetHashCode(), (PhysicalAddress v) => v), keyComparer: new ValueComparer( (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), - (PhysicalAddress v) => v.GetHashCode(), + (PhysicalAddress v) => ((object)v).GetHashCode(), (PhysicalAddress v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(20)", @@ -15002,12 +15022,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (PhysicalAddress v) => v.ToString(), + (PhysicalAddress v) => ((object)v).ToString(), (string v) => PhysicalAddress.Parse(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (PhysicalAddress v) => v.ToString(), + (PhysicalAddress v) => ((object)v).ToString(), (string v) => PhysicalAddress.Parse(v)))); physicalAddress.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); physicalAddress.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_PhysicalAddress", "TestNamespace") }); @@ -15041,15 +15061,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas physicalAddressArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer(new ValueComparer( (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), - (PhysicalAddress v) => v.GetHashCode(), + (PhysicalAddress v) => ((object)v).GetHashCode(), (PhysicalAddress v) => v)), keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), - (PhysicalAddress v) => v.GetHashCode(), + (PhysicalAddress v) => ((object)v).GetHashCode(), (PhysicalAddress v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -15059,27 +15079,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (PhysicalAddress v) => v.ToString(), + (PhysicalAddress v) => ((object)v).ToString(), (string v) => PhysicalAddress.Parse(v))))), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (PhysicalAddress v) => v.ToString(), + (PhysicalAddress v) => ((object)v).ToString(), (string v) => PhysicalAddress.Parse(v)))), elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), - (PhysicalAddress v) => v.GetHashCode(), + (PhysicalAddress v) => ((object)v).GetHashCode(), (PhysicalAddress v) => v), keyComparer: new ValueComparer( (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), - (PhysicalAddress v) => v.GetHashCode(), + (PhysicalAddress v) => ((object)v).GetHashCode(), (PhysicalAddress v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(20)", @@ -15087,12 +15107,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (PhysicalAddress v) => v.ToString(), + (PhysicalAddress v) => ((object)v).ToString(), (string v) => PhysicalAddress.Parse(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (PhysicalAddress v) => v.ToString(), + (PhysicalAddress v) => ((object)v).ToString(), (string v) => PhysicalAddress.Parse(v))))); physicalAddressArray.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); physicalAddressArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_PhysicalAddressArray", "TestNamespace") }); @@ -15127,11 +15147,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas physicalAddressToBytesConverterProperty.TypeMapping = SqlServerByteArrayTypeMapping.Default.Clone( comparer: new ValueComparer( (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), - (PhysicalAddress v) => v.GetHashCode(), + (PhysicalAddress v) => ((object)v).GetHashCode(), (PhysicalAddress v) => v), keyComparer: new ValueComparer( (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), - (PhysicalAddress v) => v.GetHashCode(), + (PhysicalAddress v) => ((object)v).GetHashCode(), (PhysicalAddress v) => v), providerValueComparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), @@ -15181,15 +15201,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas physicalAddressToStringConverterProperty.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), - (PhysicalAddress v) => v.GetHashCode(), + (PhysicalAddress v) => ((object)v).GetHashCode(), (PhysicalAddress v) => v), keyComparer: new ValueComparer( (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), - (PhysicalAddress v) => v.GetHashCode(), + (PhysicalAddress v) => ((object)v).GetHashCode(), (PhysicalAddress v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(20)", @@ -15197,12 +15217,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (PhysicalAddress v) => v.ToString(), + (PhysicalAddress v) => ((object)v).ToString(), (string v) => PhysicalAddress.Parse(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (PhysicalAddress v) => v.ToString(), + (PhysicalAddress v) => ((object)v).ToString(), (string v) => PhysicalAddress.Parse(v)))); physicalAddressToStringConverterProperty.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); physicalAddressToStringConverterProperty.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_PhysicalAddressToStringConverterProperty", "TestNamespace") }); @@ -15236,15 +15256,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas @string.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -15283,15 +15303,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas stringArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -15305,15 +15325,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -15329,17 +15349,17 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("StringNestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); stringNestedCollection.SetGetter( - (CompiledModelTestBase.ManyTypes entity) => ReadStringNestedCollection(entity), - (CompiledModelTestBase.ManyTypes entity) => ReadStringNestedCollection(entity) == null, - (CompiledModelTestBase.ManyTypes instance) => ReadStringNestedCollection(instance), - (CompiledModelTestBase.ManyTypes instance) => ReadStringNestedCollection(instance) == null); + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringNestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringNestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringNestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringNestedCollection(instance) == null); stringNestedCollection.SetSetter( - (CompiledModelTestBase.ManyTypes entity, string[][] value) => WriteStringNestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, string[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringNestedCollection(entity) = value); stringNestedCollection.SetMaterializationSetter( - (CompiledModelTestBase.ManyTypes entity, string[][] value) => WriteStringNestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, string[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringNestedCollection(entity) = value); stringNestedCollection.SetAccessors( - (InternalEntityEntry entry) => ReadStringNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => ReadStringNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => entry.ReadOriginalValue(stringNestedCollection, 223), (InternalEntityEntry entry) => entry.GetCurrentValue(stringNestedCollection), (ValueBuffer valueBuffer) => valueBuffer[223]); @@ -15352,15 +15372,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas stringNestedCollection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer(new ListOfReferenceTypesComparer(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v))), keyComparer: new ListOfReferenceTypesComparer(new ListOfReferenceTypesComparer(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -15376,15 +15396,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -15398,15 +15418,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -15414,6 +15434,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas dbType: System.Data.DbType.String), storeTypePostfix: StoreTypePostfix.None))); stringNestedCollection.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + stringNestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringNestedCollection", "TestNamespace") }); var stringToBoolConverterProperty = runtimeEntityType.AddProperty( "StringToBoolConverterProperty", @@ -15445,15 +15466,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas stringToBoolConverterProperty.TypeMapping = SqlServerBoolTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v), converter: new ValueConverter( (string v) => Convert.ToBoolean(v), @@ -15496,11 +15517,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas stringToBytesConverterProperty.TypeMapping = SqlServerByteArrayTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), @@ -15509,14 +15530,14 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "varbinary(max)"), converter: new ValueConverter( - (string v) => Encoding.UTF32.GetBytes(v), - (byte[] v) => Encoding.UTF32.GetString(v)), + (string v) => Encoding.GetEncoding(12000).GetBytes(v), + (byte[] v) => Encoding.GetEncoding(12000).GetString(v)), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonByteArrayReaderWriter.Instance, new ValueConverter( - (string v) => Encoding.UTF32.GetBytes(v), - (byte[] v) => Encoding.UTF32.GetString(v)))); + (string v) => Encoding.GetEncoding(12000).GetBytes(v), + (byte[] v) => Encoding.GetEncoding(12000).GetString(v)))); stringToBytesConverterProperty.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); stringToBytesConverterProperty.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringToBytesConverterProperty", "TestNamespace") }); @@ -15550,15 +15571,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas stringToCharConverterProperty.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(1)", @@ -15606,15 +15627,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas stringToDateOnlyConverterProperty.TypeMapping = SqlServerDateOnlyTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (DateOnly v1, DateOnly v2) => v1.Equals(v2), - (DateOnly v) => v.GetHashCode(), + (DateOnly v) => ((object)v).GetHashCode(), (DateOnly v) => v), mappingInfo: new RelationalTypeMappingInfo( size: 10), @@ -15659,15 +15680,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas stringToDateTimeConverterProperty.TypeMapping = SqlServerDateTimeTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v), mappingInfo: new RelationalTypeMappingInfo( size: 48), @@ -15712,15 +15733,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas stringToDateTimeOffsetConverterProperty.TypeMapping = SqlServerDateTimeOffsetTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (DateTimeOffset v1, DateTimeOffset v2) => v1.EqualsExact(v2), - (DateTimeOffset v) => v.GetHashCode(), + (DateTimeOffset v) => ((object)v).GetHashCode(), (DateTimeOffset v) => v), mappingInfo: new RelationalTypeMappingInfo( size: 48), @@ -15765,15 +15786,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas stringToDecimalNumberConverterProperty.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v), mappingInfo: new RelationalTypeMappingInfo( size: 64), @@ -15818,15 +15839,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas stringToDoubleNumberConverterProperty.TypeMapping = SqlServerDoubleTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (double v1, double v2) => v1.Equals(v2), - (double v) => v.GetHashCode(), + (double v) => ((object)v).GetHashCode(), (double v) => v), mappingInfo: new RelationalTypeMappingInfo( size: 64), @@ -15871,24 +15892,24 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas stringToEnumConverterProperty.TypeMapping = SqlServerLongTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), converter: new ValueConverter( (string v) => (long)StringEnumConverter.ConvertToEnum(v), - (long value) => ((CompiledModelTestBase.EnumU32)value).ToString()), + (long value) => ((object)(CompiledModelTestBase.EnumU32)value).ToString()), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonInt64ReaderWriter.Instance, new ValueConverter( (string v) => (long)StringEnumConverter.ConvertToEnum(v), - (long value) => ((CompiledModelTestBase.EnumU32)value).ToString()))); + (long value) => ((object)(CompiledModelTestBase.EnumU32)value).ToString()))); stringToEnumConverterProperty.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); stringToEnumConverterProperty.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringToEnumConverterProperty", "TestNamespace") }); @@ -15921,15 +15942,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas stringToGuidConverterProperty.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -15969,11 +15990,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas stringToIntNumberConverterProperty.TypeMapping = IntTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -16022,15 +16043,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas stringToTimeOnlyConverterProperty.TypeMapping = SqlServerTimeOnlyTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (TimeOnly v1, TimeOnly v2) => v1.Equals(v2), - (TimeOnly v) => v.GetHashCode(), + (TimeOnly v) => ((object)v).GetHashCode(), (TimeOnly v) => v), mappingInfo: new RelationalTypeMappingInfo( size: 48), @@ -16075,15 +16096,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas stringToTimeSpanConverterProperty.TypeMapping = SqlServerTimeSpanTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (TimeSpan v1, TimeSpan v2) => v1.Equals(v2), - (TimeSpan v) => v.GetHashCode(), + (TimeSpan v) => ((object)v).GetHashCode(), (TimeSpan v) => v), mappingInfo: new RelationalTypeMappingInfo( size: 48), @@ -16128,29 +16149,29 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas stringToUriConverterProperty.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (string v) => new Uri(v, UriKind.RelativeOrAbsolute).ToString(), - (string v) => new Uri(v, UriKind.RelativeOrAbsolute).ToString()), + (string v) => ((object)new Uri(v, UriKind.RelativeOrAbsolute)).ToString(), + (string v) => ((object)new Uri(v, UriKind.RelativeOrAbsolute)).ToString()), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (string v) => new Uri(v, UriKind.RelativeOrAbsolute).ToString(), - (string v) => new Uri(v, UriKind.RelativeOrAbsolute).ToString()))); + (string v) => ((object)new Uri(v, UriKind.RelativeOrAbsolute)).ToString(), + (string v) => ((object)new Uri(v, UriKind.RelativeOrAbsolute)).ToString()))); stringToUriConverterProperty.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); stringToUriConverterProperty.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringToUriConverterProperty", "TestNamespace") }); @@ -16184,15 +16205,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas timeOnly.TypeMapping = SqlServerTimeOnlyTypeMapping.Default.Clone( comparer: new ValueComparer( (TimeOnly v1, TimeOnly v2) => v1.Equals(v2), - (TimeOnly v) => v.GetHashCode(), + (TimeOnly v) => ((object)v).GetHashCode(), (TimeOnly v) => v), keyComparer: new ValueComparer( (TimeOnly v1, TimeOnly v2) => v1.Equals(v2), - (TimeOnly v) => v.GetHashCode(), + (TimeOnly v) => ((object)v).GetHashCode(), (TimeOnly v) => v), providerValueComparer: new ValueComparer( (TimeOnly v1, TimeOnly v2) => v1.Equals(v2), - (TimeOnly v) => v.GetHashCode(), + (TimeOnly v) => ((object)v).GetHashCode(), (TimeOnly v) => v)); timeOnly.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); timeOnly.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_TimeOnly", "TestNamespace") }); @@ -16226,15 +16247,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas timeOnlyArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer(new ValueComparer( (TimeOnly v1, TimeOnly v2) => v1.Equals(v2), - (TimeOnly v) => v.GetHashCode(), + (TimeOnly v) => ((object)v).GetHashCode(), (TimeOnly v) => v)), keyComparer: new ListOfValueTypesComparer(new ValueComparer( (TimeOnly v1, TimeOnly v2) => v1.Equals(v2), - (TimeOnly v) => v.GetHashCode(), + (TimeOnly v) => ((object)v).GetHashCode(), (TimeOnly v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -16248,15 +16269,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerTimeOnlyTypeMapping.Default.Clone( comparer: new ValueComparer( (TimeOnly v1, TimeOnly v2) => v1.Equals(v2), - (TimeOnly v) => v.GetHashCode(), + (TimeOnly v) => ((object)v).GetHashCode(), (TimeOnly v) => v), keyComparer: new ValueComparer( (TimeOnly v1, TimeOnly v2) => v1.Equals(v2), - (TimeOnly v) => v.GetHashCode(), + (TimeOnly v) => ((object)v).GetHashCode(), (TimeOnly v) => v), providerValueComparer: new ValueComparer( (TimeOnly v1, TimeOnly v2) => v1.Equals(v2), - (TimeOnly v) => v.GetHashCode(), + (TimeOnly v) => ((object)v).GetHashCode(), (TimeOnly v) => v))); timeOnlyArray.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); timeOnlyArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_TimeOnlyArray", "TestNamespace") }); @@ -16291,15 +16312,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas timeOnlyToStringConverterProperty.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (TimeOnly v1, TimeOnly v2) => v1.Equals(v2), - (TimeOnly v) => v.GetHashCode(), + (TimeOnly v) => ((object)v).GetHashCode(), (TimeOnly v) => v), keyComparer: new ValueComparer( (TimeOnly v1, TimeOnly v2) => v1.Equals(v2), - (TimeOnly v) => v.GetHashCode(), + (TimeOnly v) => ((object)v).GetHashCode(), (TimeOnly v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(48)", @@ -16348,15 +16369,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas timeOnlyToTicksConverterProperty.TypeMapping = SqlServerLongTypeMapping.Default.Clone( comparer: new ValueComparer( (TimeOnly v1, TimeOnly v2) => v1.Equals(v2), - (TimeOnly v) => v.GetHashCode(), + (TimeOnly v) => ((object)v).GetHashCode(), (TimeOnly v) => v), keyComparer: new ValueComparer( (TimeOnly v1, TimeOnly v2) => v1.Equals(v2), - (TimeOnly v) => v.GetHashCode(), + (TimeOnly v) => ((object)v).GetHashCode(), (TimeOnly v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), converter: new ValueConverter( (TimeOnly v) => v.Ticks, @@ -16400,15 +16421,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas timeSpan.TypeMapping = SqlServerTimeSpanTypeMapping.Default.Clone( comparer: new ValueComparer( (TimeSpan v1, TimeSpan v2) => v1.Equals(v2), - (TimeSpan v) => v.GetHashCode(), + (TimeSpan v) => ((object)v).GetHashCode(), (TimeSpan v) => v), keyComparer: new ValueComparer( (TimeSpan v1, TimeSpan v2) => v1.Equals(v2), - (TimeSpan v) => v.GetHashCode(), + (TimeSpan v) => ((object)v).GetHashCode(), (TimeSpan v) => v), providerValueComparer: new ValueComparer( (TimeSpan v1, TimeSpan v2) => v1.Equals(v2), - (TimeSpan v) => v.GetHashCode(), + (TimeSpan v) => ((object)v).GetHashCode(), (TimeSpan v) => v)); timeSpan.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); timeSpan.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_TimeSpan", "TestNamespace") }); @@ -16442,15 +16463,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas timeSpanArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer(new ValueComparer( (TimeSpan v1, TimeSpan v2) => v1.Equals(v2), - (TimeSpan v) => v.GetHashCode(), + (TimeSpan v) => ((object)v).GetHashCode(), (TimeSpan v) => v)), keyComparer: new ListOfValueTypesComparer(new ValueComparer( (TimeSpan v1, TimeSpan v2) => v1.Equals(v2), - (TimeSpan v) => v.GetHashCode(), + (TimeSpan v) => ((object)v).GetHashCode(), (TimeSpan v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -16464,15 +16485,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerTimeSpanTypeMapping.Default.Clone( comparer: new ValueComparer( (TimeSpan v1, TimeSpan v2) => v1.Equals(v2), - (TimeSpan v) => v.GetHashCode(), + (TimeSpan v) => ((object)v).GetHashCode(), (TimeSpan v) => v), keyComparer: new ValueComparer( (TimeSpan v1, TimeSpan v2) => v1.Equals(v2), - (TimeSpan v) => v.GetHashCode(), + (TimeSpan v) => ((object)v).GetHashCode(), (TimeSpan v) => v), providerValueComparer: new ValueComparer( (TimeSpan v1, TimeSpan v2) => v1.Equals(v2), - (TimeSpan v) => v.GetHashCode(), + (TimeSpan v) => ((object)v).GetHashCode(), (TimeSpan v) => v))); timeSpanArray.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); timeSpanArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_TimeSpanArray", "TestNamespace") }); @@ -16507,15 +16528,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas timeSpanToStringConverterProperty.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (TimeSpan v1, TimeSpan v2) => v1.Equals(v2), - (TimeSpan v) => v.GetHashCode(), + (TimeSpan v) => ((object)v).GetHashCode(), (TimeSpan v) => v), keyComparer: new ValueComparer( (TimeSpan v1, TimeSpan v2) => v1.Equals(v2), - (TimeSpan v) => v.GetHashCode(), + (TimeSpan v) => ((object)v).GetHashCode(), (TimeSpan v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(48)", @@ -16564,15 +16585,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas timeSpanToTicksConverterProperty.TypeMapping = SqlServerLongTypeMapping.Default.Clone( comparer: new ValueComparer( (TimeSpan v1, TimeSpan v2) => v1.Equals(v2), - (TimeSpan v) => v.GetHashCode(), + (TimeSpan v) => ((object)v).GetHashCode(), (TimeSpan v) => v), keyComparer: new ValueComparer( (TimeSpan v1, TimeSpan v2) => v1.Equals(v2), - (TimeSpan v) => v.GetHashCode(), + (TimeSpan v) => ((object)v).GetHashCode(), (TimeSpan v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), converter: new ValueConverter( (TimeSpan v) => v.Ticks, @@ -16674,7 +16695,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (ushort v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -16754,7 +16775,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (uint v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), converter: new ValueConverter( (uint v) => (long)v, @@ -16805,7 +16826,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (uint v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -16835,7 +16856,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (uint v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), converter: new ValueConverter( (uint v) => (long)v, @@ -16877,15 +16898,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas uInt64.TypeMapping = SqlServerDecimalTypeMapping.Default.Clone( comparer: new ValueComparer( (ulong v1, ulong v2) => v1 == v2, - (ulong v) => v.GetHashCode(), + (ulong v) => ((object)v).GetHashCode(), (ulong v) => v), keyComparer: new ValueComparer( (ulong v1, ulong v2) => v1 == v2, - (ulong v) => v.GetHashCode(), + (ulong v) => ((object)v).GetHashCode(), (ulong v) => v), providerValueComparer: new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "decimal(20,0)", @@ -16932,15 +16953,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas uInt64Array.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer(new ValueComparer( (ulong v1, ulong v2) => v1 == v2, - (ulong v) => v.GetHashCode(), + (ulong v) => ((object)v).GetHashCode(), (ulong v) => v)), keyComparer: new ListOfValueTypesComparer(new ValueComparer( (ulong v1, ulong v2) => v1 == v2, - (ulong v) => v.GetHashCode(), + (ulong v) => ((object)v).GetHashCode(), (ulong v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -16962,15 +16983,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerDecimalTypeMapping.Default.Clone( comparer: new ValueComparer( (ulong v1, ulong v2) => v1 == v2, - (ulong v) => v.GetHashCode(), + (ulong v) => ((object)v).GetHashCode(), (ulong v) => v), keyComparer: new ValueComparer( (ulong v1, ulong v2) => v1 == v2, - (ulong v) => v.GetHashCode(), + (ulong v) => ((object)v).GetHashCode(), (ulong v) => v), providerValueComparer: new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "decimal(20,0)", @@ -17059,7 +17080,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas uInt8Array.TypeMapping = SqlServerByteArrayTypeMapping.Default.Clone( comparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), - (byte[] v) => v.GetHashCode(), + (byte[] v) => ((object)v).GetHashCode(), (byte[] v) => v), keyComparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), @@ -17081,17 +17102,17 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("UInt8NestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); uInt8NestedCollection.SetGetter( - (CompiledModelTestBase.ManyTypes entity) => ReadUInt8NestedCollection(entity), - (CompiledModelTestBase.ManyTypes entity) => ReadUInt8NestedCollection(entity) == null, - (CompiledModelTestBase.ManyTypes instance) => ReadUInt8NestedCollection(instance), - (CompiledModelTestBase.ManyTypes instance) => ReadUInt8NestedCollection(instance) == null); + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UInt8NestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UInt8NestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UInt8NestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UInt8NestedCollection(instance) == null); uInt8NestedCollection.SetSetter( - (CompiledModelTestBase.ManyTypes entity, List value) => WriteUInt8NestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, List value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UInt8NestedCollection(entity) = value); uInt8NestedCollection.SetMaterializationSetter( - (CompiledModelTestBase.ManyTypes entity, List value) => WriteUInt8NestedCollection(entity, value)); + (CompiledModelTestBase.ManyTypes entity, List value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UInt8NestedCollection(entity) = value); uInt8NestedCollection.SetAccessors( - (InternalEntityEntry entry) => ReadUInt8NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => ReadUInt8NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UInt8NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UInt8NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => entry.ReadOriginalValue>(uInt8NestedCollection, 254), (InternalEntityEntry entry) => entry.GetCurrentValue>(uInt8NestedCollection), (ValueBuffer valueBuffer) => valueBuffer[254]); @@ -17104,15 +17125,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas uInt8NestedCollection.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer, byte[]>(new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), - (byte[] v) => v.GetHashCode(), + (byte[] v) => ((object)v).GetHashCode(), (byte[] v) => v)), keyComparer: new ListOfReferenceTypesComparer, byte[]>(new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), - (byte[] v) => v.GetHashCode(), + (byte[] v) => ((object)v).GetHashCode(), (byte[] v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -17126,7 +17147,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerByteArrayTypeMapping.Default.Clone( comparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), - (byte[] v) => v.GetHashCode(), + (byte[] v) => ((object)v).GetHashCode(), (byte[] v) => v), keyComparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), @@ -17140,6 +17161,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas storeTypeName: "varbinary(max)"), storeTypePostfix: StoreTypePostfix.None)); uInt8NestedCollection.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + uInt8NestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UInt8NestedCollection", "TestNamespace") }); var uri = runtimeEntityType.AddProperty( "Uri", @@ -17170,28 +17192,28 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas uri.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (Uri v1, Uri v2) => v1 == v2, - (Uri v) => v.GetHashCode(), + (Uri v) => ((object)v).GetHashCode(), (Uri v) => v), keyComparer: new ValueComparer( (Uri v1, Uri v2) => v1 == v2, - (Uri v) => v.GetHashCode(), + (Uri v) => ((object)v).GetHashCode(), (Uri v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (Uri v) => v.ToString(), + (Uri v) => ((object)v).ToString(), (string v) => new Uri(v, UriKind.RelativeOrAbsolute)), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (Uri v) => v.ToString(), + (Uri v) => ((object)v).ToString(), (string v) => new Uri(v, UriKind.RelativeOrAbsolute)))); uri.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); uri.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Uri", "TestNamespace") }); @@ -17225,15 +17247,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas uriArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer(new ValueComparer( (Uri v1, Uri v2) => v1 == v2, - (Uri v) => v.GetHashCode(), + (Uri v) => ((object)v).GetHashCode(), (Uri v) => v)), keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( (Uri v1, Uri v2) => v1 == v2, - (Uri v) => v.GetHashCode(), + (Uri v) => ((object)v).GetHashCode(), (Uri v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -17243,40 +17265,40 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (Uri v) => v.ToString(), + (Uri v) => ((object)v).ToString(), (string v) => new Uri(v, UriKind.RelativeOrAbsolute))))), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (Uri v) => v.ToString(), + (Uri v) => ((object)v).ToString(), (string v) => new Uri(v, UriKind.RelativeOrAbsolute)))), elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (Uri v1, Uri v2) => v1 == v2, - (Uri v) => v.GetHashCode(), + (Uri v) => ((object)v).GetHashCode(), (Uri v) => v), keyComparer: new ValueComparer( (Uri v1, Uri v2) => v1 == v2, - (Uri v) => v.GetHashCode(), + (Uri v) => ((object)v).GetHashCode(), (Uri v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (Uri v) => v.ToString(), + (Uri v) => ((object)v).ToString(), (string v) => new Uri(v, UriKind.RelativeOrAbsolute)), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (Uri v) => v.ToString(), + (Uri v) => ((object)v).ToString(), (string v) => new Uri(v, UriKind.RelativeOrAbsolute))))); uriArray.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); uriArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UriArray", "TestNamespace") }); @@ -17311,28 +17333,28 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas uriToStringConverterProperty.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (Uri v1, Uri v2) => v1 == v2, - (Uri v) => v.GetHashCode(), + (Uri v) => ((object)v).GetHashCode(), (Uri v) => v), keyComparer: new ValueComparer( (Uri v1, Uri v2) => v1 == v2, - (Uri v) => v.GetHashCode(), + (Uri v) => ((object)v).GetHashCode(), (Uri v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (Uri v) => v.ToString(), + (Uri v) => ((object)v).ToString(), (string v) => new Uri(v, UriKind.RelativeOrAbsolute)), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (Uri v) => v.ToString(), + (Uri v) => ((object)v).ToString(), (string v) => new Uri(v, UriKind.RelativeOrAbsolute)))); uriToStringConverterProperty.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); uriToStringConverterProperty.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UriToStringConverterProperty", "TestNamespace") }); @@ -17608,26 +17630,26 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (CompiledModelTestBase.ManyTypes)source.Entity; - var liftedArg = (ISnapshot)new Snapshot(((ValueComparer)id.GetValueComparer()).Snapshot(source.GetCurrentValue(id)), ((ValueComparer)@bool.GetValueComparer()).Snapshot(source.GetCurrentValue(@bool)), (IEnumerable)source.GetCurrentValue(boolArray) == null ? null : (bool[])((ValueComparer>)boolArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(boolArray)), (object)source.GetCurrentValue(boolNestedCollection) == null ? null : (bool[][])((ValueComparer)boolNestedCollection.GetValueComparer()).Snapshot((object)source.GetCurrentValue(boolNestedCollection)), ((ValueComparer)boolToStringConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(boolToStringConverterProperty)), ((ValueComparer)boolToTwoValuesConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(boolToTwoValuesConverterProperty)), ((ValueComparer)boolToZeroOneConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(boolToZeroOneConverterProperty)), source.GetCurrentValue(bytes) == null ? null : ((ValueComparer)bytes.GetValueComparer()).Snapshot(source.GetCurrentValue(bytes)), (object)source.GetCurrentValue(bytesArray) == null ? null : (byte[][])((ValueComparer)bytesArray.GetValueComparer()).Snapshot((object)source.GetCurrentValue(bytesArray)), (object)source.GetCurrentValue(bytesNestedCollection) == null ? null : (byte[][][])((ValueComparer)bytesNestedCollection.GetValueComparer()).Snapshot((object)source.GetCurrentValue(bytesNestedCollection)), source.GetCurrentValue(bytesToStringConverterProperty) == null ? null : ((ValueComparer)bytesToStringConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(bytesToStringConverterProperty)), ((ValueComparer)castingConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(castingConverterProperty)), ((ValueComparer)@char.GetValueComparer()).Snapshot(source.GetCurrentValue(@char)), (IEnumerable)source.GetCurrentValue(charArray) == null ? null : (char[])((ValueComparer>)charArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(charArray)), (object)source.GetCurrentValue(charNestedCollection) == null ? null : (char[][])((ValueComparer)charNestedCollection.GetValueComparer()).Snapshot((object)source.GetCurrentValue(charNestedCollection)), ((ValueComparer)charToStringConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(charToStringConverterProperty)), ((ValueComparer)dateOnly.GetValueComparer()).Snapshot(source.GetCurrentValue(dateOnly)), (IEnumerable)source.GetCurrentValue(dateOnlyArray) == null ? null : (DateOnly[])((ValueComparer>)dateOnlyArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(dateOnlyArray)), ((ValueComparer)dateOnlyToStringConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(dateOnlyToStringConverterProperty)), ((ValueComparer)dateTime.GetValueComparer()).Snapshot(source.GetCurrentValue(dateTime)), (IEnumerable)source.GetCurrentValue(dateTimeArray) == null ? null : (DateTime[])((ValueComparer>)dateTimeArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(dateTimeArray)), ((ValueComparer)dateTimeOffsetToBinaryConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(dateTimeOffsetToBinaryConverterProperty)), ((ValueComparer)dateTimeOffsetToBytesConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(dateTimeOffsetToBytesConverterProperty)), ((ValueComparer)dateTimeOffsetToStringConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(dateTimeOffsetToStringConverterProperty)), ((ValueComparer)dateTimeToBinaryConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(dateTimeToBinaryConverterProperty)), ((ValueComparer)dateTimeToStringConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(dateTimeToStringConverterProperty)), ((ValueComparer)dateTimeToTicksConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(dateTimeToTicksConverterProperty)), ((ValueComparer)@decimal.GetValueComparer()).Snapshot(source.GetCurrentValue(@decimal)), (IEnumerable)source.GetCurrentValue(decimalArray) == null ? null : (decimal[])((ValueComparer>)decimalArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(decimalArray)), ((ValueComparer)decimalNumberToBytesConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(decimalNumberToBytesConverterProperty))); + var liftedArg = (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetValueComparer()).Snapshot(source.GetCurrentValue(id)), ((ValueComparer)((IProperty)@bool).GetValueComparer()).Snapshot(source.GetCurrentValue(@bool)), (IEnumerable)source.GetCurrentValue(boolArray) == null ? null : (bool[])((ValueComparer>)((IProperty)boolArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(boolArray)), (object)source.GetCurrentValue(boolNestedCollection) == null ? null : (bool[][])((ValueComparer)((IProperty)boolNestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue(boolNestedCollection)), ((ValueComparer)((IProperty)boolToStringConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(boolToStringConverterProperty)), ((ValueComparer)((IProperty)boolToTwoValuesConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(boolToTwoValuesConverterProperty)), ((ValueComparer)((IProperty)boolToZeroOneConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(boolToZeroOneConverterProperty)), source.GetCurrentValue(bytes) == null ? null : ((ValueComparer)((IProperty)bytes).GetValueComparer()).Snapshot(source.GetCurrentValue(bytes)), (object)source.GetCurrentValue(bytesArray) == null ? null : (byte[][])((ValueComparer)((IProperty)bytesArray).GetValueComparer()).Snapshot((object)source.GetCurrentValue(bytesArray)), (object)source.GetCurrentValue(bytesNestedCollection) == null ? null : (byte[][][])((ValueComparer)((IProperty)bytesNestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue(bytesNestedCollection)), source.GetCurrentValue(bytesToStringConverterProperty) == null ? null : ((ValueComparer)((IProperty)bytesToStringConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(bytesToStringConverterProperty)), ((ValueComparer)((IProperty)castingConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(castingConverterProperty)), ((ValueComparer)((IProperty)@char).GetValueComparer()).Snapshot(source.GetCurrentValue(@char)), (IEnumerable)source.GetCurrentValue(charArray) == null ? null : (char[])((ValueComparer>)((IProperty)charArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(charArray)), (object)source.GetCurrentValue(charNestedCollection) == null ? null : (char[][])((ValueComparer)((IProperty)charNestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue(charNestedCollection)), ((ValueComparer)((IProperty)charToStringConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(charToStringConverterProperty)), ((ValueComparer)((IProperty)dateOnly).GetValueComparer()).Snapshot(source.GetCurrentValue(dateOnly)), (IEnumerable)source.GetCurrentValue(dateOnlyArray) == null ? null : (DateOnly[])((ValueComparer>)((IProperty)dateOnlyArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(dateOnlyArray)), ((ValueComparer)((IProperty)dateOnlyToStringConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(dateOnlyToStringConverterProperty)), ((ValueComparer)((IProperty)dateTime).GetValueComparer()).Snapshot(source.GetCurrentValue(dateTime)), (IEnumerable)source.GetCurrentValue(dateTimeArray) == null ? null : (DateTime[])((ValueComparer>)((IProperty)dateTimeArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(dateTimeArray)), ((ValueComparer)((IProperty)dateTimeOffsetToBinaryConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(dateTimeOffsetToBinaryConverterProperty)), ((ValueComparer)((IProperty)dateTimeOffsetToBytesConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(dateTimeOffsetToBytesConverterProperty)), ((ValueComparer)((IProperty)dateTimeOffsetToStringConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(dateTimeOffsetToStringConverterProperty)), ((ValueComparer)((IProperty)dateTimeToBinaryConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(dateTimeToBinaryConverterProperty)), ((ValueComparer)((IProperty)dateTimeToStringConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(dateTimeToStringConverterProperty)), ((ValueComparer)((IProperty)dateTimeToTicksConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(dateTimeToTicksConverterProperty)), ((ValueComparer)((IProperty)@decimal).GetValueComparer()).Snapshot(source.GetCurrentValue(@decimal)), (IEnumerable)source.GetCurrentValue(decimalArray) == null ? null : (decimal[])((ValueComparer>)((IProperty)decimalArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(decimalArray)), ((ValueComparer)((IProperty)decimalNumberToBytesConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(decimalNumberToBytesConverterProperty))); var entity0 = (CompiledModelTestBase.ManyTypes)source.Entity; - var liftedArg0 = (ISnapshot)new Snapshot, List, CompiledModelTestBase.Enum32, CompiledModelTestBase.Enum32[], CompiledModelTestBase.Enum32, CompiledModelTestBase.Enum32[], List, List, List[][], CompiledModelTestBase.Enum64, CompiledModelTestBase.Enum64[], CompiledModelTestBase.Enum64, CompiledModelTestBase.Enum64[], List, List, CompiledModelTestBase.Enum8, CompiledModelTestBase.Enum8[], CompiledModelTestBase.Enum8, CompiledModelTestBase.Enum8[], List, List>(((ValueComparer)decimalNumberToStringConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(decimalNumberToStringConverterProperty)), ((ValueComparer)@double.GetValueComparer()).Snapshot(source.GetCurrentValue(@double)), (IEnumerable)source.GetCurrentValue(doubleArray) == null ? null : (double[])((ValueComparer>)doubleArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(doubleArray)), ((ValueComparer)doubleNumberToBytesConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(doubleNumberToBytesConverterProperty)), ((ValueComparer)doubleNumberToStringConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(doubleNumberToStringConverterProperty)), ((ValueComparer)enum16.GetValueComparer()).Snapshot(source.GetCurrentValue(enum16)), (IEnumerable)source.GetCurrentValue(enum16Array) == null ? null : (CompiledModelTestBase.Enum16[])((ValueComparer>)enum16Array.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enum16Array)), ((ValueComparer)enum16AsString.GetValueComparer()).Snapshot(source.GetCurrentValue(enum16AsString)), (IEnumerable)source.GetCurrentValue(enum16AsStringArray) == null ? null : (CompiledModelTestBase.Enum16[])((ValueComparer>)enum16AsStringArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enum16AsStringArray)), (IEnumerable)source.GetCurrentValue>(enum16AsStringCollection) == null ? null : (List)((ValueComparer>)enum16AsStringCollection.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enum16AsStringCollection)), (IEnumerable)source.GetCurrentValue>(enum16Collection) == null ? null : (List)((ValueComparer>)enum16Collection.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enum16Collection)), ((ValueComparer)enum32.GetValueComparer()).Snapshot(source.GetCurrentValue(enum32)), (IEnumerable)source.GetCurrentValue(enum32Array) == null ? null : (CompiledModelTestBase.Enum32[])((ValueComparer>)enum32Array.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enum32Array)), ((ValueComparer)enum32AsString.GetValueComparer()).Snapshot(source.GetCurrentValue(enum32AsString)), (IEnumerable)source.GetCurrentValue(enum32AsStringArray) == null ? null : (CompiledModelTestBase.Enum32[])((ValueComparer>)enum32AsStringArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enum32AsStringArray)), (IEnumerable)source.GetCurrentValue>(enum32AsStringCollection) == null ? null : (List)((ValueComparer>)enum32AsStringCollection.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enum32AsStringCollection)), (IEnumerable)source.GetCurrentValue>(enum32Collection) == null ? null : (List)((ValueComparer>)enum32Collection.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enum32Collection)), (object)source.GetCurrentValue[][]>(enum32NestedCollection) == null ? null : (List[][])((ValueComparer)enum32NestedCollection.GetValueComparer()).Snapshot((object)source.GetCurrentValue[][]>(enum32NestedCollection)), ((ValueComparer)enum64.GetValueComparer()).Snapshot(source.GetCurrentValue(enum64)), (IEnumerable)source.GetCurrentValue(enum64Array) == null ? null : (CompiledModelTestBase.Enum64[])((ValueComparer>)enum64Array.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enum64Array)), ((ValueComparer)enum64AsString.GetValueComparer()).Snapshot(source.GetCurrentValue(enum64AsString)), (IEnumerable)source.GetCurrentValue(enum64AsStringArray) == null ? null : (CompiledModelTestBase.Enum64[])((ValueComparer>)enum64AsStringArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enum64AsStringArray)), (IEnumerable)source.GetCurrentValue>(enum64AsStringCollection) == null ? null : (List)((ValueComparer>)enum64AsStringCollection.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enum64AsStringCollection)), (IEnumerable)source.GetCurrentValue>(enum64Collection) == null ? null : (List)((ValueComparer>)enum64Collection.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enum64Collection)), ((ValueComparer)enum8.GetValueComparer()).Snapshot(source.GetCurrentValue(enum8)), (IEnumerable)source.GetCurrentValue(enum8Array) == null ? null : (CompiledModelTestBase.Enum8[])((ValueComparer>)enum8Array.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enum8Array)), ((ValueComparer)enum8AsString.GetValueComparer()).Snapshot(source.GetCurrentValue(enum8AsString)), (IEnumerable)source.GetCurrentValue(enum8AsStringArray) == null ? null : (CompiledModelTestBase.Enum8[])((ValueComparer>)enum8AsStringArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enum8AsStringArray)), (IEnumerable)source.GetCurrentValue>(enum8AsStringCollection) == null ? null : (List)((ValueComparer>)enum8AsStringCollection.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enum8AsStringCollection)), (IEnumerable)source.GetCurrentValue>(enum8Collection) == null ? null : (List)((ValueComparer>)enum8Collection.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enum8Collection))); + var liftedArg0 = (ISnapshot)new Snapshot, List, CompiledModelTestBase.Enum32, CompiledModelTestBase.Enum32[], CompiledModelTestBase.Enum32, CompiledModelTestBase.Enum32[], List, List, List[][], CompiledModelTestBase.Enum64, CompiledModelTestBase.Enum64[], CompiledModelTestBase.Enum64, CompiledModelTestBase.Enum64[], List, List, CompiledModelTestBase.Enum8, CompiledModelTestBase.Enum8[], CompiledModelTestBase.Enum8, CompiledModelTestBase.Enum8[], List, List>(((ValueComparer)((IProperty)decimalNumberToStringConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(decimalNumberToStringConverterProperty)), ((ValueComparer)((IProperty)@double).GetValueComparer()).Snapshot(source.GetCurrentValue(@double)), (IEnumerable)source.GetCurrentValue(doubleArray) == null ? null : (double[])((ValueComparer>)((IProperty)doubleArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(doubleArray)), ((ValueComparer)((IProperty)doubleNumberToBytesConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(doubleNumberToBytesConverterProperty)), ((ValueComparer)((IProperty)doubleNumberToStringConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(doubleNumberToStringConverterProperty)), ((ValueComparer)((IProperty)enum16).GetValueComparer()).Snapshot(source.GetCurrentValue(enum16)), (IEnumerable)source.GetCurrentValue(enum16Array) == null ? null : (CompiledModelTestBase.Enum16[])((ValueComparer>)((IProperty)enum16Array).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enum16Array)), ((ValueComparer)((IProperty)enum16AsString).GetValueComparer()).Snapshot(source.GetCurrentValue(enum16AsString)), (IEnumerable)source.GetCurrentValue(enum16AsStringArray) == null ? null : (CompiledModelTestBase.Enum16[])((ValueComparer>)((IProperty)enum16AsStringArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enum16AsStringArray)), (IEnumerable)source.GetCurrentValue>(enum16AsStringCollection) == null ? null : (List)((ValueComparer>)((IProperty)enum16AsStringCollection).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enum16AsStringCollection)), (IEnumerable)source.GetCurrentValue>(enum16Collection) == null ? null : (List)((ValueComparer>)((IProperty)enum16Collection).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enum16Collection)), ((ValueComparer)((IProperty)enum32).GetValueComparer()).Snapshot(source.GetCurrentValue(enum32)), (IEnumerable)source.GetCurrentValue(enum32Array) == null ? null : (CompiledModelTestBase.Enum32[])((ValueComparer>)((IProperty)enum32Array).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enum32Array)), ((ValueComparer)((IProperty)enum32AsString).GetValueComparer()).Snapshot(source.GetCurrentValue(enum32AsString)), (IEnumerable)source.GetCurrentValue(enum32AsStringArray) == null ? null : (CompiledModelTestBase.Enum32[])((ValueComparer>)((IProperty)enum32AsStringArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enum32AsStringArray)), (IEnumerable)source.GetCurrentValue>(enum32AsStringCollection) == null ? null : (List)((ValueComparer>)((IProperty)enum32AsStringCollection).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enum32AsStringCollection)), (IEnumerable)source.GetCurrentValue>(enum32Collection) == null ? null : (List)((ValueComparer>)((IProperty)enum32Collection).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enum32Collection)), (object)source.GetCurrentValue[][]>(enum32NestedCollection) == null ? null : (List[][])((ValueComparer)((IProperty)enum32NestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue[][]>(enum32NestedCollection)), ((ValueComparer)((IProperty)enum64).GetValueComparer()).Snapshot(source.GetCurrentValue(enum64)), (IEnumerable)source.GetCurrentValue(enum64Array) == null ? null : (CompiledModelTestBase.Enum64[])((ValueComparer>)((IProperty)enum64Array).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enum64Array)), ((ValueComparer)((IProperty)enum64AsString).GetValueComparer()).Snapshot(source.GetCurrentValue(enum64AsString)), (IEnumerable)source.GetCurrentValue(enum64AsStringArray) == null ? null : (CompiledModelTestBase.Enum64[])((ValueComparer>)((IProperty)enum64AsStringArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enum64AsStringArray)), (IEnumerable)source.GetCurrentValue>(enum64AsStringCollection) == null ? null : (List)((ValueComparer>)((IProperty)enum64AsStringCollection).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enum64AsStringCollection)), (IEnumerable)source.GetCurrentValue>(enum64Collection) == null ? null : (List)((ValueComparer>)((IProperty)enum64Collection).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enum64Collection)), ((ValueComparer)((IProperty)enum8).GetValueComparer()).Snapshot(source.GetCurrentValue(enum8)), (IEnumerable)source.GetCurrentValue(enum8Array) == null ? null : (CompiledModelTestBase.Enum8[])((ValueComparer>)((IProperty)enum8Array).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enum8Array)), ((ValueComparer)((IProperty)enum8AsString).GetValueComparer()).Snapshot(source.GetCurrentValue(enum8AsString)), (IEnumerable)source.GetCurrentValue(enum8AsStringArray) == null ? null : (CompiledModelTestBase.Enum8[])((ValueComparer>)((IProperty)enum8AsStringArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enum8AsStringArray)), (IEnumerable)source.GetCurrentValue>(enum8AsStringCollection) == null ? null : (List)((ValueComparer>)((IProperty)enum8AsStringCollection).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enum8AsStringCollection)), (IEnumerable)source.GetCurrentValue>(enum8Collection) == null ? null : (List)((ValueComparer>)((IProperty)enum8Collection).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enum8Collection))); var entity1 = (CompiledModelTestBase.ManyTypes)source.Entity; - var liftedArg1 = (ISnapshot)new Snapshot, List, CompiledModelTestBase.EnumU32, CompiledModelTestBase.EnumU32[], CompiledModelTestBase.EnumU32, CompiledModelTestBase.EnumU32[], List, List, CompiledModelTestBase.EnumU64, CompiledModelTestBase.EnumU64[], CompiledModelTestBase.EnumU64, CompiledModelTestBase.EnumU64[], List, List, CompiledModelTestBase.EnumU64[][], CompiledModelTestBase.EnumU8, CompiledModelTestBase.EnumU8[], CompiledModelTestBase.EnumU8, CompiledModelTestBase.EnumU8[], List, List, float, float[]>((object)source.GetCurrentValue(enum8NestedCollection) == null ? null : (CompiledModelTestBase.Enum8[][])((ValueComparer)enum8NestedCollection.GetValueComparer()).Snapshot((object)source.GetCurrentValue(enum8NestedCollection)), ((ValueComparer)enumToNumberConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(enumToNumberConverterProperty)), ((ValueComparer)enumToStringConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(enumToStringConverterProperty)), ((ValueComparer)enumU16.GetValueComparer()).Snapshot(source.GetCurrentValue(enumU16)), (IEnumerable)source.GetCurrentValue(enumU16Array) == null ? null : (CompiledModelTestBase.EnumU16[])((ValueComparer>)enumU16Array.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enumU16Array)), ((ValueComparer)enumU16AsString.GetValueComparer()).Snapshot(source.GetCurrentValue(enumU16AsString)), (IEnumerable)source.GetCurrentValue(enumU16AsStringArray) == null ? null : (CompiledModelTestBase.EnumU16[])((ValueComparer>)enumU16AsStringArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enumU16AsStringArray)), (IEnumerable)source.GetCurrentValue>(enumU16AsStringCollection) == null ? null : (List)((ValueComparer>)enumU16AsStringCollection.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enumU16AsStringCollection)), (IEnumerable)source.GetCurrentValue>(enumU16Collection) == null ? null : (List)((ValueComparer>)enumU16Collection.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enumU16Collection)), ((ValueComparer)enumU32.GetValueComparer()).Snapshot(source.GetCurrentValue(enumU32)), (IEnumerable)source.GetCurrentValue(enumU32Array) == null ? null : (CompiledModelTestBase.EnumU32[])((ValueComparer>)enumU32Array.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enumU32Array)), ((ValueComparer)enumU32AsString.GetValueComparer()).Snapshot(source.GetCurrentValue(enumU32AsString)), (IEnumerable)source.GetCurrentValue(enumU32AsStringArray) == null ? null : (CompiledModelTestBase.EnumU32[])((ValueComparer>)enumU32AsStringArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enumU32AsStringArray)), (IEnumerable)source.GetCurrentValue>(enumU32AsStringCollection) == null ? null : (List)((ValueComparer>)enumU32AsStringCollection.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enumU32AsStringCollection)), (IEnumerable)source.GetCurrentValue>(enumU32Collection) == null ? null : (List)((ValueComparer>)enumU32Collection.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enumU32Collection)), ((ValueComparer)enumU64.GetValueComparer()).Snapshot(source.GetCurrentValue(enumU64)), (IEnumerable)source.GetCurrentValue(enumU64Array) == null ? null : (CompiledModelTestBase.EnumU64[])((ValueComparer>)enumU64Array.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enumU64Array)), ((ValueComparer)enumU64AsString.GetValueComparer()).Snapshot(source.GetCurrentValue(enumU64AsString)), (IEnumerable)source.GetCurrentValue(enumU64AsStringArray) == null ? null : (CompiledModelTestBase.EnumU64[])((ValueComparer>)enumU64AsStringArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enumU64AsStringArray)), (IEnumerable)source.GetCurrentValue>(enumU64AsStringCollection) == null ? null : (List)((ValueComparer>)enumU64AsStringCollection.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enumU64AsStringCollection)), (IEnumerable)source.GetCurrentValue>(enumU64Collection) == null ? null : (List)((ValueComparer>)enumU64Collection.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enumU64Collection)), (object)source.GetCurrentValue(enumU64NestedCollection) == null ? null : (CompiledModelTestBase.EnumU64[][])((ValueComparer)enumU64NestedCollection.GetValueComparer()).Snapshot((object)source.GetCurrentValue(enumU64NestedCollection)), ((ValueComparer)enumU8.GetValueComparer()).Snapshot(source.GetCurrentValue(enumU8)), (IEnumerable)source.GetCurrentValue(enumU8Array) == null ? null : (CompiledModelTestBase.EnumU8[])((ValueComparer>)enumU8Array.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enumU8Array)), ((ValueComparer)enumU8AsString.GetValueComparer()).Snapshot(source.GetCurrentValue(enumU8AsString)), (IEnumerable)source.GetCurrentValue(enumU8AsStringArray) == null ? null : (CompiledModelTestBase.EnumU8[])((ValueComparer>)enumU8AsStringArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enumU8AsStringArray)), (IEnumerable)source.GetCurrentValue>(enumU8AsStringCollection) == null ? null : (List)((ValueComparer>)enumU8AsStringCollection.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enumU8AsStringCollection)), (IEnumerable)source.GetCurrentValue>(enumU8Collection) == null ? null : (List)((ValueComparer>)enumU8Collection.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enumU8Collection)), ((ValueComparer)@float.GetValueComparer()).Snapshot(source.GetCurrentValue(@float)), (IEnumerable)source.GetCurrentValue(floatArray) == null ? null : (float[])((ValueComparer>)floatArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(floatArray))); + var liftedArg1 = (ISnapshot)new Snapshot, List, CompiledModelTestBase.EnumU32, CompiledModelTestBase.EnumU32[], CompiledModelTestBase.EnumU32, CompiledModelTestBase.EnumU32[], List, List, CompiledModelTestBase.EnumU64, CompiledModelTestBase.EnumU64[], CompiledModelTestBase.EnumU64, CompiledModelTestBase.EnumU64[], List, List, CompiledModelTestBase.EnumU64[][], CompiledModelTestBase.EnumU8, CompiledModelTestBase.EnumU8[], CompiledModelTestBase.EnumU8, CompiledModelTestBase.EnumU8[], List, List, float, float[]>((object)source.GetCurrentValue(enum8NestedCollection) == null ? null : (CompiledModelTestBase.Enum8[][])((ValueComparer)((IProperty)enum8NestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue(enum8NestedCollection)), ((ValueComparer)((IProperty)enumToNumberConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(enumToNumberConverterProperty)), ((ValueComparer)((IProperty)enumToStringConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(enumToStringConverterProperty)), ((ValueComparer)((IProperty)enumU16).GetValueComparer()).Snapshot(source.GetCurrentValue(enumU16)), (IEnumerable)source.GetCurrentValue(enumU16Array) == null ? null : (CompiledModelTestBase.EnumU16[])((ValueComparer>)((IProperty)enumU16Array).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enumU16Array)), ((ValueComparer)((IProperty)enumU16AsString).GetValueComparer()).Snapshot(source.GetCurrentValue(enumU16AsString)), (IEnumerable)source.GetCurrentValue(enumU16AsStringArray) == null ? null : (CompiledModelTestBase.EnumU16[])((ValueComparer>)((IProperty)enumU16AsStringArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enumU16AsStringArray)), (IEnumerable)source.GetCurrentValue>(enumU16AsStringCollection) == null ? null : (List)((ValueComparer>)((IProperty)enumU16AsStringCollection).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enumU16AsStringCollection)), (IEnumerable)source.GetCurrentValue>(enumU16Collection) == null ? null : (List)((ValueComparer>)((IProperty)enumU16Collection).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enumU16Collection)), ((ValueComparer)((IProperty)enumU32).GetValueComparer()).Snapshot(source.GetCurrentValue(enumU32)), (IEnumerable)source.GetCurrentValue(enumU32Array) == null ? null : (CompiledModelTestBase.EnumU32[])((ValueComparer>)((IProperty)enumU32Array).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enumU32Array)), ((ValueComparer)((IProperty)enumU32AsString).GetValueComparer()).Snapshot(source.GetCurrentValue(enumU32AsString)), (IEnumerable)source.GetCurrentValue(enumU32AsStringArray) == null ? null : (CompiledModelTestBase.EnumU32[])((ValueComparer>)((IProperty)enumU32AsStringArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enumU32AsStringArray)), (IEnumerable)source.GetCurrentValue>(enumU32AsStringCollection) == null ? null : (List)((ValueComparer>)((IProperty)enumU32AsStringCollection).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enumU32AsStringCollection)), (IEnumerable)source.GetCurrentValue>(enumU32Collection) == null ? null : (List)((ValueComparer>)((IProperty)enumU32Collection).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enumU32Collection)), ((ValueComparer)((IProperty)enumU64).GetValueComparer()).Snapshot(source.GetCurrentValue(enumU64)), (IEnumerable)source.GetCurrentValue(enumU64Array) == null ? null : (CompiledModelTestBase.EnumU64[])((ValueComparer>)((IProperty)enumU64Array).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enumU64Array)), ((ValueComparer)((IProperty)enumU64AsString).GetValueComparer()).Snapshot(source.GetCurrentValue(enumU64AsString)), (IEnumerable)source.GetCurrentValue(enumU64AsStringArray) == null ? null : (CompiledModelTestBase.EnumU64[])((ValueComparer>)((IProperty)enumU64AsStringArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enumU64AsStringArray)), (IEnumerable)source.GetCurrentValue>(enumU64AsStringCollection) == null ? null : (List)((ValueComparer>)((IProperty)enumU64AsStringCollection).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enumU64AsStringCollection)), (IEnumerable)source.GetCurrentValue>(enumU64Collection) == null ? null : (List)((ValueComparer>)((IProperty)enumU64Collection).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enumU64Collection)), (object)source.GetCurrentValue(enumU64NestedCollection) == null ? null : (CompiledModelTestBase.EnumU64[][])((ValueComparer)((IProperty)enumU64NestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue(enumU64NestedCollection)), ((ValueComparer)((IProperty)enumU8).GetValueComparer()).Snapshot(source.GetCurrentValue(enumU8)), (IEnumerable)source.GetCurrentValue(enumU8Array) == null ? null : (CompiledModelTestBase.EnumU8[])((ValueComparer>)((IProperty)enumU8Array).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enumU8Array)), ((ValueComparer)((IProperty)enumU8AsString).GetValueComparer()).Snapshot(source.GetCurrentValue(enumU8AsString)), (IEnumerable)source.GetCurrentValue(enumU8AsStringArray) == null ? null : (CompiledModelTestBase.EnumU8[])((ValueComparer>)((IProperty)enumU8AsStringArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enumU8AsStringArray)), (IEnumerable)source.GetCurrentValue>(enumU8AsStringCollection) == null ? null : (List)((ValueComparer>)((IProperty)enumU8AsStringCollection).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enumU8AsStringCollection)), (IEnumerable)source.GetCurrentValue>(enumU8Collection) == null ? null : (List)((ValueComparer>)((IProperty)enumU8Collection).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enumU8Collection)), ((ValueComparer)((IProperty)@float).GetValueComparer()).Snapshot(source.GetCurrentValue(@float)), (IEnumerable)source.GetCurrentValue(floatArray) == null ? null : (float[])((ValueComparer>)((IProperty)floatArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(floatArray))); var entity2 = (CompiledModelTestBase.ManyTypes)source.Entity; - var liftedArg2 = (ISnapshot)new Snapshot, Guid, Guid, IPAddress, IPAddress[], IPAddress, IPAddress, short, short[], int, int[], int[][], long, long[], IList[], sbyte, sbyte[], sbyte[][][], int, int, Nullable, Nullable, Nullable[], byte[], byte[][], byte[][][], Nullable, Nullable[]>(((ValueComparer)guid.GetValueComparer()).Snapshot(source.GetCurrentValue(guid)), (IEnumerable)source.GetCurrentValue(guidArray) == null ? null : (Guid[])((ValueComparer>)guidArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(guidArray)), (object)source.GetCurrentValue>(guidNestedCollection) == null ? null : (ICollection)((ValueComparer)guidNestedCollection.GetValueComparer()).Snapshot((object)source.GetCurrentValue>(guidNestedCollection)), ((ValueComparer)guidToBytesConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(guidToBytesConverterProperty)), ((ValueComparer)guidToStringConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(guidToStringConverterProperty)), source.GetCurrentValue(iPAddress) == null ? null : ((ValueComparer)iPAddress.GetValueComparer()).Snapshot(source.GetCurrentValue(iPAddress)), (object)source.GetCurrentValue(iPAddressArray) == null ? null : (IPAddress[])((ValueComparer)iPAddressArray.GetValueComparer()).Snapshot((object)source.GetCurrentValue(iPAddressArray)), source.GetCurrentValue(iPAddressToBytesConverterProperty) == null ? null : ((ValueComparer)iPAddressToBytesConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(iPAddressToBytesConverterProperty)), source.GetCurrentValue(iPAddressToStringConverterProperty) == null ? null : ((ValueComparer)iPAddressToStringConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(iPAddressToStringConverterProperty)), ((ValueComparer)int16.GetValueComparer()).Snapshot(source.GetCurrentValue(int16)), (IEnumerable)source.GetCurrentValue(int16Array) == null ? null : (short[])((ValueComparer>)int16Array.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(int16Array)), ((ValueComparer)int32.GetValueComparer()).Snapshot(source.GetCurrentValue(int32)), (IEnumerable)source.GetCurrentValue(int32Array) == null ? null : (int[])((ValueComparer>)int32Array.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(int32Array)), (object)source.GetCurrentValue(int32NestedCollection) == null ? null : (int[][])((ValueComparer)int32NestedCollection.GetValueComparer()).Snapshot((object)source.GetCurrentValue(int32NestedCollection)), ((ValueComparer)int64.GetValueComparer()).Snapshot(source.GetCurrentValue(int64)), (IEnumerable)source.GetCurrentValue(int64Array) == null ? null : (long[])((ValueComparer>)int64Array.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(int64Array)), (object)source.GetCurrentValue[]>(int64NestedCollection) == null ? null : (IList[])((ValueComparer)int64NestedCollection.GetValueComparer()).Snapshot((object)source.GetCurrentValue[]>(int64NestedCollection)), ((ValueComparer)int8.GetValueComparer()).Snapshot(source.GetCurrentValue(int8)), (IEnumerable)source.GetCurrentValue(int8Array) == null ? null : (sbyte[])((ValueComparer>)int8Array.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(int8Array)), (object)source.GetCurrentValue(int8NestedCollection) == null ? null : (sbyte[][][])((ValueComparer)int8NestedCollection.GetValueComparer()).Snapshot((object)source.GetCurrentValue(int8NestedCollection)), ((ValueComparer)intNumberToBytesConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(intNumberToBytesConverterProperty)), ((ValueComparer)intNumberToStringConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(intNumberToStringConverterProperty)), source.GetCurrentValue>(nullIntToNullStringConverterProperty) == null ? null : ((ValueComparer>)nullIntToNullStringConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullIntToNullStringConverterProperty)), source.GetCurrentValue>(nullableBool) == null ? null : ((ValueComparer>)nullableBool.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableBool)), (IEnumerable>)source.GetCurrentValue[]>(nullableBoolArray) == null ? null : (Nullable[])((ValueComparer>>)nullableBoolArray.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableBoolArray)), source.GetCurrentValue(nullableBytes) == null ? null : ((ValueComparer)nullableBytes.GetValueComparer()).Snapshot(source.GetCurrentValue(nullableBytes)), (object)source.GetCurrentValue(nullableBytesArray) == null ? null : (byte[][])((ValueComparer)nullableBytesArray.GetValueComparer()).Snapshot((object)source.GetCurrentValue(nullableBytesArray)), (object)source.GetCurrentValue(nullableBytesNestedCollection) == null ? null : (byte[][][])((ValueComparer)nullableBytesNestedCollection.GetValueComparer()).Snapshot((object)source.GetCurrentValue(nullableBytesNestedCollection)), source.GetCurrentValue>(nullableChar) == null ? null : ((ValueComparer>)nullableChar.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableChar)), (IEnumerable>)source.GetCurrentValue[]>(nullableCharArray) == null ? null : (Nullable[])((ValueComparer>>)nullableCharArray.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableCharArray))); + var liftedArg2 = (ISnapshot)new Snapshot, Guid, Guid, IPAddress, IPAddress[], IPAddress, IPAddress, short, short[], int, int[], int[][], long, long[], IList[], sbyte, sbyte[], sbyte[][][], int, int, Nullable, Nullable, Nullable[], byte[], byte[][], byte[][][], Nullable, Nullable[]>(((ValueComparer)((IProperty)guid).GetValueComparer()).Snapshot(source.GetCurrentValue(guid)), (IEnumerable)source.GetCurrentValue(guidArray) == null ? null : (Guid[])((ValueComparer>)((IProperty)guidArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(guidArray)), (object)source.GetCurrentValue>(guidNestedCollection) == null ? null : (ICollection)((ValueComparer)((IProperty)guidNestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(guidNestedCollection)), ((ValueComparer)((IProperty)guidToBytesConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(guidToBytesConverterProperty)), ((ValueComparer)((IProperty)guidToStringConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(guidToStringConverterProperty)), source.GetCurrentValue(iPAddress) == null ? null : ((ValueComparer)((IProperty)iPAddress).GetValueComparer()).Snapshot(source.GetCurrentValue(iPAddress)), (object)source.GetCurrentValue(iPAddressArray) == null ? null : (IPAddress[])((ValueComparer)((IProperty)iPAddressArray).GetValueComparer()).Snapshot((object)source.GetCurrentValue(iPAddressArray)), source.GetCurrentValue(iPAddressToBytesConverterProperty) == null ? null : ((ValueComparer)((IProperty)iPAddressToBytesConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(iPAddressToBytesConverterProperty)), source.GetCurrentValue(iPAddressToStringConverterProperty) == null ? null : ((ValueComparer)((IProperty)iPAddressToStringConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(iPAddressToStringConverterProperty)), ((ValueComparer)((IProperty)int16).GetValueComparer()).Snapshot(source.GetCurrentValue(int16)), (IEnumerable)source.GetCurrentValue(int16Array) == null ? null : (short[])((ValueComparer>)((IProperty)int16Array).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(int16Array)), ((ValueComparer)((IProperty)int32).GetValueComparer()).Snapshot(source.GetCurrentValue(int32)), (IEnumerable)source.GetCurrentValue(int32Array) == null ? null : (int[])((ValueComparer>)((IProperty)int32Array).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(int32Array)), (object)source.GetCurrentValue(int32NestedCollection) == null ? null : (int[][])((ValueComparer)((IProperty)int32NestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue(int32NestedCollection)), ((ValueComparer)((IProperty)int64).GetValueComparer()).Snapshot(source.GetCurrentValue(int64)), (IEnumerable)source.GetCurrentValue(int64Array) == null ? null : (long[])((ValueComparer>)((IProperty)int64Array).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(int64Array)), (object)source.GetCurrentValue[]>(int64NestedCollection) == null ? null : (IList[])((ValueComparer)((IProperty)int64NestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue[]>(int64NestedCollection)), ((ValueComparer)((IProperty)int8).GetValueComparer()).Snapshot(source.GetCurrentValue(int8)), (IEnumerable)source.GetCurrentValue(int8Array) == null ? null : (sbyte[])((ValueComparer>)((IProperty)int8Array).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(int8Array)), (object)source.GetCurrentValue(int8NestedCollection) == null ? null : (sbyte[][][])((ValueComparer)((IProperty)int8NestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue(int8NestedCollection)), ((ValueComparer)((IProperty)intNumberToBytesConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(intNumberToBytesConverterProperty)), ((ValueComparer)((IProperty)intNumberToStringConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(intNumberToStringConverterProperty)), source.GetCurrentValue>(nullIntToNullStringConverterProperty) == null ? null : ((ValueComparer>)((IProperty)nullIntToNullStringConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullIntToNullStringConverterProperty)), source.GetCurrentValue>(nullableBool) == null ? null : ((ValueComparer>)((IProperty)nullableBool).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableBool)), (IEnumerable>)source.GetCurrentValue[]>(nullableBoolArray) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableBoolArray).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableBoolArray)), source.GetCurrentValue(nullableBytes) == null ? null : ((ValueComparer)((IProperty)nullableBytes).GetValueComparer()).Snapshot(source.GetCurrentValue(nullableBytes)), (object)source.GetCurrentValue(nullableBytesArray) == null ? null : (byte[][])((ValueComparer)((IProperty)nullableBytesArray).GetValueComparer()).Snapshot((object)source.GetCurrentValue(nullableBytesArray)), (object)source.GetCurrentValue(nullableBytesNestedCollection) == null ? null : (byte[][][])((ValueComparer)((IProperty)nullableBytesNestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue(nullableBytesNestedCollection)), source.GetCurrentValue>(nullableChar) == null ? null : ((ValueComparer>)((IProperty)nullableChar).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableChar)), (IEnumerable>)source.GetCurrentValue[]>(nullableCharArray) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableCharArray).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableCharArray))); var entity3 = (CompiledModelTestBase.ManyTypes)source.Entity; - var liftedArg3 = (ISnapshot)new Snapshot, Nullable[], Nullable, Nullable[], Nullable, Nullable[], Nullable, Nullable[], Nullable, Nullable[], Nullable, Nullable[], List>, List>, Nullable, Nullable[], Nullable, Nullable[], List>, List>, Nullable[][][], Nullable, Nullable[], Nullable, Nullable[], List>, List>, Nullable, Nullable[], Nullable>(source.GetCurrentValue>(nullableDateOnly) == null ? null : ((ValueComparer>)nullableDateOnly.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableDateOnly)), (IEnumerable>)source.GetCurrentValue[]>(nullableDateOnlyArray) == null ? null : (Nullable[])((ValueComparer>>)nullableDateOnlyArray.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableDateOnlyArray)), source.GetCurrentValue>(nullableDateTime) == null ? null : ((ValueComparer>)nullableDateTime.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableDateTime)), (IEnumerable>)source.GetCurrentValue[]>(nullableDateTimeArray) == null ? null : (Nullable[])((ValueComparer>>)nullableDateTimeArray.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableDateTimeArray)), source.GetCurrentValue>(nullableDecimal) == null ? null : ((ValueComparer>)nullableDecimal.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableDecimal)), (IEnumerable>)source.GetCurrentValue[]>(nullableDecimalArray) == null ? null : (Nullable[])((ValueComparer>>)nullableDecimalArray.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableDecimalArray)), source.GetCurrentValue>(nullableDouble) == null ? null : ((ValueComparer>)nullableDouble.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableDouble)), (IEnumerable>)source.GetCurrentValue[]>(nullableDoubleArray) == null ? null : (Nullable[])((ValueComparer>>)nullableDoubleArray.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableDoubleArray)), source.GetCurrentValue>(nullableEnum16) == null ? null : ((ValueComparer>)nullableEnum16.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnum16)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnum16Array) == null ? null : (Nullable[])((ValueComparer>>)nullableEnum16Array.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnum16Array)), source.GetCurrentValue>(nullableEnum16AsString) == null ? null : ((ValueComparer>)nullableEnum16AsString.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnum16AsString)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnum16AsStringArray) == null ? null : (Nullable[])((ValueComparer>>)nullableEnum16AsStringArray.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnum16AsStringArray)), (IEnumerable>)source.GetCurrentValue>>(nullableEnum16AsStringCollection) == null ? null : (List>)((ValueComparer>>)nullableEnum16AsStringCollection.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnum16AsStringCollection)), (IEnumerable>)source.GetCurrentValue>>(nullableEnum16Collection) == null ? null : (List>)((ValueComparer>>)nullableEnum16Collection.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnum16Collection)), source.GetCurrentValue>(nullableEnum32) == null ? null : ((ValueComparer>)nullableEnum32.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnum32)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnum32Array) == null ? null : (Nullable[])((ValueComparer>>)nullableEnum32Array.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnum32Array)), source.GetCurrentValue>(nullableEnum32AsString) == null ? null : ((ValueComparer>)nullableEnum32AsString.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnum32AsString)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnum32AsStringArray) == null ? null : (Nullable[])((ValueComparer>>)nullableEnum32AsStringArray.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnum32AsStringArray)), (IEnumerable>)source.GetCurrentValue>>(nullableEnum32AsStringCollection) == null ? null : (List>)((ValueComparer>>)nullableEnum32AsStringCollection.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnum32AsStringCollection)), (IEnumerable>)source.GetCurrentValue>>(nullableEnum32Collection) == null ? null : (List>)((ValueComparer>>)nullableEnum32Collection.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnum32Collection)), (object)source.GetCurrentValue[][][]>(nullableEnum32NestedCollection) == null ? null : (Nullable[][][])((ValueComparer)nullableEnum32NestedCollection.GetValueComparer()).Snapshot((object)source.GetCurrentValue[][][]>(nullableEnum32NestedCollection)), source.GetCurrentValue>(nullableEnum64) == null ? null : ((ValueComparer>)nullableEnum64.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnum64)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnum64Array) == null ? null : (Nullable[])((ValueComparer>>)nullableEnum64Array.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnum64Array)), source.GetCurrentValue>(nullableEnum64AsString) == null ? null : ((ValueComparer>)nullableEnum64AsString.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnum64AsString)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnum64AsStringArray) == null ? null : (Nullable[])((ValueComparer>>)nullableEnum64AsStringArray.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnum64AsStringArray)), (IEnumerable>)source.GetCurrentValue>>(nullableEnum64AsStringCollection) == null ? null : (List>)((ValueComparer>>)nullableEnum64AsStringCollection.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnum64AsStringCollection)), (IEnumerable>)source.GetCurrentValue>>(nullableEnum64Collection) == null ? null : (List>)((ValueComparer>>)nullableEnum64Collection.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnum64Collection)), source.GetCurrentValue>(nullableEnum8) == null ? null : ((ValueComparer>)nullableEnum8.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnum8)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnum8Array) == null ? null : (Nullable[])((ValueComparer>>)nullableEnum8Array.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnum8Array)), source.GetCurrentValue>(nullableEnum8AsString) == null ? null : ((ValueComparer>)nullableEnum8AsString.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnum8AsString))); + var liftedArg3 = (ISnapshot)new Snapshot, Nullable[], Nullable, Nullable[], Nullable, Nullable[], Nullable, Nullable[], Nullable, Nullable[], Nullable, Nullable[], List>, List>, Nullable, Nullable[], Nullable, Nullable[], List>, List>, Nullable[][][], Nullable, Nullable[], Nullable, Nullable[], List>, List>, Nullable, Nullable[], Nullable>(source.GetCurrentValue>(nullableDateOnly) == null ? null : ((ValueComparer>)((IProperty)nullableDateOnly).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableDateOnly)), (IEnumerable>)source.GetCurrentValue[]>(nullableDateOnlyArray) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableDateOnlyArray).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableDateOnlyArray)), source.GetCurrentValue>(nullableDateTime) == null ? null : ((ValueComparer>)((IProperty)nullableDateTime).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableDateTime)), (IEnumerable>)source.GetCurrentValue[]>(nullableDateTimeArray) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableDateTimeArray).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableDateTimeArray)), source.GetCurrentValue>(nullableDecimal) == null ? null : ((ValueComparer>)((IProperty)nullableDecimal).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableDecimal)), (IEnumerable>)source.GetCurrentValue[]>(nullableDecimalArray) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableDecimalArray).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableDecimalArray)), source.GetCurrentValue>(nullableDouble) == null ? null : ((ValueComparer>)((IProperty)nullableDouble).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableDouble)), (IEnumerable>)source.GetCurrentValue[]>(nullableDoubleArray) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableDoubleArray).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableDoubleArray)), source.GetCurrentValue>(nullableEnum16) == null ? null : ((ValueComparer>)((IProperty)nullableEnum16).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnum16)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnum16Array) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableEnum16Array).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnum16Array)), source.GetCurrentValue>(nullableEnum16AsString) == null ? null : ((ValueComparer>)((IProperty)nullableEnum16AsString).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnum16AsString)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnum16AsStringArray) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableEnum16AsStringArray).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnum16AsStringArray)), (IEnumerable>)source.GetCurrentValue>>(nullableEnum16AsStringCollection) == null ? null : (List>)((ValueComparer>>)((IProperty)nullableEnum16AsStringCollection).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnum16AsStringCollection)), (IEnumerable>)source.GetCurrentValue>>(nullableEnum16Collection) == null ? null : (List>)((ValueComparer>>)((IProperty)nullableEnum16Collection).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnum16Collection)), source.GetCurrentValue>(nullableEnum32) == null ? null : ((ValueComparer>)((IProperty)nullableEnum32).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnum32)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnum32Array) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableEnum32Array).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnum32Array)), source.GetCurrentValue>(nullableEnum32AsString) == null ? null : ((ValueComparer>)((IProperty)nullableEnum32AsString).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnum32AsString)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnum32AsStringArray) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableEnum32AsStringArray).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnum32AsStringArray)), (IEnumerable>)source.GetCurrentValue>>(nullableEnum32AsStringCollection) == null ? null : (List>)((ValueComparer>>)((IProperty)nullableEnum32AsStringCollection).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnum32AsStringCollection)), (IEnumerable>)source.GetCurrentValue>>(nullableEnum32Collection) == null ? null : (List>)((ValueComparer>>)((IProperty)nullableEnum32Collection).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnum32Collection)), (object)source.GetCurrentValue[][][]>(nullableEnum32NestedCollection) == null ? null : (Nullable[][][])((ValueComparer)((IProperty)nullableEnum32NestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue[][][]>(nullableEnum32NestedCollection)), source.GetCurrentValue>(nullableEnum64) == null ? null : ((ValueComparer>)((IProperty)nullableEnum64).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnum64)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnum64Array) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableEnum64Array).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnum64Array)), source.GetCurrentValue>(nullableEnum64AsString) == null ? null : ((ValueComparer>)((IProperty)nullableEnum64AsString).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnum64AsString)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnum64AsStringArray) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableEnum64AsStringArray).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnum64AsStringArray)), (IEnumerable>)source.GetCurrentValue>>(nullableEnum64AsStringCollection) == null ? null : (List>)((ValueComparer>>)((IProperty)nullableEnum64AsStringCollection).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnum64AsStringCollection)), (IEnumerable>)source.GetCurrentValue>>(nullableEnum64Collection) == null ? null : (List>)((ValueComparer>>)((IProperty)nullableEnum64Collection).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnum64Collection)), source.GetCurrentValue>(nullableEnum8) == null ? null : ((ValueComparer>)((IProperty)nullableEnum8).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnum8)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnum8Array) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableEnum8Array).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnum8Array)), source.GetCurrentValue>(nullableEnum8AsString) == null ? null : ((ValueComparer>)((IProperty)nullableEnum8AsString).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnum8AsString))); var entity4 = (CompiledModelTestBase.ManyTypes)source.Entity; - var liftedArg4 = (ISnapshot)new Snapshot[], List>, List>, Nullable[][], Nullable, Nullable[], Nullable, Nullable[], List>, List>, Nullable, Nullable[], Nullable, Nullable[], List>, List>, Nullable, Nullable[], Nullable, Nullable[], List>, List>, Nullable[][], Nullable, Nullable[], Nullable, Nullable[], List>, List>, Nullable>((IEnumerable>)source.GetCurrentValue[]>(nullableEnum8AsStringArray) == null ? null : (Nullable[])((ValueComparer>>)nullableEnum8AsStringArray.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnum8AsStringArray)), (IEnumerable>)source.GetCurrentValue>>(nullableEnum8AsStringCollection) == null ? null : (List>)((ValueComparer>>)nullableEnum8AsStringCollection.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnum8AsStringCollection)), (IEnumerable>)source.GetCurrentValue>>(nullableEnum8Collection) == null ? null : (List>)((ValueComparer>>)nullableEnum8Collection.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnum8Collection)), (object)source.GetCurrentValue[][]>(nullableEnum8NestedCollection) == null ? null : (Nullable[][])((ValueComparer)nullableEnum8NestedCollection.GetValueComparer()).Snapshot((object)source.GetCurrentValue[][]>(nullableEnum8NestedCollection)), source.GetCurrentValue>(nullableEnumU16) == null ? null : ((ValueComparer>)nullableEnumU16.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnumU16)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnumU16Array) == null ? null : (Nullable[])((ValueComparer>>)nullableEnumU16Array.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnumU16Array)), source.GetCurrentValue>(nullableEnumU16AsString) == null ? null : ((ValueComparer>)nullableEnumU16AsString.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnumU16AsString)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnumU16AsStringArray) == null ? null : (Nullable[])((ValueComparer>>)nullableEnumU16AsStringArray.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnumU16AsStringArray)), (IEnumerable>)source.GetCurrentValue>>(nullableEnumU16AsStringCollection) == null ? null : (List>)((ValueComparer>>)nullableEnumU16AsStringCollection.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnumU16AsStringCollection)), (IEnumerable>)source.GetCurrentValue>>(nullableEnumU16Collection) == null ? null : (List>)((ValueComparer>>)nullableEnumU16Collection.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnumU16Collection)), source.GetCurrentValue>(nullableEnumU32) == null ? null : ((ValueComparer>)nullableEnumU32.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnumU32)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnumU32Array) == null ? null : (Nullable[])((ValueComparer>>)nullableEnumU32Array.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnumU32Array)), source.GetCurrentValue>(nullableEnumU32AsString) == null ? null : ((ValueComparer>)nullableEnumU32AsString.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnumU32AsString)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnumU32AsStringArray) == null ? null : (Nullable[])((ValueComparer>>)nullableEnumU32AsStringArray.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnumU32AsStringArray)), (IEnumerable>)source.GetCurrentValue>>(nullableEnumU32AsStringCollection) == null ? null : (List>)((ValueComparer>>)nullableEnumU32AsStringCollection.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnumU32AsStringCollection)), (IEnumerable>)source.GetCurrentValue>>(nullableEnumU32Collection) == null ? null : (List>)((ValueComparer>>)nullableEnumU32Collection.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnumU32Collection)), source.GetCurrentValue>(nullableEnumU64) == null ? null : ((ValueComparer>)nullableEnumU64.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnumU64)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnumU64Array) == null ? null : (Nullable[])((ValueComparer>>)nullableEnumU64Array.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnumU64Array)), source.GetCurrentValue>(nullableEnumU64AsString) == null ? null : ((ValueComparer>)nullableEnumU64AsString.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnumU64AsString)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnumU64AsStringArray) == null ? null : (Nullable[])((ValueComparer>>)nullableEnumU64AsStringArray.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnumU64AsStringArray)), (IEnumerable>)source.GetCurrentValue>>(nullableEnumU64AsStringCollection) == null ? null : (List>)((ValueComparer>>)nullableEnumU64AsStringCollection.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnumU64AsStringCollection)), (IEnumerable>)source.GetCurrentValue>>(nullableEnumU64Collection) == null ? null : (List>)((ValueComparer>>)nullableEnumU64Collection.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnumU64Collection)), (object)source.GetCurrentValue[][]>(nullableEnumU64NestedCollection) == null ? null : (Nullable[][])((ValueComparer)nullableEnumU64NestedCollection.GetValueComparer()).Snapshot((object)source.GetCurrentValue[][]>(nullableEnumU64NestedCollection)), source.GetCurrentValue>(nullableEnumU8) == null ? null : ((ValueComparer>)nullableEnumU8.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnumU8)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnumU8Array) == null ? null : (Nullable[])((ValueComparer>>)nullableEnumU8Array.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnumU8Array)), source.GetCurrentValue>(nullableEnumU8AsString) == null ? null : ((ValueComparer>)nullableEnumU8AsString.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnumU8AsString)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnumU8AsStringArray) == null ? null : (Nullable[])((ValueComparer>>)nullableEnumU8AsStringArray.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnumU8AsStringArray)), (IEnumerable>)source.GetCurrentValue>>(nullableEnumU8AsStringCollection) == null ? null : (List>)((ValueComparer>>)nullableEnumU8AsStringCollection.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnumU8AsStringCollection)), (IEnumerable>)source.GetCurrentValue>>(nullableEnumU8Collection) == null ? null : (List>)((ValueComparer>>)nullableEnumU8Collection.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnumU8Collection)), source.GetCurrentValue>(nullableFloat) == null ? null : ((ValueComparer>)nullableFloat.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableFloat))); + var liftedArg4 = (ISnapshot)new Snapshot[], List>, List>, Nullable[][], Nullable, Nullable[], Nullable, Nullable[], List>, List>, Nullable, Nullable[], Nullable, Nullable[], List>, List>, Nullable, Nullable[], Nullable, Nullable[], List>, List>, Nullable[][], Nullable, Nullable[], Nullable, Nullable[], List>, List>, Nullable>((IEnumerable>)source.GetCurrentValue[]>(nullableEnum8AsStringArray) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableEnum8AsStringArray).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnum8AsStringArray)), (IEnumerable>)source.GetCurrentValue>>(nullableEnum8AsStringCollection) == null ? null : (List>)((ValueComparer>>)((IProperty)nullableEnum8AsStringCollection).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnum8AsStringCollection)), (IEnumerable>)source.GetCurrentValue>>(nullableEnum8Collection) == null ? null : (List>)((ValueComparer>>)((IProperty)nullableEnum8Collection).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnum8Collection)), (object)source.GetCurrentValue[][]>(nullableEnum8NestedCollection) == null ? null : (Nullable[][])((ValueComparer)((IProperty)nullableEnum8NestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue[][]>(nullableEnum8NestedCollection)), source.GetCurrentValue>(nullableEnumU16) == null ? null : ((ValueComparer>)((IProperty)nullableEnumU16).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnumU16)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnumU16Array) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableEnumU16Array).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnumU16Array)), source.GetCurrentValue>(nullableEnumU16AsString) == null ? null : ((ValueComparer>)((IProperty)nullableEnumU16AsString).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnumU16AsString)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnumU16AsStringArray) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableEnumU16AsStringArray).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnumU16AsStringArray)), (IEnumerable>)source.GetCurrentValue>>(nullableEnumU16AsStringCollection) == null ? null : (List>)((ValueComparer>>)((IProperty)nullableEnumU16AsStringCollection).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnumU16AsStringCollection)), (IEnumerable>)source.GetCurrentValue>>(nullableEnumU16Collection) == null ? null : (List>)((ValueComparer>>)((IProperty)nullableEnumU16Collection).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnumU16Collection)), source.GetCurrentValue>(nullableEnumU32) == null ? null : ((ValueComparer>)((IProperty)nullableEnumU32).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnumU32)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnumU32Array) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableEnumU32Array).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnumU32Array)), source.GetCurrentValue>(nullableEnumU32AsString) == null ? null : ((ValueComparer>)((IProperty)nullableEnumU32AsString).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnumU32AsString)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnumU32AsStringArray) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableEnumU32AsStringArray).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnumU32AsStringArray)), (IEnumerable>)source.GetCurrentValue>>(nullableEnumU32AsStringCollection) == null ? null : (List>)((ValueComparer>>)((IProperty)nullableEnumU32AsStringCollection).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnumU32AsStringCollection)), (IEnumerable>)source.GetCurrentValue>>(nullableEnumU32Collection) == null ? null : (List>)((ValueComparer>>)((IProperty)nullableEnumU32Collection).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnumU32Collection)), source.GetCurrentValue>(nullableEnumU64) == null ? null : ((ValueComparer>)((IProperty)nullableEnumU64).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnumU64)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnumU64Array) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableEnumU64Array).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnumU64Array)), source.GetCurrentValue>(nullableEnumU64AsString) == null ? null : ((ValueComparer>)((IProperty)nullableEnumU64AsString).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnumU64AsString)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnumU64AsStringArray) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableEnumU64AsStringArray).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnumU64AsStringArray)), (IEnumerable>)source.GetCurrentValue>>(nullableEnumU64AsStringCollection) == null ? null : (List>)((ValueComparer>>)((IProperty)nullableEnumU64AsStringCollection).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnumU64AsStringCollection)), (IEnumerable>)source.GetCurrentValue>>(nullableEnumU64Collection) == null ? null : (List>)((ValueComparer>>)((IProperty)nullableEnumU64Collection).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnumU64Collection)), (object)source.GetCurrentValue[][]>(nullableEnumU64NestedCollection) == null ? null : (Nullable[][])((ValueComparer)((IProperty)nullableEnumU64NestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue[][]>(nullableEnumU64NestedCollection)), source.GetCurrentValue>(nullableEnumU8) == null ? null : ((ValueComparer>)((IProperty)nullableEnumU8).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnumU8)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnumU8Array) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableEnumU8Array).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnumU8Array)), source.GetCurrentValue>(nullableEnumU8AsString) == null ? null : ((ValueComparer>)((IProperty)nullableEnumU8AsString).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnumU8AsString)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnumU8AsStringArray) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableEnumU8AsStringArray).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnumU8AsStringArray)), (IEnumerable>)source.GetCurrentValue>>(nullableEnumU8AsStringCollection) == null ? null : (List>)((ValueComparer>>)((IProperty)nullableEnumU8AsStringCollection).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnumU8AsStringCollection)), (IEnumerable>)source.GetCurrentValue>>(nullableEnumU8Collection) == null ? null : (List>)((ValueComparer>>)((IProperty)nullableEnumU8Collection).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnumU8Collection)), source.GetCurrentValue>(nullableFloat) == null ? null : ((ValueComparer>)((IProperty)nullableFloat).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableFloat))); var entity5 = (CompiledModelTestBase.ManyTypes)source.Entity; - var liftedArg5 = (ISnapshot)new Snapshot[], Nullable, Nullable[], Nullable[][], IPAddress, IPAddress[], Nullable, Nullable[], Nullable, Nullable[], Nullable[][], Nullable, Nullable[], List[][]>, Nullable, Nullable[], PhysicalAddress, PhysicalAddress[], IEnumerable, string, string[], string[][], Nullable, Nullable[], Nullable, Nullable[], Nullable, Nullable[], Nullable, Nullable[]>((IEnumerable>)source.GetCurrentValue[]>(nullableFloatArray) == null ? null : (Nullable[])((ValueComparer>>)nullableFloatArray.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableFloatArray)), source.GetCurrentValue>(nullableGuid) == null ? null : ((ValueComparer>)nullableGuid.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableGuid)), (IEnumerable>)source.GetCurrentValue[]>(nullableGuidArray) == null ? null : (Nullable[])((ValueComparer>>)nullableGuidArray.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableGuidArray)), (object)source.GetCurrentValue[][]>(nullableGuidNestedCollection) == null ? null : (Nullable[][])((ValueComparer)nullableGuidNestedCollection.GetValueComparer()).Snapshot((object)source.GetCurrentValue[][]>(nullableGuidNestedCollection)), source.GetCurrentValue(nullableIPAddress) == null ? null : ((ValueComparer)nullableIPAddress.GetValueComparer()).Snapshot(source.GetCurrentValue(nullableIPAddress)), (object)source.GetCurrentValue(nullableIPAddressArray) == null ? null : (IPAddress[])((ValueComparer)nullableIPAddressArray.GetValueComparer()).Snapshot((object)source.GetCurrentValue(nullableIPAddressArray)), source.GetCurrentValue>(nullableInt16) == null ? null : ((ValueComparer>)nullableInt16.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableInt16)), (IEnumerable>)source.GetCurrentValue[]>(nullableInt16Array) == null ? null : (Nullable[])((ValueComparer>>)nullableInt16Array.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableInt16Array)), source.GetCurrentValue>(nullableInt32) == null ? null : ((ValueComparer>)nullableInt32.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableInt32)), (IEnumerable>)source.GetCurrentValue[]>(nullableInt32Array) == null ? null : (Nullable[])((ValueComparer>>)nullableInt32Array.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableInt32Array)), (object)source.GetCurrentValue[][]>(nullableInt32NestedCollection) == null ? null : (Nullable[][])((ValueComparer)nullableInt32NestedCollection.GetValueComparer()).Snapshot((object)source.GetCurrentValue[][]>(nullableInt32NestedCollection)), source.GetCurrentValue>(nullableInt64) == null ? null : ((ValueComparer>)nullableInt64.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableInt64)), (IEnumerable>)source.GetCurrentValue[]>(nullableInt64Array) == null ? null : (Nullable[])((ValueComparer>>)nullableInt64Array.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableInt64Array)), (object)source.GetCurrentValue[][]>>(nullableInt64NestedCollection) == null ? null : (List[][]>)((ValueComparer)nullableInt64NestedCollection.GetValueComparer()).Snapshot((object)source.GetCurrentValue[][]>>(nullableInt64NestedCollection)), source.GetCurrentValue>(nullableInt8) == null ? null : ((ValueComparer>)nullableInt8.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableInt8)), (IEnumerable>)source.GetCurrentValue[]>(nullableInt8Array) == null ? null : (Nullable[])((ValueComparer>>)nullableInt8Array.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableInt8Array)), source.GetCurrentValue(nullablePhysicalAddress) == null ? null : ((ValueComparer)nullablePhysicalAddress.GetValueComparer()).Snapshot(source.GetCurrentValue(nullablePhysicalAddress)), (object)source.GetCurrentValue(nullablePhysicalAddressArray) == null ? null : (PhysicalAddress[])((ValueComparer)nullablePhysicalAddressArray.GetValueComparer()).Snapshot((object)source.GetCurrentValue(nullablePhysicalAddressArray)), (object)source.GetCurrentValue>(nullablePhysicalAddressNestedCollection) == null ? null : (IEnumerable)((ValueComparer)nullablePhysicalAddressNestedCollection.GetValueComparer()).Snapshot((object)source.GetCurrentValue>(nullablePhysicalAddressNestedCollection)), source.GetCurrentValue(nullableString) == null ? null : ((ValueComparer)nullableString.GetValueComparer()).Snapshot(source.GetCurrentValue(nullableString)), (object)source.GetCurrentValue(nullableStringArray) == null ? null : (string[])((ValueComparer)nullableStringArray.GetValueComparer()).Snapshot((object)source.GetCurrentValue(nullableStringArray)), (object)source.GetCurrentValue(nullableStringNestedCollection) == null ? null : (string[][])((ValueComparer)nullableStringNestedCollection.GetValueComparer()).Snapshot((object)source.GetCurrentValue(nullableStringNestedCollection)), source.GetCurrentValue>(nullableTimeOnly) == null ? null : ((ValueComparer>)nullableTimeOnly.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableTimeOnly)), (IEnumerable>)source.GetCurrentValue[]>(nullableTimeOnlyArray) == null ? null : (Nullable[])((ValueComparer>>)nullableTimeOnlyArray.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableTimeOnlyArray)), source.GetCurrentValue>(nullableTimeSpan) == null ? null : ((ValueComparer>)nullableTimeSpan.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableTimeSpan)), (IEnumerable>)source.GetCurrentValue[]>(nullableTimeSpanArray) == null ? null : (Nullable[])((ValueComparer>>)nullableTimeSpanArray.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableTimeSpanArray)), source.GetCurrentValue>(nullableUInt16) == null ? null : ((ValueComparer>)nullableUInt16.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableUInt16)), (IEnumerable>)source.GetCurrentValue[]>(nullableUInt16Array) == null ? null : (Nullable[])((ValueComparer>>)nullableUInt16Array.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableUInt16Array)), source.GetCurrentValue>(nullableUInt32) == null ? null : ((ValueComparer>)nullableUInt32.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableUInt32)), (IEnumerable>)source.GetCurrentValue[]>(nullableUInt32Array) == null ? null : (Nullable[])((ValueComparer>>)nullableUInt32Array.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableUInt32Array))); + var liftedArg5 = (ISnapshot)new Snapshot[], Nullable, Nullable[], Nullable[][], IPAddress, IPAddress[], Nullable, Nullable[], Nullable, Nullable[], Nullable[][], Nullable, Nullable[], List[][]>, Nullable, Nullable[], PhysicalAddress, PhysicalAddress[], IEnumerable, string, string[], string[][], Nullable, Nullable[], Nullable, Nullable[], Nullable, Nullable[], Nullable, Nullable[]>((IEnumerable>)source.GetCurrentValue[]>(nullableFloatArray) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableFloatArray).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableFloatArray)), source.GetCurrentValue>(nullableGuid) == null ? null : ((ValueComparer>)((IProperty)nullableGuid).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableGuid)), (IEnumerable>)source.GetCurrentValue[]>(nullableGuidArray) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableGuidArray).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableGuidArray)), (object)source.GetCurrentValue[][]>(nullableGuidNestedCollection) == null ? null : (Nullable[][])((ValueComparer)((IProperty)nullableGuidNestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue[][]>(nullableGuidNestedCollection)), source.GetCurrentValue(nullableIPAddress) == null ? null : ((ValueComparer)((IProperty)nullableIPAddress).GetValueComparer()).Snapshot(source.GetCurrentValue(nullableIPAddress)), (object)source.GetCurrentValue(nullableIPAddressArray) == null ? null : (IPAddress[])((ValueComparer)((IProperty)nullableIPAddressArray).GetValueComparer()).Snapshot((object)source.GetCurrentValue(nullableIPAddressArray)), source.GetCurrentValue>(nullableInt16) == null ? null : ((ValueComparer>)((IProperty)nullableInt16).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableInt16)), (IEnumerable>)source.GetCurrentValue[]>(nullableInt16Array) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableInt16Array).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableInt16Array)), source.GetCurrentValue>(nullableInt32) == null ? null : ((ValueComparer>)((IProperty)nullableInt32).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableInt32)), (IEnumerable>)source.GetCurrentValue[]>(nullableInt32Array) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableInt32Array).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableInt32Array)), (object)source.GetCurrentValue[][]>(nullableInt32NestedCollection) == null ? null : (Nullable[][])((ValueComparer)((IProperty)nullableInt32NestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue[][]>(nullableInt32NestedCollection)), source.GetCurrentValue>(nullableInt64) == null ? null : ((ValueComparer>)((IProperty)nullableInt64).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableInt64)), (IEnumerable>)source.GetCurrentValue[]>(nullableInt64Array) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableInt64Array).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableInt64Array)), (object)source.GetCurrentValue[][]>>(nullableInt64NestedCollection) == null ? null : (List[][]>)((ValueComparer)((IProperty)nullableInt64NestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue[][]>>(nullableInt64NestedCollection)), source.GetCurrentValue>(nullableInt8) == null ? null : ((ValueComparer>)((IProperty)nullableInt8).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableInt8)), (IEnumerable>)source.GetCurrentValue[]>(nullableInt8Array) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableInt8Array).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableInt8Array)), source.GetCurrentValue(nullablePhysicalAddress) == null ? null : ((ValueComparer)((IProperty)nullablePhysicalAddress).GetValueComparer()).Snapshot(source.GetCurrentValue(nullablePhysicalAddress)), (object)source.GetCurrentValue(nullablePhysicalAddressArray) == null ? null : (PhysicalAddress[])((ValueComparer)((IProperty)nullablePhysicalAddressArray).GetValueComparer()).Snapshot((object)source.GetCurrentValue(nullablePhysicalAddressArray)), (object)source.GetCurrentValue>(nullablePhysicalAddressNestedCollection) == null ? null : (IEnumerable)((ValueComparer)((IProperty)nullablePhysicalAddressNestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(nullablePhysicalAddressNestedCollection)), source.GetCurrentValue(nullableString) == null ? null : ((ValueComparer)((IProperty)nullableString).GetValueComparer()).Snapshot(source.GetCurrentValue(nullableString)), (object)source.GetCurrentValue(nullableStringArray) == null ? null : (string[])((ValueComparer)((IProperty)nullableStringArray).GetValueComparer()).Snapshot((object)source.GetCurrentValue(nullableStringArray)), (object)source.GetCurrentValue(nullableStringNestedCollection) == null ? null : (string[][])((ValueComparer)((IProperty)nullableStringNestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue(nullableStringNestedCollection)), source.GetCurrentValue>(nullableTimeOnly) == null ? null : ((ValueComparer>)((IProperty)nullableTimeOnly).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableTimeOnly)), (IEnumerable>)source.GetCurrentValue[]>(nullableTimeOnlyArray) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableTimeOnlyArray).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableTimeOnlyArray)), source.GetCurrentValue>(nullableTimeSpan) == null ? null : ((ValueComparer>)((IProperty)nullableTimeSpan).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableTimeSpan)), (IEnumerable>)source.GetCurrentValue[]>(nullableTimeSpanArray) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableTimeSpanArray).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableTimeSpanArray)), source.GetCurrentValue>(nullableUInt16) == null ? null : ((ValueComparer>)((IProperty)nullableUInt16).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableUInt16)), (IEnumerable>)source.GetCurrentValue[]>(nullableUInt16Array) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableUInt16Array).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableUInt16Array)), source.GetCurrentValue>(nullableUInt32) == null ? null : ((ValueComparer>)((IProperty)nullableUInt32).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableUInt32)), (IEnumerable>)source.GetCurrentValue[]>(nullableUInt32Array) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableUInt32Array).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableUInt32Array))); var entity6 = (CompiledModelTestBase.ManyTypes)source.Entity; - var liftedArg6 = (ISnapshot)new Snapshot, Nullable[], Nullable, Nullable[], Nullable[][], Uri, Uri[], PhysicalAddress, PhysicalAddress[], PhysicalAddress, PhysicalAddress, string, string[], string[][], string, string, string, string, string, string, string, string, string, string, string, string, string, string, TimeOnly, TimeOnly[]>(source.GetCurrentValue>(nullableUInt64) == null ? null : ((ValueComparer>)nullableUInt64.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableUInt64)), (IEnumerable>)source.GetCurrentValue[]>(nullableUInt64Array) == null ? null : (Nullable[])((ValueComparer>>)nullableUInt64Array.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableUInt64Array)), source.GetCurrentValue>(nullableUInt8) == null ? null : ((ValueComparer>)nullableUInt8.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableUInt8)), (IEnumerable>)source.GetCurrentValue[]>(nullableUInt8Array) == null ? null : (Nullable[])((ValueComparer>>)nullableUInt8Array.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableUInt8Array)), (object)source.GetCurrentValue[][]>(nullableUInt8NestedCollection) == null ? null : (Nullable[][])((ValueComparer)nullableUInt8NestedCollection.GetValueComparer()).Snapshot((object)source.GetCurrentValue[][]>(nullableUInt8NestedCollection)), source.GetCurrentValue(nullableUri) == null ? null : ((ValueComparer)nullableUri.GetValueComparer()).Snapshot(source.GetCurrentValue(nullableUri)), (object)source.GetCurrentValue(nullableUriArray) == null ? null : (Uri[])((ValueComparer)nullableUriArray.GetValueComparer()).Snapshot((object)source.GetCurrentValue(nullableUriArray)), source.GetCurrentValue(physicalAddress) == null ? null : ((ValueComparer)physicalAddress.GetValueComparer()).Snapshot(source.GetCurrentValue(physicalAddress)), (object)source.GetCurrentValue(physicalAddressArray) == null ? null : (PhysicalAddress[])((ValueComparer)physicalAddressArray.GetValueComparer()).Snapshot((object)source.GetCurrentValue(physicalAddressArray)), source.GetCurrentValue(physicalAddressToBytesConverterProperty) == null ? null : ((ValueComparer)physicalAddressToBytesConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(physicalAddressToBytesConverterProperty)), source.GetCurrentValue(physicalAddressToStringConverterProperty) == null ? null : ((ValueComparer)physicalAddressToStringConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(physicalAddressToStringConverterProperty)), source.GetCurrentValue(@string) == null ? null : ((ValueComparer)@string.GetValueComparer()).Snapshot(source.GetCurrentValue(@string)), (object)source.GetCurrentValue(stringArray) == null ? null : (string[])((ValueComparer)stringArray.GetValueComparer()).Snapshot((object)source.GetCurrentValue(stringArray)), (object)source.GetCurrentValue(stringNestedCollection) == null ? null : (string[][])((ValueComparer)stringNestedCollection.GetValueComparer()).Snapshot((object)source.GetCurrentValue(stringNestedCollection)), source.GetCurrentValue(stringToBoolConverterProperty) == null ? null : ((ValueComparer)stringToBoolConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(stringToBoolConverterProperty)), source.GetCurrentValue(stringToBytesConverterProperty) == null ? null : ((ValueComparer)stringToBytesConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(stringToBytesConverterProperty)), source.GetCurrentValue(stringToCharConverterProperty) == null ? null : ((ValueComparer)stringToCharConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(stringToCharConverterProperty)), source.GetCurrentValue(stringToDateOnlyConverterProperty) == null ? null : ((ValueComparer)stringToDateOnlyConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(stringToDateOnlyConverterProperty)), source.GetCurrentValue(stringToDateTimeConverterProperty) == null ? null : ((ValueComparer)stringToDateTimeConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(stringToDateTimeConverterProperty)), source.GetCurrentValue(stringToDateTimeOffsetConverterProperty) == null ? null : ((ValueComparer)stringToDateTimeOffsetConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(stringToDateTimeOffsetConverterProperty)), source.GetCurrentValue(stringToDecimalNumberConverterProperty) == null ? null : ((ValueComparer)stringToDecimalNumberConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(stringToDecimalNumberConverterProperty)), source.GetCurrentValue(stringToDoubleNumberConverterProperty) == null ? null : ((ValueComparer)stringToDoubleNumberConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(stringToDoubleNumberConverterProperty)), source.GetCurrentValue(stringToEnumConverterProperty) == null ? null : ((ValueComparer)stringToEnumConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(stringToEnumConverterProperty)), source.GetCurrentValue(stringToGuidConverterProperty) == null ? null : ((ValueComparer)stringToGuidConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(stringToGuidConverterProperty)), source.GetCurrentValue(stringToIntNumberConverterProperty) == null ? null : ((ValueComparer)stringToIntNumberConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(stringToIntNumberConverterProperty)), source.GetCurrentValue(stringToTimeOnlyConverterProperty) == null ? null : ((ValueComparer)stringToTimeOnlyConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(stringToTimeOnlyConverterProperty)), source.GetCurrentValue(stringToTimeSpanConverterProperty) == null ? null : ((ValueComparer)stringToTimeSpanConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(stringToTimeSpanConverterProperty)), source.GetCurrentValue(stringToUriConverterProperty) == null ? null : ((ValueComparer)stringToUriConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(stringToUriConverterProperty)), ((ValueComparer)timeOnly.GetValueComparer()).Snapshot(source.GetCurrentValue(timeOnly)), (IEnumerable)source.GetCurrentValue(timeOnlyArray) == null ? null : (TimeOnly[])((ValueComparer>)timeOnlyArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(timeOnlyArray))); + var liftedArg6 = (ISnapshot)new Snapshot, Nullable[], Nullable, Nullable[], Nullable[][], Uri, Uri[], PhysicalAddress, PhysicalAddress[], PhysicalAddress, PhysicalAddress, string, string[], string[][], string, string, string, string, string, string, string, string, string, string, string, string, string, string, TimeOnly, TimeOnly[]>(source.GetCurrentValue>(nullableUInt64) == null ? null : ((ValueComparer>)((IProperty)nullableUInt64).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableUInt64)), (IEnumerable>)source.GetCurrentValue[]>(nullableUInt64Array) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableUInt64Array).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableUInt64Array)), source.GetCurrentValue>(nullableUInt8) == null ? null : ((ValueComparer>)((IProperty)nullableUInt8).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableUInt8)), (IEnumerable>)source.GetCurrentValue[]>(nullableUInt8Array) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableUInt8Array).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableUInt8Array)), (object)source.GetCurrentValue[][]>(nullableUInt8NestedCollection) == null ? null : (Nullable[][])((ValueComparer)((IProperty)nullableUInt8NestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue[][]>(nullableUInt8NestedCollection)), source.GetCurrentValue(nullableUri) == null ? null : ((ValueComparer)((IProperty)nullableUri).GetValueComparer()).Snapshot(source.GetCurrentValue(nullableUri)), (object)source.GetCurrentValue(nullableUriArray) == null ? null : (Uri[])((ValueComparer)((IProperty)nullableUriArray).GetValueComparer()).Snapshot((object)source.GetCurrentValue(nullableUriArray)), source.GetCurrentValue(physicalAddress) == null ? null : ((ValueComparer)((IProperty)physicalAddress).GetValueComparer()).Snapshot(source.GetCurrentValue(physicalAddress)), (object)source.GetCurrentValue(physicalAddressArray) == null ? null : (PhysicalAddress[])((ValueComparer)((IProperty)physicalAddressArray).GetValueComparer()).Snapshot((object)source.GetCurrentValue(physicalAddressArray)), source.GetCurrentValue(physicalAddressToBytesConverterProperty) == null ? null : ((ValueComparer)((IProperty)physicalAddressToBytesConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(physicalAddressToBytesConverterProperty)), source.GetCurrentValue(physicalAddressToStringConverterProperty) == null ? null : ((ValueComparer)((IProperty)physicalAddressToStringConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(physicalAddressToStringConverterProperty)), source.GetCurrentValue(@string) == null ? null : ((ValueComparer)((IProperty)@string).GetValueComparer()).Snapshot(source.GetCurrentValue(@string)), (object)source.GetCurrentValue(stringArray) == null ? null : (string[])((ValueComparer)((IProperty)stringArray).GetValueComparer()).Snapshot((object)source.GetCurrentValue(stringArray)), (object)source.GetCurrentValue(stringNestedCollection) == null ? null : (string[][])((ValueComparer)((IProperty)stringNestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue(stringNestedCollection)), source.GetCurrentValue(stringToBoolConverterProperty) == null ? null : ((ValueComparer)((IProperty)stringToBoolConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(stringToBoolConverterProperty)), source.GetCurrentValue(stringToBytesConverterProperty) == null ? null : ((ValueComparer)((IProperty)stringToBytesConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(stringToBytesConverterProperty)), source.GetCurrentValue(stringToCharConverterProperty) == null ? null : ((ValueComparer)((IProperty)stringToCharConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(stringToCharConverterProperty)), source.GetCurrentValue(stringToDateOnlyConverterProperty) == null ? null : ((ValueComparer)((IProperty)stringToDateOnlyConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(stringToDateOnlyConverterProperty)), source.GetCurrentValue(stringToDateTimeConverterProperty) == null ? null : ((ValueComparer)((IProperty)stringToDateTimeConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(stringToDateTimeConverterProperty)), source.GetCurrentValue(stringToDateTimeOffsetConverterProperty) == null ? null : ((ValueComparer)((IProperty)stringToDateTimeOffsetConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(stringToDateTimeOffsetConverterProperty)), source.GetCurrentValue(stringToDecimalNumberConverterProperty) == null ? null : ((ValueComparer)((IProperty)stringToDecimalNumberConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(stringToDecimalNumberConverterProperty)), source.GetCurrentValue(stringToDoubleNumberConverterProperty) == null ? null : ((ValueComparer)((IProperty)stringToDoubleNumberConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(stringToDoubleNumberConverterProperty)), source.GetCurrentValue(stringToEnumConverterProperty) == null ? null : ((ValueComparer)((IProperty)stringToEnumConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(stringToEnumConverterProperty)), source.GetCurrentValue(stringToGuidConverterProperty) == null ? null : ((ValueComparer)((IProperty)stringToGuidConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(stringToGuidConverterProperty)), source.GetCurrentValue(stringToIntNumberConverterProperty) == null ? null : ((ValueComparer)((IProperty)stringToIntNumberConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(stringToIntNumberConverterProperty)), source.GetCurrentValue(stringToTimeOnlyConverterProperty) == null ? null : ((ValueComparer)((IProperty)stringToTimeOnlyConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(stringToTimeOnlyConverterProperty)), source.GetCurrentValue(stringToTimeSpanConverterProperty) == null ? null : ((ValueComparer)((IProperty)stringToTimeSpanConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(stringToTimeSpanConverterProperty)), source.GetCurrentValue(stringToUriConverterProperty) == null ? null : ((ValueComparer)((IProperty)stringToUriConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(stringToUriConverterProperty)), ((ValueComparer)((IProperty)timeOnly).GetValueComparer()).Snapshot(source.GetCurrentValue(timeOnly)), (IEnumerable)source.GetCurrentValue(timeOnlyArray) == null ? null : (TimeOnly[])((ValueComparer>)((IProperty)timeOnlyArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(timeOnlyArray))); var entity7 = (CompiledModelTestBase.ManyTypes)source.Entity; - return (ISnapshot)new MultiSnapshot(new ISnapshot[] { liftedArg, liftedArg0, liftedArg1, liftedArg2, liftedArg3, liftedArg4, liftedArg5, liftedArg6, (ISnapshot)new Snapshot, Uri, Uri[], Uri>(((ValueComparer)timeOnlyToStringConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(timeOnlyToStringConverterProperty)), ((ValueComparer)timeOnlyToTicksConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(timeOnlyToTicksConverterProperty)), ((ValueComparer)timeSpan.GetValueComparer()).Snapshot(source.GetCurrentValue(timeSpan)), (IEnumerable)source.GetCurrentValue(timeSpanArray) == null ? null : (TimeSpan[])((ValueComparer>)timeSpanArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(timeSpanArray)), ((ValueComparer)timeSpanToStringConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(timeSpanToStringConverterProperty)), ((ValueComparer)timeSpanToTicksConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(timeSpanToTicksConverterProperty)), ((ValueComparer)uInt16.GetValueComparer()).Snapshot(source.GetCurrentValue(uInt16)), (IEnumerable)source.GetCurrentValue(uInt16Array) == null ? null : (ushort[])((ValueComparer>)uInt16Array.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(uInt16Array)), ((ValueComparer)uInt32.GetValueComparer()).Snapshot(source.GetCurrentValue(uInt32)), (IEnumerable)source.GetCurrentValue(uInt32Array) == null ? null : (uint[])((ValueComparer>)uInt32Array.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(uInt32Array)), ((ValueComparer)uInt64.GetValueComparer()).Snapshot(source.GetCurrentValue(uInt64)), (IEnumerable)source.GetCurrentValue(uInt64Array) == null ? null : (ulong[])((ValueComparer>)uInt64Array.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(uInt64Array)), ((ValueComparer)uInt8.GetValueComparer()).Snapshot(source.GetCurrentValue(uInt8)), source.GetCurrentValue(uInt8Array) == null ? null : ((ValueComparer)uInt8Array.GetValueComparer()).Snapshot(source.GetCurrentValue(uInt8Array)), (object)source.GetCurrentValue>(uInt8NestedCollection) == null ? null : (List)((ValueComparer)uInt8NestedCollection.GetValueComparer()).Snapshot((object)source.GetCurrentValue>(uInt8NestedCollection)), source.GetCurrentValue(uri) == null ? null : ((ValueComparer)uri.GetValueComparer()).Snapshot(source.GetCurrentValue(uri)), (object)source.GetCurrentValue(uriArray) == null ? null : (Uri[])((ValueComparer)uriArray.GetValueComparer()).Snapshot((object)source.GetCurrentValue(uriArray)), source.GetCurrentValue(uriToStringConverterProperty) == null ? null : ((ValueComparer)uriToStringConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(uriToStringConverterProperty))) }); + return (ISnapshot)new MultiSnapshot(new ISnapshot[] { liftedArg, liftedArg0, liftedArg1, liftedArg2, liftedArg3, liftedArg4, liftedArg5, liftedArg6, (ISnapshot)new Snapshot, Uri, Uri[], Uri>(((ValueComparer)((IProperty)timeOnlyToStringConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(timeOnlyToStringConverterProperty)), ((ValueComparer)((IProperty)timeOnlyToTicksConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(timeOnlyToTicksConverterProperty)), ((ValueComparer)((IProperty)timeSpan).GetValueComparer()).Snapshot(source.GetCurrentValue(timeSpan)), (IEnumerable)source.GetCurrentValue(timeSpanArray) == null ? null : (TimeSpan[])((ValueComparer>)((IProperty)timeSpanArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(timeSpanArray)), ((ValueComparer)((IProperty)timeSpanToStringConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(timeSpanToStringConverterProperty)), ((ValueComparer)((IProperty)timeSpanToTicksConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(timeSpanToTicksConverterProperty)), ((ValueComparer)((IProperty)uInt16).GetValueComparer()).Snapshot(source.GetCurrentValue(uInt16)), (IEnumerable)source.GetCurrentValue(uInt16Array) == null ? null : (ushort[])((ValueComparer>)((IProperty)uInt16Array).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(uInt16Array)), ((ValueComparer)((IProperty)uInt32).GetValueComparer()).Snapshot(source.GetCurrentValue(uInt32)), (IEnumerable)source.GetCurrentValue(uInt32Array) == null ? null : (uint[])((ValueComparer>)((IProperty)uInt32Array).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(uInt32Array)), ((ValueComparer)((IProperty)uInt64).GetValueComparer()).Snapshot(source.GetCurrentValue(uInt64)), (IEnumerable)source.GetCurrentValue(uInt64Array) == null ? null : (ulong[])((ValueComparer>)((IProperty)uInt64Array).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(uInt64Array)), ((ValueComparer)((IProperty)uInt8).GetValueComparer()).Snapshot(source.GetCurrentValue(uInt8)), source.GetCurrentValue(uInt8Array) == null ? null : ((ValueComparer)((IProperty)uInt8Array).GetValueComparer()).Snapshot(source.GetCurrentValue(uInt8Array)), (object)source.GetCurrentValue>(uInt8NestedCollection) == null ? null : (List)((ValueComparer)((IProperty)uInt8NestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(uInt8NestedCollection)), source.GetCurrentValue(uri) == null ? null : ((ValueComparer)((IProperty)uri).GetValueComparer()).Snapshot(source.GetCurrentValue(uri)), (object)source.GetCurrentValue(uriArray) == null ? null : (Uri[])((ValueComparer)((IProperty)uriArray).GetValueComparer()).Snapshot((object)source.GetCurrentValue(uriArray)), source.GetCurrentValue(uriToStringConverterProperty) == null ? null : ((ValueComparer)((IProperty)uriToStringConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(uriToStringConverterProperty))) }); }); runtimeEntityType.SetStoreGeneratedValuesFactory( - () => (ISnapshot)new Snapshot(((ValueComparer)id.GetValueComparer()).Snapshot(default(CompiledModelTestBase.ManyTypesId)))); + () => (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetValueComparer()).Snapshot(default(CompiledModelTestBase.ManyTypesId)))); runtimeEntityType.SetTemporaryValuesFactory( (InternalEntityEntry source) => (ISnapshot)new Snapshot(default(CompiledModelTestBase.ManyTypesId))); runtimeEntityType.SetShadowValuesFactory( @@ -17637,8 +17659,8 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) runtimeEntityType.SetRelationshipSnapshotFactory( (InternalEntityEntry source) => { - var entity = (CompiledModelTestBase.ManyTypes)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)id.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(id))); + var entity8 = (CompiledModelTestBase.ManyTypes)source.Entity; + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(id))); }); runtimeEntityType.Counts = new PropertyCounts( propertyCount: 258, @@ -17670,13 +17692,7 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) public static extern ref bool[] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BoolArray(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] - extern static ref bool[][] GetBoolNestedCollection(CompiledModelTestBase.ManyTypes @this); - - public static bool[][] ReadBoolNestedCollection(CompiledModelTestBase.ManyTypes @this) - => GetBoolNestedCollection(@this); - - public static void WriteBoolNestedCollection(CompiledModelTestBase.ManyTypes @this, bool[][] value) - => GetBoolNestedCollection(@this) = value; + public static extern ref bool[][] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BoolNestedCollection(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref bool UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BoolToStringConverterProperty(CompiledModelTestBase.ManyTypes @this); @@ -17694,13 +17710,7 @@ public static void WriteBoolNestedCollection(CompiledModelTestBase.ManyTypes @th public static extern ref byte[][] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BytesArray(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] - extern static ref byte[][][] GetBytesNestedCollection(CompiledModelTestBase.ManyTypes @this); - - public static byte[][][] ReadBytesNestedCollection(CompiledModelTestBase.ManyTypes @this) - => GetBytesNestedCollection(@this); - - public static void WriteBytesNestedCollection(CompiledModelTestBase.ManyTypes @this, byte[][][] value) - => GetBytesNestedCollection(@this) = value; + public static extern ref byte[][][] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BytesNestedCollection(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref byte[] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BytesToStringConverterProperty(CompiledModelTestBase.ManyTypes @this); @@ -17715,13 +17725,7 @@ public static void WriteBytesNestedCollection(CompiledModelTestBase.ManyTypes @t public static extern ref char[] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_CharArray(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] - extern static ref char[][] GetCharNestedCollection(CompiledModelTestBase.ManyTypes @this); - - public static char[][] ReadCharNestedCollection(CompiledModelTestBase.ManyTypes @this) - => GetCharNestedCollection(@this); - - public static void WriteCharNestedCollection(CompiledModelTestBase.ManyTypes @this, char[][] value) - => GetCharNestedCollection(@this) = value; + public static extern ref char[][] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_CharNestedCollection(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref char UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_CharToStringConverterProperty(CompiledModelTestBase.ManyTypes @this); @@ -17820,13 +17824,7 @@ public static void WriteCharNestedCollection(CompiledModelTestBase.ManyTypes @th public static extern ref List UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum32Collection(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] - extern static ref List[][] GetEnum32NestedCollection(CompiledModelTestBase.ManyTypes @this); - - public static List[][] ReadEnum32NestedCollection(CompiledModelTestBase.ManyTypes @this) - => GetEnum32NestedCollection(@this); - - public static void WriteEnum32NestedCollection(CompiledModelTestBase.ManyTypes @this, List[][] value) - => GetEnum32NestedCollection(@this) = value; + public static extern ref List[][] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum32NestedCollection(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref CompiledModelTestBase.Enum64 UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum64(CompiledModelTestBase.ManyTypes @this); @@ -17865,13 +17863,7 @@ public static void WriteEnum32NestedCollection(CompiledModelTestBase.ManyTypes @ public static extern ref List UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum8Collection(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] - extern static ref CompiledModelTestBase.Enum8[][] GetEnum8NestedCollection(CompiledModelTestBase.ManyTypes @this); - - public static CompiledModelTestBase.Enum8[][] ReadEnum8NestedCollection(CompiledModelTestBase.ManyTypes @this) - => GetEnum8NestedCollection(@this); - - public static void WriteEnum8NestedCollection(CompiledModelTestBase.ManyTypes @this, CompiledModelTestBase.Enum8[][] value) - => GetEnum8NestedCollection(@this) = value; + public static extern ref CompiledModelTestBase.Enum8[][] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum8NestedCollection(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref CompiledModelTestBase.Enum32 UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumToNumberConverterProperty(CompiledModelTestBase.ManyTypes @this); @@ -17934,13 +17926,7 @@ public static void WriteEnum8NestedCollection(CompiledModelTestBase.ManyTypes @t public static extern ref List UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU64Collection(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] - extern static ref CompiledModelTestBase.EnumU64[][] GetEnumU64NestedCollection(CompiledModelTestBase.ManyTypes @this); - - public static CompiledModelTestBase.EnumU64[][] ReadEnumU64NestedCollection(CompiledModelTestBase.ManyTypes @this) - => GetEnumU64NestedCollection(@this); - - public static void WriteEnumU64NestedCollection(CompiledModelTestBase.ManyTypes @this, CompiledModelTestBase.EnumU64[][] value) - => GetEnumU64NestedCollection(@this) = value; + public static extern ref CompiledModelTestBase.EnumU64[][] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU64NestedCollection(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref CompiledModelTestBase.EnumU8 UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU8(CompiledModelTestBase.ManyTypes @this); @@ -17973,13 +17959,7 @@ public static void WriteEnumU64NestedCollection(CompiledModelTestBase.ManyTypes public static extern ref Guid[] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_GuidArray(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] - extern static ref ICollection GetGuidNestedCollection(CompiledModelTestBase.ManyTypes @this); - - public static ICollection ReadGuidNestedCollection(CompiledModelTestBase.ManyTypes @this) - => GetGuidNestedCollection(@this); - - public static void WriteGuidNestedCollection(CompiledModelTestBase.ManyTypes @this, ICollection value) - => GetGuidNestedCollection(@this) = value; + public static extern ref ICollection UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_GuidNestedCollection(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref Guid UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_GuidToBytesConverterProperty(CompiledModelTestBase.ManyTypes @this); @@ -18012,13 +17992,7 @@ public static void WriteGuidNestedCollection(CompiledModelTestBase.ManyTypes @th public static extern ref int[] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int32Array(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] - extern static ref int[][] GetInt32NestedCollection(CompiledModelTestBase.ManyTypes @this); - - public static int[][] ReadInt32NestedCollection(CompiledModelTestBase.ManyTypes @this) - => GetInt32NestedCollection(@this); - - public static void WriteInt32NestedCollection(CompiledModelTestBase.ManyTypes @this, int[][] value) - => GetInt32NestedCollection(@this) = value; + public static extern ref int[][] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int32NestedCollection(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref long UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int64(CompiledModelTestBase.ManyTypes @this); @@ -18027,13 +18001,7 @@ public static void WriteInt32NestedCollection(CompiledModelTestBase.ManyTypes @t public static extern ref long[] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int64Array(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] - extern static ref IList[] GetInt64NestedCollection(CompiledModelTestBase.ManyTypes @this); - - public static IList[] ReadInt64NestedCollection(CompiledModelTestBase.ManyTypes @this) - => GetInt64NestedCollection(@this); - - public static void WriteInt64NestedCollection(CompiledModelTestBase.ManyTypes @this, IList[] value) - => GetInt64NestedCollection(@this) = value; + public static extern ref IList[] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int64NestedCollection(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref sbyte UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int8(CompiledModelTestBase.ManyTypes @this); @@ -18042,13 +18010,7 @@ public static void WriteInt64NestedCollection(CompiledModelTestBase.ManyTypes @t public static extern ref sbyte[] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int8Array(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] - extern static ref sbyte[][][] GetInt8NestedCollection(CompiledModelTestBase.ManyTypes @this); - - public static sbyte[][][] ReadInt8NestedCollection(CompiledModelTestBase.ManyTypes @this) - => GetInt8NestedCollection(@this); - - public static void WriteInt8NestedCollection(CompiledModelTestBase.ManyTypes @this, sbyte[][][] value) - => GetInt8NestedCollection(@this) = value; + public static extern ref sbyte[][][] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int8NestedCollection(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref int UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_IntNumberToBytesConverterProperty(CompiledModelTestBase.ManyTypes @this); @@ -18072,13 +18034,7 @@ public static void WriteInt8NestedCollection(CompiledModelTestBase.ManyTypes @th public static extern ref byte[][] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableBytesArray(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] - extern static ref byte[][][] GetNullableBytesNestedCollection(CompiledModelTestBase.ManyTypes @this); - - public static byte[][][] ReadNullableBytesNestedCollection(CompiledModelTestBase.ManyTypes @this) - => GetNullableBytesNestedCollection(@this); - - public static void WriteNullableBytesNestedCollection(CompiledModelTestBase.ManyTypes @this, byte[][][] value) - => GetNullableBytesNestedCollection(@this) = value; + public static extern ref byte[][][] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableBytesNestedCollection(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref char? UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableChar(CompiledModelTestBase.ManyTypes @this); @@ -18147,13 +18103,7 @@ public static void WriteNullableBytesNestedCollection(CompiledModelTestBase.Many public static extern ref List UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum32Collection(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] - extern static ref CompiledModelTestBase.Enum32?[][][] GetNullableEnum32NestedCollection(CompiledModelTestBase.ManyTypes @this); - - public static CompiledModelTestBase.Enum32?[][][] ReadNullableEnum32NestedCollection(CompiledModelTestBase.ManyTypes @this) - => GetNullableEnum32NestedCollection(@this); - - public static void WriteNullableEnum32NestedCollection(CompiledModelTestBase.ManyTypes @this, CompiledModelTestBase.Enum32?[][][] value) - => GetNullableEnum32NestedCollection(@this) = value; + public static extern ref CompiledModelTestBase.Enum32?[][][] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum32NestedCollection(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref CompiledModelTestBase.Enum64? UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum64(CompiledModelTestBase.ManyTypes @this); @@ -18192,13 +18142,7 @@ public static void WriteNullableEnum32NestedCollection(CompiledModelTestBase.Man public static extern ref List UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum8Collection(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] - extern static ref CompiledModelTestBase.Enum8?[][] GetNullableEnum8NestedCollection(CompiledModelTestBase.ManyTypes @this); - - public static CompiledModelTestBase.Enum8?[][] ReadNullableEnum8NestedCollection(CompiledModelTestBase.ManyTypes @this) - => GetNullableEnum8NestedCollection(@this); - - public static void WriteNullableEnum8NestedCollection(CompiledModelTestBase.ManyTypes @this, CompiledModelTestBase.Enum8?[][] value) - => GetNullableEnum8NestedCollection(@this) = value; + public static extern ref CompiledModelTestBase.Enum8?[][] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum8NestedCollection(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref CompiledModelTestBase.EnumU16? UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU16(CompiledModelTestBase.ManyTypes @this); @@ -18255,13 +18199,7 @@ public static void WriteNullableEnum8NestedCollection(CompiledModelTestBase.Many public static extern ref List UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU64Collection(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] - extern static ref CompiledModelTestBase.EnumU64?[][] GetNullableEnumU64NestedCollection(CompiledModelTestBase.ManyTypes @this); - - public static CompiledModelTestBase.EnumU64?[][] ReadNullableEnumU64NestedCollection(CompiledModelTestBase.ManyTypes @this) - => GetNullableEnumU64NestedCollection(@this); - - public static void WriteNullableEnumU64NestedCollection(CompiledModelTestBase.ManyTypes @this, CompiledModelTestBase.EnumU64?[][] value) - => GetNullableEnumU64NestedCollection(@this) = value; + public static extern ref CompiledModelTestBase.EnumU64?[][] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU64NestedCollection(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref CompiledModelTestBase.EnumU8? UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU8(CompiledModelTestBase.ManyTypes @this); @@ -18294,13 +18232,7 @@ public static void WriteNullableEnumU64NestedCollection(CompiledModelTestBase.Ma public static extern ref Guid?[] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableGuidArray(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] - extern static ref Guid?[][] GetNullableGuidNestedCollection(CompiledModelTestBase.ManyTypes @this); - - public static Guid?[][] ReadNullableGuidNestedCollection(CompiledModelTestBase.ManyTypes @this) - => GetNullableGuidNestedCollection(@this); - - public static void WriteNullableGuidNestedCollection(CompiledModelTestBase.ManyTypes @this, Guid?[][] value) - => GetNullableGuidNestedCollection(@this) = value; + public static extern ref Guid?[][] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableGuidNestedCollection(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref IPAddress UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableIPAddress(CompiledModelTestBase.ManyTypes @this); @@ -18321,13 +18253,7 @@ public static void WriteNullableGuidNestedCollection(CompiledModelTestBase.ManyT public static extern ref int?[] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt32Array(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] - extern static ref int?[][] GetNullableInt32NestedCollection(CompiledModelTestBase.ManyTypes @this); - - public static int?[][] ReadNullableInt32NestedCollection(CompiledModelTestBase.ManyTypes @this) - => GetNullableInt32NestedCollection(@this); - - public static void WriteNullableInt32NestedCollection(CompiledModelTestBase.ManyTypes @this, int?[][] value) - => GetNullableInt32NestedCollection(@this) = value; + public static extern ref int?[][] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt32NestedCollection(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref long? UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt64(CompiledModelTestBase.ManyTypes @this); @@ -18336,13 +18262,7 @@ public static void WriteNullableInt32NestedCollection(CompiledModelTestBase.Many public static extern ref long?[] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt64Array(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] - extern static ref List GetNullableInt64NestedCollection(CompiledModelTestBase.ManyTypes @this); - - public static List ReadNullableInt64NestedCollection(CompiledModelTestBase.ManyTypes @this) - => GetNullableInt64NestedCollection(@this); - - public static void WriteNullableInt64NestedCollection(CompiledModelTestBase.ManyTypes @this, List value) - => GetNullableInt64NestedCollection(@this) = value; + public static extern ref List UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt64NestedCollection(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref sbyte? UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt8(CompiledModelTestBase.ManyTypes @this); @@ -18357,13 +18277,7 @@ public static void WriteNullableInt64NestedCollection(CompiledModelTestBase.Many public static extern ref PhysicalAddress[] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullablePhysicalAddressArray(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] - extern static ref IEnumerable GetNullablePhysicalAddressNestedCollection(CompiledModelTestBase.ManyTypes @this); - - public static IEnumerable ReadNullablePhysicalAddressNestedCollection(CompiledModelTestBase.ManyTypes @this) - => GetNullablePhysicalAddressNestedCollection(@this); - - public static void WriteNullablePhysicalAddressNestedCollection(CompiledModelTestBase.ManyTypes @this, IEnumerable value) - => GetNullablePhysicalAddressNestedCollection(@this) = value; + public static extern ref IEnumerable UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullablePhysicalAddressNestedCollection(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref string UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableString(CompiledModelTestBase.ManyTypes @this); @@ -18372,13 +18286,7 @@ public static void WriteNullablePhysicalAddressNestedCollection(CompiledModelTes public static extern ref string[] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableStringArray(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] - extern static ref string[][] GetNullableStringNestedCollection(CompiledModelTestBase.ManyTypes @this); - - public static string[][] ReadNullableStringNestedCollection(CompiledModelTestBase.ManyTypes @this) - => GetNullableStringNestedCollection(@this); - - public static void WriteNullableStringNestedCollection(CompiledModelTestBase.ManyTypes @this, string[][] value) - => GetNullableStringNestedCollection(@this) = value; + public static extern ref string[][] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableStringNestedCollection(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref TimeOnly? UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableTimeOnly(CompiledModelTestBase.ManyTypes @this); @@ -18417,13 +18325,7 @@ public static void WriteNullableStringNestedCollection(CompiledModelTestBase.Man public static extern ref byte?[] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUInt8Array(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] - extern static ref byte?[][] GetNullableUInt8NestedCollection(CompiledModelTestBase.ManyTypes @this); - - public static byte?[][] ReadNullableUInt8NestedCollection(CompiledModelTestBase.ManyTypes @this) - => GetNullableUInt8NestedCollection(@this); - - public static void WriteNullableUInt8NestedCollection(CompiledModelTestBase.ManyTypes @this, byte?[][] value) - => GetNullableUInt8NestedCollection(@this) = value; + public static extern ref byte?[][] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUInt8NestedCollection(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref Uri UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUri(CompiledModelTestBase.ManyTypes @this); @@ -18450,13 +18352,7 @@ public static void WriteNullableUInt8NestedCollection(CompiledModelTestBase.Many public static extern ref string[] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringArray(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] - extern static ref string[][] GetStringNestedCollection(CompiledModelTestBase.ManyTypes @this); - - public static string[][] ReadStringNestedCollection(CompiledModelTestBase.ManyTypes @this) - => GetStringNestedCollection(@this); - - public static void WriteStringNestedCollection(CompiledModelTestBase.ManyTypes @this, string[][] value) - => GetStringNestedCollection(@this) = value; + public static extern ref string[][] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringNestedCollection(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref string UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringToBoolConverterProperty(CompiledModelTestBase.ManyTypes @this); @@ -18549,13 +18445,7 @@ public static void WriteStringNestedCollection(CompiledModelTestBase.ManyTypes @ public static extern ref byte[] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UInt8Array(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] - extern static ref List GetUInt8NestedCollection(CompiledModelTestBase.ManyTypes @this); - - public static List ReadUInt8NestedCollection(CompiledModelTestBase.ManyTypes @this) - => GetUInt8NestedCollection(@this); - - public static void WriteUInt8NestedCollection(CompiledModelTestBase.ManyTypes @this, List value) - => GetUInt8NestedCollection(@this) = value; + public static extern ref List UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UInt8NestedCollection(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref Uri UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Uri(CompiledModelTestBase.ManyTypes @this); diff --git a/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/BigModel_with_JSON_columns/OwnedType0EntityType.cs b/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/BigModel_with_JSON_columns/OwnedType0EntityType.cs index 14748e17004..b91e54a89c7 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/BigModel_with_JSON_columns/OwnedType0EntityType.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/BigModel_with_JSON_columns/OwnedType0EntityType.cs @@ -50,15 +50,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas principalDerivedId.TypeMapping = SqlServerLongTypeMapping.Default.Clone( comparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), keyComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v)); principalDerivedId.SetCurrentValueComparer(new EntryCurrentValueComparer(principalDerivedId)); principalDerivedId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); @@ -77,15 +77,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas principalDerivedAlternateId.TypeMapping = GuidTypeMapping.Default.Clone( comparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), keyComparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), providerValueComparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "uniqueidentifier")); @@ -150,15 +150,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas details.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -241,15 +241,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas refTypeArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -259,27 +259,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)))), elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), keyComparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(45)", @@ -287,12 +287,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))); refTypeArray.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); refTypeArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("OwnedType0EntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_OwnedType__refTypeArray", "TestNamespace") }); @@ -327,15 +327,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas refTypeEnumerable.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer, string>(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), keyComparer: new ListOfReferenceTypesComparer, string>(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -349,15 +349,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -397,15 +397,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas refTypeIList.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer, string>(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), keyComparer: new ListOfReferenceTypesComparer, string>(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -419,15 +419,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -467,15 +467,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas refTypeList.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer, IPAddress>(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), keyComparer: new ListOfReferenceTypesComparer, IPAddress>(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -485,27 +485,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter, IPAddress>( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)))), elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), keyComparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(45)", @@ -513,12 +513,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))); refTypeList.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); refTypeList.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("OwnedType0EntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_OwnedType__refTypeList", "TestNamespace") }); @@ -553,15 +553,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas valueTypeArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer(new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v)), keyComparer: new ListOfValueTypesComparer(new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -575,15 +575,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerDateTimeTypeMapping.Default.Clone( comparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v), keyComparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v), providerValueComparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v))); valueTypeArray.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); valueTypeArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("OwnedType0EntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_OwnedType__valueTypeArray", "TestNamespace") }); @@ -626,7 +626,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (byte v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -691,7 +691,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (byte v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -756,7 +756,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (short v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -865,11 +865,11 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) runtimeEntityType.SetOriginalValuesFactory( (InternalEntityEntry source) => { - var entity = (CompiledModelTestBase.OwnedType)source.Entity; - return (ISnapshot)new Snapshot, IList, List, DateTime[], IEnumerable, IList, List>(((ValueComparer)principalDerivedId.GetValueComparer()).Snapshot(source.GetCurrentValue(principalDerivedId)), ((ValueComparer)principalDerivedAlternateId.GetValueComparer()).Snapshot(source.GetCurrentValue(principalDerivedAlternateId)), ((ValueComparer)id.GetValueComparer()).Snapshot(source.GetCurrentValue(id)), source.GetCurrentValue(details) == null ? null : ((ValueComparer)details.GetValueComparer()).Snapshot(source.GetCurrentValue(details)), ((ValueComparer)number.GetValueComparer()).Snapshot(source.GetCurrentValue(number)), (object)source.GetCurrentValue(refTypeArray) == null ? null : (IPAddress[])((ValueComparer)refTypeArray.GetValueComparer()).Snapshot((object)source.GetCurrentValue(refTypeArray)), (object)source.GetCurrentValue>(refTypeEnumerable) == null ? null : (IEnumerable)((ValueComparer)refTypeEnumerable.GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeEnumerable)), (object)source.GetCurrentValue>(refTypeIList) == null ? null : (IList)((ValueComparer)refTypeIList.GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeIList)), (object)source.GetCurrentValue>(refTypeList) == null ? null : (List)((ValueComparer)refTypeList.GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeList)), (IEnumerable)source.GetCurrentValue(valueTypeArray) == null ? null : (DateTime[])((ValueComparer>)valueTypeArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(valueTypeArray)), source.GetCurrentValue>(valueTypeEnumerable) == null ? null : ((ValueComparer>)valueTypeEnumerable.GetValueComparer()).Snapshot(source.GetCurrentValue>(valueTypeEnumerable)), (IEnumerable)source.GetCurrentValue>(valueTypeIList) == null ? null : (IList)((ValueComparer>)valueTypeIList.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeIList)), (IEnumerable)source.GetCurrentValue>(valueTypeList) == null ? null : (List)((ValueComparer>)valueTypeList.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeList))); + var entity8 = (CompiledModelTestBase.OwnedType)source.Entity; + return (ISnapshot)new Snapshot, IList, List, DateTime[], IEnumerable, IList, List>(((ValueComparer)((IProperty)principalDerivedId).GetValueComparer()).Snapshot(source.GetCurrentValue(principalDerivedId)), ((ValueComparer)((IProperty)principalDerivedAlternateId).GetValueComparer()).Snapshot(source.GetCurrentValue(principalDerivedAlternateId)), ((ValueComparer)((IProperty)id).GetValueComparer()).Snapshot(source.GetCurrentValue(id)), source.GetCurrentValue(details) == null ? null : ((ValueComparer)((IProperty)details).GetValueComparer()).Snapshot(source.GetCurrentValue(details)), ((ValueComparer)((IProperty)number).GetValueComparer()).Snapshot(source.GetCurrentValue(number)), (object)source.GetCurrentValue(refTypeArray) == null ? null : (IPAddress[])((ValueComparer)((IProperty)refTypeArray).GetValueComparer()).Snapshot((object)source.GetCurrentValue(refTypeArray)), (object)source.GetCurrentValue>(refTypeEnumerable) == null ? null : (IEnumerable)((ValueComparer)((IProperty)refTypeEnumerable).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeEnumerable)), (object)source.GetCurrentValue>(refTypeIList) == null ? null : (IList)((ValueComparer)((IProperty)refTypeIList).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeIList)), (object)source.GetCurrentValue>(refTypeList) == null ? null : (List)((ValueComparer)((IProperty)refTypeList).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeList)), (IEnumerable)source.GetCurrentValue(valueTypeArray) == null ? null : (DateTime[])((ValueComparer>)((IProperty)valueTypeArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(valueTypeArray)), source.GetCurrentValue>(valueTypeEnumerable) == null ? null : ((ValueComparer>)((IProperty)valueTypeEnumerable).GetValueComparer()).Snapshot(source.GetCurrentValue>(valueTypeEnumerable)), (IEnumerable)source.GetCurrentValue>(valueTypeIList) == null ? null : (IList)((ValueComparer>)((IProperty)valueTypeIList).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeIList)), (IEnumerable)source.GetCurrentValue>(valueTypeList) == null ? null : (List)((ValueComparer>)((IProperty)valueTypeList).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeList))); }); runtimeEntityType.SetStoreGeneratedValuesFactory( - () => (ISnapshot)new Snapshot(((ValueComparer)principalDerivedId.GetValueComparer()).Snapshot(default(long)), ((ValueComparer)principalDerivedAlternateId.GetValueComparer()).Snapshot(default(Guid)), ((ValueComparer)id.GetValueComparer()).Snapshot(default(int)))); + () => (ISnapshot)new Snapshot(((ValueComparer)((IProperty)principalDerivedId).GetValueComparer()).Snapshot(default(long)), ((ValueComparer)((IProperty)principalDerivedAlternateId).GetValueComparer()).Snapshot(default(Guid)), ((ValueComparer)((IProperty)id).GetValueComparer()).Snapshot(default(int)))); runtimeEntityType.SetTemporaryValuesFactory( (InternalEntityEntry source) => (ISnapshot)new Snapshot(default(long), default(Guid), default(int))); runtimeEntityType.SetShadowValuesFactory( @@ -879,8 +879,8 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) runtimeEntityType.SetRelationshipSnapshotFactory( (InternalEntityEntry source) => { - var entity = (CompiledModelTestBase.OwnedType)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)principalDerivedId.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalDerivedId)), ((ValueComparer)principalDerivedAlternateId.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalDerivedAlternateId)), ((ValueComparer)id.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(id))); + var entity8 = (CompiledModelTestBase.OwnedType)source.Entity; + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)principalDerivedId).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalDerivedId)), ((ValueComparer)((IProperty)principalDerivedAlternateId).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalDerivedAlternateId)), ((ValueComparer)((IProperty)id).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(id))); }); runtimeEntityType.Counts = new PropertyCounts( propertyCount: 13, diff --git a/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/BigModel_with_JSON_columns/OwnedTypeEntityType.cs b/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/BigModel_with_JSON_columns/OwnedTypeEntityType.cs index 94da2a1321e..d9dc5ce52df 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/BigModel_with_JSON_columns/OwnedTypeEntityType.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/BigModel_with_JSON_columns/OwnedTypeEntityType.cs @@ -52,15 +52,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas principalBaseId.TypeMapping = SqlServerLongTypeMapping.Default.Clone( comparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), keyComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v)); principalBaseId.SetCurrentValueComparer(new EntryCurrentValueComparer(principalBaseId)); principalBaseId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); @@ -80,15 +80,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas principalBaseAlternateId.TypeMapping = GuidTypeMapping.Default.Clone( comparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), keyComparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), providerValueComparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "uniqueidentifier")); @@ -126,15 +126,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas details.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -219,15 +219,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas refTypeArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -237,27 +237,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)))), elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), keyComparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(45)", @@ -265,12 +265,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))); refTypeArray.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); refTypeArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("OwnedTypeEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_OwnedType__refTypeArray", "TestNamespace") }); @@ -306,15 +306,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas refTypeEnumerable.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer, string>(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), keyComparer: new ListOfReferenceTypesComparer, string>(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -328,15 +328,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -377,15 +377,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas refTypeIList.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer, string>(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), keyComparer: new ListOfReferenceTypesComparer, string>(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -399,15 +399,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -448,15 +448,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas refTypeList.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer, IPAddress>(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), keyComparer: new ListOfReferenceTypesComparer, IPAddress>(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -466,27 +466,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter, IPAddress>( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)))), elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), keyComparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(45)", @@ -494,12 +494,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))); refTypeList.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); refTypeList.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("OwnedTypeEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_OwnedType__refTypeList", "TestNamespace") }); @@ -535,15 +535,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas valueTypeArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer(new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v)), keyComparer: new ListOfValueTypesComparer(new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -557,15 +557,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerDateTimeTypeMapping.Default.Clone( comparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v), keyComparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v), providerValueComparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v))); valueTypeArray.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); valueTypeArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("OwnedTypeEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_OwnedType__valueTypeArray", "TestNamespace") }); @@ -609,7 +609,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (byte v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -675,7 +675,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (byte v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -741,7 +741,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (short v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -848,11 +848,11 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) runtimeEntityType.SetOriginalValuesFactory( (InternalEntityEntry source) => { - var entity = (CompiledModelTestBase.OwnedType)source.Entity; - return (ISnapshot)new Snapshot, IList, List, DateTime[], IEnumerable, IList, List>(((ValueComparer)principalBaseId.GetValueComparer()).Snapshot(source.GetCurrentValue(principalBaseId)), ((ValueComparer)principalBaseAlternateId.GetValueComparer()).Snapshot(source.GetCurrentValue(principalBaseAlternateId)), source.GetCurrentValue(details) == null ? null : ((ValueComparer)details.GetValueComparer()).Snapshot(source.GetCurrentValue(details)), ((ValueComparer)number.GetValueComparer()).Snapshot(source.GetCurrentValue(number)), (object)source.GetCurrentValue(refTypeArray) == null ? null : (IPAddress[])((ValueComparer)refTypeArray.GetValueComparer()).Snapshot((object)source.GetCurrentValue(refTypeArray)), (object)source.GetCurrentValue>(refTypeEnumerable) == null ? null : (IEnumerable)((ValueComparer)refTypeEnumerable.GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeEnumerable)), (object)source.GetCurrentValue>(refTypeIList) == null ? null : (IList)((ValueComparer)refTypeIList.GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeIList)), (object)source.GetCurrentValue>(refTypeList) == null ? null : (List)((ValueComparer)refTypeList.GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeList)), (IEnumerable)source.GetCurrentValue(valueTypeArray) == null ? null : (DateTime[])((ValueComparer>)valueTypeArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(valueTypeArray)), source.GetCurrentValue>(valueTypeEnumerable) == null ? null : ((ValueComparer>)valueTypeEnumerable.GetValueComparer()).Snapshot(source.GetCurrentValue>(valueTypeEnumerable)), (IEnumerable)source.GetCurrentValue>(valueTypeIList) == null ? null : (IList)((ValueComparer>)valueTypeIList.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeIList)), (IEnumerable)source.GetCurrentValue>(valueTypeList) == null ? null : (List)((ValueComparer>)valueTypeList.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeList))); + var entity8 = (CompiledModelTestBase.OwnedType)source.Entity; + return (ISnapshot)new Snapshot, IList, List, DateTime[], IEnumerable, IList, List>(((ValueComparer)((IProperty)principalBaseId).GetValueComparer()).Snapshot(source.GetCurrentValue(principalBaseId)), ((ValueComparer)((IProperty)principalBaseAlternateId).GetValueComparer()).Snapshot(source.GetCurrentValue(principalBaseAlternateId)), source.GetCurrentValue(details) == null ? null : ((ValueComparer)((IProperty)details).GetValueComparer()).Snapshot(source.GetCurrentValue(details)), ((ValueComparer)((IProperty)number).GetValueComparer()).Snapshot(source.GetCurrentValue(number)), (object)source.GetCurrentValue(refTypeArray) == null ? null : (IPAddress[])((ValueComparer)((IProperty)refTypeArray).GetValueComparer()).Snapshot((object)source.GetCurrentValue(refTypeArray)), (object)source.GetCurrentValue>(refTypeEnumerable) == null ? null : (IEnumerable)((ValueComparer)((IProperty)refTypeEnumerable).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeEnumerable)), (object)source.GetCurrentValue>(refTypeIList) == null ? null : (IList)((ValueComparer)((IProperty)refTypeIList).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeIList)), (object)source.GetCurrentValue>(refTypeList) == null ? null : (List)((ValueComparer)((IProperty)refTypeList).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeList)), (IEnumerable)source.GetCurrentValue(valueTypeArray) == null ? null : (DateTime[])((ValueComparer>)((IProperty)valueTypeArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(valueTypeArray)), source.GetCurrentValue>(valueTypeEnumerable) == null ? null : ((ValueComparer>)((IProperty)valueTypeEnumerable).GetValueComparer()).Snapshot(source.GetCurrentValue>(valueTypeEnumerable)), (IEnumerable)source.GetCurrentValue>(valueTypeIList) == null ? null : (IList)((ValueComparer>)((IProperty)valueTypeIList).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeIList)), (IEnumerable)source.GetCurrentValue>(valueTypeList) == null ? null : (List)((ValueComparer>)((IProperty)valueTypeList).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeList))); }); runtimeEntityType.SetStoreGeneratedValuesFactory( - () => (ISnapshot)new Snapshot(((ValueComparer)principalBaseId.GetValueComparer()).Snapshot(default(long)), ((ValueComparer)principalBaseAlternateId.GetValueComparer()).Snapshot(default(Guid)))); + () => (ISnapshot)new Snapshot(((ValueComparer)((IProperty)principalBaseId).GetValueComparer()).Snapshot(default(long)), ((ValueComparer)((IProperty)principalBaseAlternateId).GetValueComparer()).Snapshot(default(Guid)))); runtimeEntityType.SetTemporaryValuesFactory( (InternalEntityEntry source) => (ISnapshot)new Snapshot(default(long), default(Guid))); runtimeEntityType.SetShadowValuesFactory( @@ -862,8 +862,8 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) runtimeEntityType.SetRelationshipSnapshotFactory( (InternalEntityEntry source) => { - var entity = (CompiledModelTestBase.OwnedType)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)principalBaseId.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalBaseId)), ((ValueComparer)principalBaseAlternateId.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalBaseAlternateId))); + var entity8 = (CompiledModelTestBase.OwnedType)source.Entity; + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)principalBaseId).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalBaseId)), ((ValueComparer)((IProperty)principalBaseAlternateId).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalBaseAlternateId))); }); runtimeEntityType.Counts = new PropertyCounts( propertyCount: 12, diff --git a/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/BigModel_with_JSON_columns/PrincipalBaseEntityType.cs b/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/BigModel_with_JSON_columns/PrincipalBaseEntityType.cs index 0bc31794646..3996d082302 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/BigModel_with_JSON_columns/PrincipalBaseEntityType.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/BigModel_with_JSON_columns/PrincipalBaseEntityType.cs @@ -70,15 +70,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas id.TypeMapping = SqlServerLongTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable)), providerValueComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable))); id.SetCurrentValueComparer(new EntryCurrentValueComparer(id)); id.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); @@ -116,15 +116,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas alternateId.TypeMapping = GuidTypeMapping.Default.Clone( comparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), keyComparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), providerValueComparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "uniqueidentifier")); @@ -146,15 +146,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas discriminator.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(55)", @@ -192,11 +192,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum1.TypeMapping = IntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.AnEnum v1, CompiledModelTestBase.AnEnum v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.AnEnum v) => v.GetHashCode(), + (CompiledModelTestBase.AnEnum v) => ((object)v).GetHashCode(), (CompiledModelTestBase.AnEnum v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.AnEnum v1, CompiledModelTestBase.AnEnum v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.AnEnum v) => v.GetHashCode(), + (CompiledModelTestBase.AnEnum v) => ((object)v).GetHashCode(), (CompiledModelTestBase.AnEnum v) => v), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -244,11 +244,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum2.TypeMapping = IntTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.AnEnum)v1, (object)(CompiledModelTestBase.AnEnum)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.AnEnum)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.AnEnum)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.AnEnum)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.AnEnum)v1, (object)(CompiledModelTestBase.AnEnum)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.AnEnum)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.AnEnum)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.AnEnum)v : default(Nullable)), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -294,11 +294,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas flagsEnum1.TypeMapping = IntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.AFlagsEnum v1, CompiledModelTestBase.AFlagsEnum v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.AFlagsEnum v) => v.GetHashCode(), + (CompiledModelTestBase.AFlagsEnum v) => ((object)v).GetHashCode(), (CompiledModelTestBase.AFlagsEnum v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.AFlagsEnum v1, CompiledModelTestBase.AFlagsEnum v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.AFlagsEnum v) => v.GetHashCode(), + (CompiledModelTestBase.AFlagsEnum v) => ((object)v).GetHashCode(), (CompiledModelTestBase.AFlagsEnum v) => v), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -346,11 +346,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas flagsEnum2.TypeMapping = IntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.AFlagsEnum v1, CompiledModelTestBase.AFlagsEnum v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.AFlagsEnum v) => v.GetHashCode(), + (CompiledModelTestBase.AFlagsEnum v) => ((object)v).GetHashCode(), (CompiledModelTestBase.AFlagsEnum v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.AFlagsEnum v1, CompiledModelTestBase.AFlagsEnum v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.AFlagsEnum v) => v.GetHashCode(), + (CompiledModelTestBase.AFlagsEnum v) => ((object)v).GetHashCode(), (CompiledModelTestBase.AFlagsEnum v) => v), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -398,15 +398,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas refTypeArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -416,27 +416,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)))), elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), keyComparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(45)", @@ -444,12 +444,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))); refTypeArray.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); refTypeArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("PrincipalBaseEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalBase_RefTypeArray", "TestNamespace") }); @@ -484,15 +484,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas refTypeEnumerable.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer, string>(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), keyComparer: new ListOfReferenceTypesComparer, string>(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -506,15 +506,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -554,15 +554,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas refTypeIList.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer, string>(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), keyComparer: new ListOfReferenceTypesComparer, string>(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -576,15 +576,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -624,15 +624,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas refTypeList.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer, IPAddress>(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), keyComparer: new ListOfReferenceTypesComparer, IPAddress>(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -642,27 +642,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter, IPAddress>( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)))), elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), keyComparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(45)", @@ -670,12 +670,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))); refTypeList.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); refTypeList.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("PrincipalBaseEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalBase_RefTypeList", "TestNamespace") }); @@ -710,15 +710,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas valueTypeArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer(new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v)), keyComparer: new ListOfValueTypesComparer(new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -732,15 +732,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerDateTimeTypeMapping.Default.Clone( comparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v), keyComparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v), providerValueComparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v))); valueTypeArray.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); valueTypeArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("PrincipalBaseEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalBase_ValueTypeArray", "TestNamespace") }); @@ -783,7 +783,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (byte v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -848,7 +848,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (byte v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -913,7 +913,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (short v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -1028,8 +1028,8 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) runtimeEntityType.SetOriginalValuesFactory( (InternalEntityEntry source) => { - var entity = (CompiledModelTestBase.PrincipalBase)source.Entity; - return (ISnapshot)new Snapshot, Guid, string, CompiledModelTestBase.AnEnum, Nullable, CompiledModelTestBase.AFlagsEnum, CompiledModelTestBase.AFlagsEnum, IPAddress[], IEnumerable, IList, List, DateTime[], IEnumerable, IList, List>(source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)id.GetValueComparer()).Snapshot(source.GetCurrentValue>(id)), ((ValueComparer)alternateId.GetValueComparer()).Snapshot(source.GetCurrentValue(alternateId)), source.GetCurrentValue(discriminator) == null ? null : ((ValueComparer)discriminator.GetValueComparer()).Snapshot(source.GetCurrentValue(discriminator)), ((ValueComparer)enum1.GetValueComparer()).Snapshot(source.GetCurrentValue(enum1)), source.GetCurrentValue>(enum2) == null ? null : ((ValueComparer>)enum2.GetValueComparer()).Snapshot(source.GetCurrentValue>(enum2)), ((ValueComparer)flagsEnum1.GetValueComparer()).Snapshot(source.GetCurrentValue(flagsEnum1)), ((ValueComparer)flagsEnum2.GetValueComparer()).Snapshot(source.GetCurrentValue(flagsEnum2)), (object)source.GetCurrentValue(refTypeArray) == null ? null : (IPAddress[])((ValueComparer)refTypeArray.GetValueComparer()).Snapshot((object)source.GetCurrentValue(refTypeArray)), (object)source.GetCurrentValue>(refTypeEnumerable) == null ? null : (IEnumerable)((ValueComparer)refTypeEnumerable.GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeEnumerable)), (object)source.GetCurrentValue>(refTypeIList) == null ? null : (IList)((ValueComparer)refTypeIList.GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeIList)), (object)source.GetCurrentValue>(refTypeList) == null ? null : (List)((ValueComparer)refTypeList.GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeList)), (IEnumerable)source.GetCurrentValue(valueTypeArray) == null ? null : (DateTime[])((ValueComparer>)valueTypeArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(valueTypeArray)), source.GetCurrentValue>(valueTypeEnumerable) == null ? null : ((ValueComparer>)valueTypeEnumerable.GetValueComparer()).Snapshot(source.GetCurrentValue>(valueTypeEnumerable)), (IEnumerable)source.GetCurrentValue>(valueTypeIList) == null ? null : (IList)((ValueComparer>)valueTypeIList.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeIList)), (IEnumerable)source.GetCurrentValue>(valueTypeList) == null ? null : (List)((ValueComparer>)valueTypeList.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeList))); + var entity8 = (CompiledModelTestBase.PrincipalBase)source.Entity; + return (ISnapshot)new Snapshot, Guid, string, CompiledModelTestBase.AnEnum, Nullable, CompiledModelTestBase.AFlagsEnum, CompiledModelTestBase.AFlagsEnum, IPAddress[], IEnumerable, IList, List, DateTime[], IEnumerable, IList, List>(source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)((IProperty)id).GetValueComparer()).Snapshot(source.GetCurrentValue>(id)), ((ValueComparer)((IProperty)alternateId).GetValueComparer()).Snapshot(source.GetCurrentValue(alternateId)), source.GetCurrentValue(discriminator) == null ? null : ((ValueComparer)((IProperty)discriminator).GetValueComparer()).Snapshot(source.GetCurrentValue(discriminator)), ((ValueComparer)((IProperty)enum1).GetValueComparer()).Snapshot(source.GetCurrentValue(enum1)), source.GetCurrentValue>(enum2) == null ? null : ((ValueComparer>)((IProperty)enum2).GetValueComparer()).Snapshot(source.GetCurrentValue>(enum2)), ((ValueComparer)((IProperty)flagsEnum1).GetValueComparer()).Snapshot(source.GetCurrentValue(flagsEnum1)), ((ValueComparer)((IProperty)flagsEnum2).GetValueComparer()).Snapshot(source.GetCurrentValue(flagsEnum2)), (object)source.GetCurrentValue(refTypeArray) == null ? null : (IPAddress[])((ValueComparer)((IProperty)refTypeArray).GetValueComparer()).Snapshot((object)source.GetCurrentValue(refTypeArray)), (object)source.GetCurrentValue>(refTypeEnumerable) == null ? null : (IEnumerable)((ValueComparer)((IProperty)refTypeEnumerable).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeEnumerable)), (object)source.GetCurrentValue>(refTypeIList) == null ? null : (IList)((ValueComparer)((IProperty)refTypeIList).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeIList)), (object)source.GetCurrentValue>(refTypeList) == null ? null : (List)((ValueComparer)((IProperty)refTypeList).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeList)), (IEnumerable)source.GetCurrentValue(valueTypeArray) == null ? null : (DateTime[])((ValueComparer>)((IProperty)valueTypeArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(valueTypeArray)), source.GetCurrentValue>(valueTypeEnumerable) == null ? null : ((ValueComparer>)((IProperty)valueTypeEnumerable).GetValueComparer()).Snapshot(source.GetCurrentValue>(valueTypeEnumerable)), (IEnumerable)source.GetCurrentValue>(valueTypeIList) == null ? null : (IList)((ValueComparer>)((IProperty)valueTypeIList).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeIList)), (IEnumerable)source.GetCurrentValue>(valueTypeList) == null ? null : (List)((ValueComparer>)((IProperty)valueTypeList).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeList))); }); runtimeEntityType.SetStoreGeneratedValuesFactory( () => Snapshot.Empty); @@ -1042,8 +1042,8 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) runtimeEntityType.SetRelationshipSnapshotFactory( (InternalEntityEntry source) => { - var entity = (CompiledModelTestBase.PrincipalBase)source.Entity; - return (ISnapshot)new Snapshot, Guid, object, object>(source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)id.GetKeyValueComparer()).Snapshot(source.GetCurrentValue>(id)), ((ValueComparer)alternateId.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(alternateId)), UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalBase__ownedField(entity), null); + var entity8 = (CompiledModelTestBase.PrincipalBase)source.Entity; + return (ISnapshot)new Snapshot, Guid, object, object>(source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)((IProperty)id).GetKeyValueComparer()).Snapshot(source.GetCurrentValue>(id)), ((ValueComparer)((IProperty)alternateId).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(alternateId)), UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalBase__ownedField(entity8), null); }); runtimeEntityType.Counts = new PropertyCounts( propertyCount: 15, diff --git a/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/BigModel_with_JSON_columns/PrincipalBasePrincipalDerivedDependentBasebyteEntityType.cs b/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/BigModel_with_JSON_columns/PrincipalBasePrincipalDerivedDependentBasebyteEntityType.cs index a5340f1d2b7..402eec2c194 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/BigModel_with_JSON_columns/PrincipalBasePrincipalDerivedDependentBasebyteEntityType.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/BigModel_with_JSON_columns/PrincipalBasePrincipalDerivedDependentBasebyteEntityType.cs @@ -41,10 +41,10 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas propertyInfo: runtimeEntityType.FindIndexerPropertyInfo(), afterSaveBehavior: PropertySaveBehavior.Throw); derivedsId.SetGetter( - (Dictionary entity) => (entity.ContainsKey("DerivedsId") ? entity["DerivedsId"] : null) == null ? 0L : (long)(entity.ContainsKey("DerivedsId") ? entity["DerivedsId"] : null), - (Dictionary entity) => (entity.ContainsKey("DerivedsId") ? entity["DerivedsId"] : null) == null, - (Dictionary instance) => (instance.ContainsKey("DerivedsId") ? instance["DerivedsId"] : null) == null ? 0L : (long)(instance.ContainsKey("DerivedsId") ? instance["DerivedsId"] : null), - (Dictionary instance) => (instance.ContainsKey("DerivedsId") ? instance["DerivedsId"] : null) == null); + (Dictionary entity) => (((IDictionary)entity).ContainsKey("DerivedsId") ? entity["DerivedsId"] : null) == null ? 0L : (long)(((IDictionary)entity).ContainsKey("DerivedsId") ? entity["DerivedsId"] : null), + (Dictionary entity) => (((IDictionary)entity).ContainsKey("DerivedsId") ? entity["DerivedsId"] : null) == null, + (Dictionary instance) => (((IDictionary)instance).ContainsKey("DerivedsId") ? instance["DerivedsId"] : null) == null ? 0L : (long)(((IDictionary)instance).ContainsKey("DerivedsId") ? instance["DerivedsId"] : null), + (Dictionary instance) => (((IDictionary)instance).ContainsKey("DerivedsId") ? instance["DerivedsId"] : null) == null); derivedsId.SetSetter( (Dictionary entity, long value) => entity["DerivedsId"] = (object)value); derivedsId.SetMaterializationSetter( @@ -59,13 +59,13 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas else { { - if (entry.FlaggedAsTemporary(0) && (((Dictionary)entry.Entity).ContainsKey("DerivedsId") ? ((Dictionary)entry.Entity)["DerivedsId"] : null) == null) + if (entry.FlaggedAsTemporary(0) && (((IDictionary)(Dictionary)entry.Entity).ContainsKey("DerivedsId") ? ((Dictionary)entry.Entity)["DerivedsId"] : null) == null) { return entry.ReadTemporaryValue(0); } else { - var nullableValue = ((Dictionary)entry.Entity).ContainsKey("DerivedsId") ? ((Dictionary)entry.Entity)["DerivedsId"] : null; + var nullableValue = ((IDictionary)(Dictionary)entry.Entity).ContainsKey("DerivedsId") ? ((Dictionary)entry.Entity)["DerivedsId"] : null; return nullableValue == null ? default(long) : (long)nullableValue; } } @@ -73,7 +73,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas }, (InternalEntityEntry entry) => { - var nullableValue = ((Dictionary)entry.Entity).ContainsKey("DerivedsId") ? ((Dictionary)entry.Entity)["DerivedsId"] : null; + var nullableValue = ((IDictionary)(Dictionary)entry.Entity).ContainsKey("DerivedsId") ? ((Dictionary)entry.Entity)["DerivedsId"] : null; return nullableValue == null ? default(long) : (long)nullableValue; }, (InternalEntityEntry entry) => entry.ReadOriginalValue(derivedsId, 0), @@ -88,15 +88,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas derivedsId.TypeMapping = SqlServerLongTypeMapping.Default.Clone( comparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), keyComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v)); derivedsId.SetCurrentValueComparer(new EntryCurrentValueComparer(derivedsId)); derivedsId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); @@ -107,10 +107,10 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas propertyInfo: runtimeEntityType.FindIndexerPropertyInfo(), afterSaveBehavior: PropertySaveBehavior.Throw); derivedsAlternateId.SetGetter( - (Dictionary entity) => (entity.ContainsKey("DerivedsAlternateId") ? entity["DerivedsAlternateId"] : null) == null ? new Guid("00000000-0000-0000-0000-000000000000") : (Guid)(entity.ContainsKey("DerivedsAlternateId") ? entity["DerivedsAlternateId"] : null), - (Dictionary entity) => (entity.ContainsKey("DerivedsAlternateId") ? entity["DerivedsAlternateId"] : null) == null, - (Dictionary instance) => (instance.ContainsKey("DerivedsAlternateId") ? instance["DerivedsAlternateId"] : null) == null ? new Guid("00000000-0000-0000-0000-000000000000") : (Guid)(instance.ContainsKey("DerivedsAlternateId") ? instance["DerivedsAlternateId"] : null), - (Dictionary instance) => (instance.ContainsKey("DerivedsAlternateId") ? instance["DerivedsAlternateId"] : null) == null); + (Dictionary entity) => (((IDictionary)entity).ContainsKey("DerivedsAlternateId") ? entity["DerivedsAlternateId"] : null) == null ? new Guid("00000000-0000-0000-0000-000000000000") : (Guid)(((IDictionary)entity).ContainsKey("DerivedsAlternateId") ? entity["DerivedsAlternateId"] : null), + (Dictionary entity) => (((IDictionary)entity).ContainsKey("DerivedsAlternateId") ? entity["DerivedsAlternateId"] : null) == null, + (Dictionary instance) => (((IDictionary)instance).ContainsKey("DerivedsAlternateId") ? instance["DerivedsAlternateId"] : null) == null ? new Guid("00000000-0000-0000-0000-000000000000") : (Guid)(((IDictionary)instance).ContainsKey("DerivedsAlternateId") ? instance["DerivedsAlternateId"] : null), + (Dictionary instance) => (((IDictionary)instance).ContainsKey("DerivedsAlternateId") ? instance["DerivedsAlternateId"] : null) == null); derivedsAlternateId.SetSetter( (Dictionary entity, Guid value) => entity["DerivedsAlternateId"] = (object)value); derivedsAlternateId.SetMaterializationSetter( @@ -125,13 +125,13 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas else { { - if (entry.FlaggedAsTemporary(1) && (((Dictionary)entry.Entity).ContainsKey("DerivedsAlternateId") ? ((Dictionary)entry.Entity)["DerivedsAlternateId"] : null) == null) + if (entry.FlaggedAsTemporary(1) && (((IDictionary)(Dictionary)entry.Entity).ContainsKey("DerivedsAlternateId") ? ((Dictionary)entry.Entity)["DerivedsAlternateId"] : null) == null) { return entry.ReadTemporaryValue(1); } else { - var nullableValue = ((Dictionary)entry.Entity).ContainsKey("DerivedsAlternateId") ? ((Dictionary)entry.Entity)["DerivedsAlternateId"] : null; + var nullableValue = ((IDictionary)(Dictionary)entry.Entity).ContainsKey("DerivedsAlternateId") ? ((Dictionary)entry.Entity)["DerivedsAlternateId"] : null; return nullableValue == null ? default(Guid) : (Guid)nullableValue; } } @@ -139,7 +139,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas }, (InternalEntityEntry entry) => { - var nullableValue = ((Dictionary)entry.Entity).ContainsKey("DerivedsAlternateId") ? ((Dictionary)entry.Entity)["DerivedsAlternateId"] : null; + var nullableValue = ((IDictionary)(Dictionary)entry.Entity).ContainsKey("DerivedsAlternateId") ? ((Dictionary)entry.Entity)["DerivedsAlternateId"] : null; return nullableValue == null ? default(Guid) : (Guid)nullableValue; }, (InternalEntityEntry entry) => entry.ReadOriginalValue(derivedsAlternateId, 1), @@ -154,15 +154,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas derivedsAlternateId.TypeMapping = GuidTypeMapping.Default.Clone( comparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), keyComparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), providerValueComparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "uniqueidentifier")); @@ -175,10 +175,10 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas propertyInfo: runtimeEntityType.FindIndexerPropertyInfo(), afterSaveBehavior: PropertySaveBehavior.Throw); principalsId.SetGetter( - (Dictionary entity) => (entity.ContainsKey("PrincipalsId") ? entity["PrincipalsId"] : null) == null ? 0L : (long)(entity.ContainsKey("PrincipalsId") ? entity["PrincipalsId"] : null), - (Dictionary entity) => (entity.ContainsKey("PrincipalsId") ? entity["PrincipalsId"] : null) == null, - (Dictionary instance) => (instance.ContainsKey("PrincipalsId") ? instance["PrincipalsId"] : null) == null ? 0L : (long)(instance.ContainsKey("PrincipalsId") ? instance["PrincipalsId"] : null), - (Dictionary instance) => (instance.ContainsKey("PrincipalsId") ? instance["PrincipalsId"] : null) == null); + (Dictionary entity) => (((IDictionary)entity).ContainsKey("PrincipalsId") ? entity["PrincipalsId"] : null) == null ? 0L : (long)(((IDictionary)entity).ContainsKey("PrincipalsId") ? entity["PrincipalsId"] : null), + (Dictionary entity) => (((IDictionary)entity).ContainsKey("PrincipalsId") ? entity["PrincipalsId"] : null) == null, + (Dictionary instance) => (((IDictionary)instance).ContainsKey("PrincipalsId") ? instance["PrincipalsId"] : null) == null ? 0L : (long)(((IDictionary)instance).ContainsKey("PrincipalsId") ? instance["PrincipalsId"] : null), + (Dictionary instance) => (((IDictionary)instance).ContainsKey("PrincipalsId") ? instance["PrincipalsId"] : null) == null); principalsId.SetSetter( (Dictionary entity, long value) => entity["PrincipalsId"] = (object)value); principalsId.SetMaterializationSetter( @@ -193,13 +193,13 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas else { { - if (entry.FlaggedAsTemporary(2) && (((Dictionary)entry.Entity).ContainsKey("PrincipalsId") ? ((Dictionary)entry.Entity)["PrincipalsId"] : null) == null) + if (entry.FlaggedAsTemporary(2) && (((IDictionary)(Dictionary)entry.Entity).ContainsKey("PrincipalsId") ? ((Dictionary)entry.Entity)["PrincipalsId"] : null) == null) { return entry.ReadTemporaryValue(2); } else { - var nullableValue = ((Dictionary)entry.Entity).ContainsKey("PrincipalsId") ? ((Dictionary)entry.Entity)["PrincipalsId"] : null; + var nullableValue = ((IDictionary)(Dictionary)entry.Entity).ContainsKey("PrincipalsId") ? ((Dictionary)entry.Entity)["PrincipalsId"] : null; return nullableValue == null ? default(long) : (long)nullableValue; } } @@ -207,7 +207,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas }, (InternalEntityEntry entry) => { - var nullableValue = ((Dictionary)entry.Entity).ContainsKey("PrincipalsId") ? ((Dictionary)entry.Entity)["PrincipalsId"] : null; + var nullableValue = ((IDictionary)(Dictionary)entry.Entity).ContainsKey("PrincipalsId") ? ((Dictionary)entry.Entity)["PrincipalsId"] : null; return nullableValue == null ? default(long) : (long)nullableValue; }, (InternalEntityEntry entry) => entry.ReadOriginalValue(principalsId, 2), @@ -222,15 +222,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas principalsId.TypeMapping = SqlServerLongTypeMapping.Default.Clone( comparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), keyComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v)); principalsId.SetCurrentValueComparer(new EntryCurrentValueComparer(principalsId)); principalsId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); @@ -241,10 +241,10 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas propertyInfo: runtimeEntityType.FindIndexerPropertyInfo(), afterSaveBehavior: PropertySaveBehavior.Throw); principalsAlternateId.SetGetter( - (Dictionary entity) => (entity.ContainsKey("PrincipalsAlternateId") ? entity["PrincipalsAlternateId"] : null) == null ? new Guid("00000000-0000-0000-0000-000000000000") : (Guid)(entity.ContainsKey("PrincipalsAlternateId") ? entity["PrincipalsAlternateId"] : null), - (Dictionary entity) => (entity.ContainsKey("PrincipalsAlternateId") ? entity["PrincipalsAlternateId"] : null) == null, - (Dictionary instance) => (instance.ContainsKey("PrincipalsAlternateId") ? instance["PrincipalsAlternateId"] : null) == null ? new Guid("00000000-0000-0000-0000-000000000000") : (Guid)(instance.ContainsKey("PrincipalsAlternateId") ? instance["PrincipalsAlternateId"] : null), - (Dictionary instance) => (instance.ContainsKey("PrincipalsAlternateId") ? instance["PrincipalsAlternateId"] : null) == null); + (Dictionary entity) => (((IDictionary)entity).ContainsKey("PrincipalsAlternateId") ? entity["PrincipalsAlternateId"] : null) == null ? new Guid("00000000-0000-0000-0000-000000000000") : (Guid)(((IDictionary)entity).ContainsKey("PrincipalsAlternateId") ? entity["PrincipalsAlternateId"] : null), + (Dictionary entity) => (((IDictionary)entity).ContainsKey("PrincipalsAlternateId") ? entity["PrincipalsAlternateId"] : null) == null, + (Dictionary instance) => (((IDictionary)instance).ContainsKey("PrincipalsAlternateId") ? instance["PrincipalsAlternateId"] : null) == null ? new Guid("00000000-0000-0000-0000-000000000000") : (Guid)(((IDictionary)instance).ContainsKey("PrincipalsAlternateId") ? instance["PrincipalsAlternateId"] : null), + (Dictionary instance) => (((IDictionary)instance).ContainsKey("PrincipalsAlternateId") ? instance["PrincipalsAlternateId"] : null) == null); principalsAlternateId.SetSetter( (Dictionary entity, Guid value) => entity["PrincipalsAlternateId"] = (object)value); principalsAlternateId.SetMaterializationSetter( @@ -259,13 +259,13 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas else { { - if (entry.FlaggedAsTemporary(3) && (((Dictionary)entry.Entity).ContainsKey("PrincipalsAlternateId") ? ((Dictionary)entry.Entity)["PrincipalsAlternateId"] : null) == null) + if (entry.FlaggedAsTemporary(3) && (((IDictionary)(Dictionary)entry.Entity).ContainsKey("PrincipalsAlternateId") ? ((Dictionary)entry.Entity)["PrincipalsAlternateId"] : null) == null) { return entry.ReadTemporaryValue(3); } else { - var nullableValue = ((Dictionary)entry.Entity).ContainsKey("PrincipalsAlternateId") ? ((Dictionary)entry.Entity)["PrincipalsAlternateId"] : null; + var nullableValue = ((IDictionary)(Dictionary)entry.Entity).ContainsKey("PrincipalsAlternateId") ? ((Dictionary)entry.Entity)["PrincipalsAlternateId"] : null; return nullableValue == null ? default(Guid) : (Guid)nullableValue; } } @@ -273,7 +273,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas }, (InternalEntityEntry entry) => { - var nullableValue = ((Dictionary)entry.Entity).ContainsKey("PrincipalsAlternateId") ? ((Dictionary)entry.Entity)["PrincipalsAlternateId"] : null; + var nullableValue = ((IDictionary)(Dictionary)entry.Entity).ContainsKey("PrincipalsAlternateId") ? ((Dictionary)entry.Entity)["PrincipalsAlternateId"] : null; return nullableValue == null ? default(Guid) : (Guid)nullableValue; }, (InternalEntityEntry entry) => entry.ReadOriginalValue(principalsAlternateId, 3), @@ -288,15 +288,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas principalsAlternateId.TypeMapping = GuidTypeMapping.Default.Clone( comparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), keyComparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), providerValueComparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "uniqueidentifier")); @@ -313,17 +313,17 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas beforeSaveBehavior: PropertySaveBehavior.Ignore, afterSaveBehavior: PropertySaveBehavior.Ignore); rowid.SetGetter( - (Dictionary entity) => (entity.ContainsKey("rowid") ? entity["rowid"] : null) == null ? null : (byte[])(entity.ContainsKey("rowid") ? entity["rowid"] : null), - (Dictionary entity) => (entity.ContainsKey("rowid") ? entity["rowid"] : null) == null, - (Dictionary instance) => (instance.ContainsKey("rowid") ? instance["rowid"] : null) == null ? null : (byte[])(instance.ContainsKey("rowid") ? instance["rowid"] : null), - (Dictionary instance) => (instance.ContainsKey("rowid") ? instance["rowid"] : null) == null); + (Dictionary entity) => (((IDictionary)entity).ContainsKey("rowid") ? entity["rowid"] : null) == null ? null : (byte[])(((IDictionary)entity).ContainsKey("rowid") ? entity["rowid"] : null), + (Dictionary entity) => (((IDictionary)entity).ContainsKey("rowid") ? entity["rowid"] : null) == null, + (Dictionary instance) => (((IDictionary)instance).ContainsKey("rowid") ? instance["rowid"] : null) == null ? null : (byte[])(((IDictionary)instance).ContainsKey("rowid") ? instance["rowid"] : null), + (Dictionary instance) => (((IDictionary)instance).ContainsKey("rowid") ? instance["rowid"] : null) == null); rowid.SetSetter( (Dictionary entity, byte[] value) => entity["rowid"] = (object)value); rowid.SetMaterializationSetter( (Dictionary entity, byte[] value) => entity["rowid"] = (object)value); rowid.SetAccessors( - (InternalEntityEntry entry) => entry.FlaggedAsStoreGenerated(4) ? entry.ReadStoreGeneratedValue(4) : entry.FlaggedAsTemporary(4) && (((Dictionary)entry.Entity).ContainsKey("rowid") ? ((Dictionary)entry.Entity)["rowid"] : null) == null ? entry.ReadTemporaryValue(4) : (byte[])(((Dictionary)entry.Entity).ContainsKey("rowid") ? ((Dictionary)entry.Entity)["rowid"] : null), - (InternalEntityEntry entry) => (byte[])(((Dictionary)entry.Entity).ContainsKey("rowid") ? ((Dictionary)entry.Entity)["rowid"] : null), + (InternalEntityEntry entry) => entry.FlaggedAsStoreGenerated(4) ? entry.ReadStoreGeneratedValue(4) : entry.FlaggedAsTemporary(4) && (((IDictionary)(Dictionary)entry.Entity).ContainsKey("rowid") ? ((Dictionary)entry.Entity)["rowid"] : null) == null ? entry.ReadTemporaryValue(4) : (byte[])(((IDictionary)(Dictionary)entry.Entity).ContainsKey("rowid") ? ((Dictionary)entry.Entity)["rowid"] : null), + (InternalEntityEntry entry) => (byte[])(((IDictionary)(Dictionary)entry.Entity).ContainsKey("rowid") ? ((Dictionary)entry.Entity)["rowid"] : null), (InternalEntityEntry entry) => entry.ReadOriginalValue(rowid, 4), (InternalEntityEntry entry) => entry.GetCurrentValue(rowid), (ValueBuffer valueBuffer) => valueBuffer[4]); @@ -394,11 +394,11 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) runtimeEntityType.SetOriginalValuesFactory( (InternalEntityEntry source) => { - var entity = (Dictionary)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)derivedsId.GetValueComparer()).Snapshot(source.GetCurrentValue(derivedsId)), ((ValueComparer)derivedsAlternateId.GetValueComparer()).Snapshot(source.GetCurrentValue(derivedsAlternateId)), ((ValueComparer)principalsId.GetValueComparer()).Snapshot(source.GetCurrentValue(principalsId)), ((ValueComparer)principalsAlternateId.GetValueComparer()).Snapshot(source.GetCurrentValue(principalsAlternateId)), source.GetCurrentValue(rowid) == null ? null : ((ValueComparer)rowid.GetValueComparer()).Snapshot(source.GetCurrentValue(rowid))); + var entity8 = (Dictionary)source.Entity; + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)derivedsId).GetValueComparer()).Snapshot(source.GetCurrentValue(derivedsId)), ((ValueComparer)((IProperty)derivedsAlternateId).GetValueComparer()).Snapshot(source.GetCurrentValue(derivedsAlternateId)), ((ValueComparer)((IProperty)principalsId).GetValueComparer()).Snapshot(source.GetCurrentValue(principalsId)), ((ValueComparer)((IProperty)principalsAlternateId).GetValueComparer()).Snapshot(source.GetCurrentValue(principalsAlternateId)), source.GetCurrentValue(rowid) == null ? null : ((ValueComparer)((IProperty)rowid).GetValueComparer()).Snapshot(source.GetCurrentValue(rowid))); }); runtimeEntityType.SetStoreGeneratedValuesFactory( - () => (ISnapshot)new Snapshot(((ValueComparer)derivedsId.GetValueComparer()).Snapshot(default(long)), ((ValueComparer)derivedsAlternateId.GetValueComparer()).Snapshot(default(Guid)), ((ValueComparer)principalsId.GetValueComparer()).Snapshot(default(long)), ((ValueComparer)principalsAlternateId.GetValueComparer()).Snapshot(default(Guid)), default(byte[]) == null ? null : ((ValueComparer)rowid.GetValueComparer()).Snapshot(default(byte[])))); + () => (ISnapshot)new Snapshot(((ValueComparer)((IProperty)derivedsId).GetValueComparer()).Snapshot(default(long)), ((ValueComparer)((IProperty)derivedsAlternateId).GetValueComparer()).Snapshot(default(Guid)), ((ValueComparer)((IProperty)principalsId).GetValueComparer()).Snapshot(default(long)), ((ValueComparer)((IProperty)principalsAlternateId).GetValueComparer()).Snapshot(default(Guid)), default(byte[]) == null ? null : ((ValueComparer)((IProperty)rowid).GetValueComparer()).Snapshot(default(byte[])))); runtimeEntityType.SetTemporaryValuesFactory( (InternalEntityEntry source) => (ISnapshot)new Snapshot(default(long), default(Guid), default(long), default(Guid), default(byte[]))); runtimeEntityType.SetShadowValuesFactory( @@ -408,8 +408,8 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) runtimeEntityType.SetRelationshipSnapshotFactory( (InternalEntityEntry source) => { - var entity = (Dictionary)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)derivedsId.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(derivedsId)), ((ValueComparer)derivedsAlternateId.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(derivedsAlternateId)), ((ValueComparer)principalsId.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalsId)), ((ValueComparer)principalsAlternateId.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalsAlternateId))); + var entity8 = (Dictionary)source.Entity; + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)derivedsId).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(derivedsId)), ((ValueComparer)((IProperty)derivedsAlternateId).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(derivedsAlternateId)), ((ValueComparer)((IProperty)principalsId).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalsId)), ((ValueComparer)((IProperty)principalsAlternateId).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalsAlternateId))); }); runtimeEntityType.Counts = new PropertyCounts( propertyCount: 5, diff --git a/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/BigModel_with_JSON_columns/PrincipalDerivedEntityType.cs b/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/BigModel_with_JSON_columns/PrincipalDerivedEntityType.cs index 6f41c65880c..a366d574f16 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/BigModel_with_JSON_columns/PrincipalDerivedEntityType.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/BigModel_with_JSON_columns/PrincipalDerivedEntityType.cs @@ -110,8 +110,8 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) runtimeEntityType.SetOriginalValuesFactory( (InternalEntityEntry source) => { - var entity = (CompiledModelTestBase.PrincipalDerived>>)source.Entity; - return (ISnapshot)new Snapshot, Guid, string, CompiledModelTestBase.AnEnum, Nullable, CompiledModelTestBase.AFlagsEnum, CompiledModelTestBase.AFlagsEnum, IPAddress[], IEnumerable, IList, List, DateTime[], IEnumerable, IList, List>(source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)id.GetValueComparer()).Snapshot(source.GetCurrentValue>(id)), ((ValueComparer)alternateId.GetValueComparer()).Snapshot(source.GetCurrentValue(alternateId)), source.GetCurrentValue(discriminator) == null ? null : ((ValueComparer)discriminator.GetValueComparer()).Snapshot(source.GetCurrentValue(discriminator)), ((ValueComparer)enum1.GetValueComparer()).Snapshot(source.GetCurrentValue(enum1)), source.GetCurrentValue>(enum2) == null ? null : ((ValueComparer>)enum2.GetValueComparer()).Snapshot(source.GetCurrentValue>(enum2)), ((ValueComparer)flagsEnum1.GetValueComparer()).Snapshot(source.GetCurrentValue(flagsEnum1)), ((ValueComparer)flagsEnum2.GetValueComparer()).Snapshot(source.GetCurrentValue(flagsEnum2)), (object)source.GetCurrentValue(refTypeArray) == null ? null : (IPAddress[])((ValueComparer)refTypeArray.GetValueComparer()).Snapshot((object)source.GetCurrentValue(refTypeArray)), (object)source.GetCurrentValue>(refTypeEnumerable) == null ? null : (IEnumerable)((ValueComparer)refTypeEnumerable.GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeEnumerable)), (object)source.GetCurrentValue>(refTypeIList) == null ? null : (IList)((ValueComparer)refTypeIList.GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeIList)), (object)source.GetCurrentValue>(refTypeList) == null ? null : (List)((ValueComparer)refTypeList.GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeList)), (IEnumerable)source.GetCurrentValue(valueTypeArray) == null ? null : (DateTime[])((ValueComparer>)valueTypeArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(valueTypeArray)), source.GetCurrentValue>(valueTypeEnumerable) == null ? null : ((ValueComparer>)valueTypeEnumerable.GetValueComparer()).Snapshot(source.GetCurrentValue>(valueTypeEnumerable)), (IEnumerable)source.GetCurrentValue>(valueTypeIList) == null ? null : (IList)((ValueComparer>)valueTypeIList.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeIList)), (IEnumerable)source.GetCurrentValue>(valueTypeList) == null ? null : (List)((ValueComparer>)valueTypeList.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeList))); + var entity8 = (CompiledModelTestBase.PrincipalDerived>>)source.Entity; + return (ISnapshot)new Snapshot, Guid, string, CompiledModelTestBase.AnEnum, Nullable, CompiledModelTestBase.AFlagsEnum, CompiledModelTestBase.AFlagsEnum, IPAddress[], IEnumerable, IList, List, DateTime[], IEnumerable, IList, List>(source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)((IProperty)id).GetValueComparer()).Snapshot(source.GetCurrentValue>(id)), ((ValueComparer)((IProperty)alternateId).GetValueComparer()).Snapshot(source.GetCurrentValue(alternateId)), source.GetCurrentValue(discriminator) == null ? null : ((ValueComparer)((IProperty)discriminator).GetValueComparer()).Snapshot(source.GetCurrentValue(discriminator)), ((ValueComparer)((IProperty)enum1).GetValueComparer()).Snapshot(source.GetCurrentValue(enum1)), source.GetCurrentValue>(enum2) == null ? null : ((ValueComparer>)((IProperty)enum2).GetValueComparer()).Snapshot(source.GetCurrentValue>(enum2)), ((ValueComparer)((IProperty)flagsEnum1).GetValueComparer()).Snapshot(source.GetCurrentValue(flagsEnum1)), ((ValueComparer)((IProperty)flagsEnum2).GetValueComparer()).Snapshot(source.GetCurrentValue(flagsEnum2)), (object)source.GetCurrentValue(refTypeArray) == null ? null : (IPAddress[])((ValueComparer)((IProperty)refTypeArray).GetValueComparer()).Snapshot((object)source.GetCurrentValue(refTypeArray)), (object)source.GetCurrentValue>(refTypeEnumerable) == null ? null : (IEnumerable)((ValueComparer)((IProperty)refTypeEnumerable).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeEnumerable)), (object)source.GetCurrentValue>(refTypeIList) == null ? null : (IList)((ValueComparer)((IProperty)refTypeIList).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeIList)), (object)source.GetCurrentValue>(refTypeList) == null ? null : (List)((ValueComparer)((IProperty)refTypeList).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeList)), (IEnumerable)source.GetCurrentValue(valueTypeArray) == null ? null : (DateTime[])((ValueComparer>)((IProperty)valueTypeArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(valueTypeArray)), source.GetCurrentValue>(valueTypeEnumerable) == null ? null : ((ValueComparer>)((IProperty)valueTypeEnumerable).GetValueComparer()).Snapshot(source.GetCurrentValue>(valueTypeEnumerable)), (IEnumerable)source.GetCurrentValue>(valueTypeIList) == null ? null : (IList)((ValueComparer>)((IProperty)valueTypeIList).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeIList)), (IEnumerable)source.GetCurrentValue>(valueTypeList) == null ? null : (List)((ValueComparer>)((IProperty)valueTypeList).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeList))); }); runtimeEntityType.SetStoreGeneratedValuesFactory( () => Snapshot.Empty); @@ -124,8 +124,8 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) runtimeEntityType.SetRelationshipSnapshotFactory( (InternalEntityEntry source) => { - var entity = (CompiledModelTestBase.PrincipalDerived>>)source.Entity; - return (ISnapshot)new Snapshot, Guid, object, object, object, object, object>(source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)id.GetKeyValueComparer()).Snapshot(source.GetCurrentValue>(id)), ((ValueComparer)alternateId.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(alternateId)), PrincipalBaseEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalBase__ownedField(entity), null, UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalDerived1_Dependent(entity), SnapshotFactoryFactory.SnapshotCollection(UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalDerived1_ManyOwned(entity)), null); + var entity8 = (CompiledModelTestBase.PrincipalDerived>>)source.Entity; + return (ISnapshot)new Snapshot, Guid, object, object, object, object, object>(source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)((IProperty)id).GetKeyValueComparer()).Snapshot(source.GetCurrentValue>(id)), ((ValueComparer)((IProperty)alternateId).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(alternateId)), PrincipalBaseEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalBase__ownedField(entity8), null, UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalDerived1_Dependent(entity8), SnapshotFactoryFactory.SnapshotCollection(UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalDerived1_ManyOwned(entity8)), null); }); runtimeEntityType.Counts = new PropertyCounts( propertyCount: 15, diff --git a/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/CheckConstraints/DataEntityType.cs b/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/CheckConstraints/DataEntityType.cs index 58ca91d5145..34d172a6b35 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/CheckConstraints/DataEntityType.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/CheckConstraints/DataEntityType.cs @@ -89,7 +89,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas blob.TypeMapping = SqlServerByteArrayTypeMapping.Default.Clone( comparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), - (byte[] v) => v.GetHashCode(), + (byte[] v) => ((object)v).GetHashCode(), (byte[] v) => v), keyComparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), @@ -120,10 +120,10 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (CompiledModelTestBase.Data)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)id.GetValueComparer()).Snapshot(source.GetCurrentValue(id)), source.GetCurrentValue(blob) == null ? null : ((ValueComparer)blob.GetValueComparer()).Snapshot(source.GetCurrentValue(blob))); + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetValueComparer()).Snapshot(source.GetCurrentValue(id)), source.GetCurrentValue(blob) == null ? null : ((ValueComparer)((IProperty)blob).GetValueComparer()).Snapshot(source.GetCurrentValue(blob))); }); runtimeEntityType.SetStoreGeneratedValuesFactory( - () => (ISnapshot)new Snapshot(((ValueComparer)id.GetValueComparer()).Snapshot(default(int)))); + () => (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetValueComparer()).Snapshot(default(int)))); runtimeEntityType.SetTemporaryValuesFactory( (InternalEntityEntry source) => (ISnapshot)new Snapshot(default(int))); runtimeEntityType.SetShadowValuesFactory( @@ -134,7 +134,7 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (CompiledModelTestBase.Data)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)id.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(id))); + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(id))); }); runtimeEntityType.Counts = new PropertyCounts( propertyCount: 2, diff --git a/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/ComplexTypes/PrincipalBaseEntityType.cs b/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/ComplexTypes/PrincipalBaseEntityType.cs index dd90aae9f79..2b1e8fe7c2c 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/ComplexTypes/PrincipalBaseEntityType.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/ComplexTypes/PrincipalBaseEntityType.cs @@ -72,18 +72,19 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas id.TypeMapping = SqlServerLongTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable)), providerValueComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable))); id.SetCurrentValueComparer(new EntryCurrentValueComparer(id)); id.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + id.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("PrincipalBaseEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalBase_Id", "TestNamespace") }); var discriminator = runtimeEntityType.AddProperty( "Discriminator", @@ -100,15 +101,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas discriminator.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(55)", @@ -146,11 +147,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum1.TypeMapping = IntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.AnEnum v1, CompiledModelTestBase.AnEnum v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.AnEnum v) => v.GetHashCode(), + (CompiledModelTestBase.AnEnum v) => ((object)v).GetHashCode(), (CompiledModelTestBase.AnEnum v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.AnEnum v1, CompiledModelTestBase.AnEnum v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.AnEnum v) => v.GetHashCode(), + (CompiledModelTestBase.AnEnum v) => ((object)v).GetHashCode(), (CompiledModelTestBase.AnEnum v) => v), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -166,6 +167,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (int value) => (CompiledModelTestBase.AnEnum)value))); enum1.SetSentinelFromProviderValue(0); enum1.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + enum1.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("PrincipalBaseEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalBase_Enum1", "TestNamespace") }); var enum2 = runtimeEntityType.AddProperty( "Enum2", @@ -197,11 +199,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum2.TypeMapping = IntTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.AnEnum)v1, (object)(CompiledModelTestBase.AnEnum)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.AnEnum)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.AnEnum)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.AnEnum)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.AnEnum)v1, (object)(CompiledModelTestBase.AnEnum)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.AnEnum)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.AnEnum)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.AnEnum)v : default(Nullable)), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -216,6 +218,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (CompiledModelTestBase.AnEnum value) => (int)value, (int value) => (CompiledModelTestBase.AnEnum)value))); enum2.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + enum2.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("PrincipalBaseEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalBase_Enum2", "TestNamespace") }); var flagsEnum1 = runtimeEntityType.AddProperty( "FlagsEnum1", @@ -246,11 +249,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas flagsEnum1.TypeMapping = IntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.AFlagsEnum v1, CompiledModelTestBase.AFlagsEnum v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.AFlagsEnum v) => v.GetHashCode(), + (CompiledModelTestBase.AFlagsEnum v) => ((object)v).GetHashCode(), (CompiledModelTestBase.AFlagsEnum v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.AFlagsEnum v1, CompiledModelTestBase.AFlagsEnum v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.AFlagsEnum v) => v.GetHashCode(), + (CompiledModelTestBase.AFlagsEnum v) => ((object)v).GetHashCode(), (CompiledModelTestBase.AFlagsEnum v) => v), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -266,6 +269,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (int value) => (CompiledModelTestBase.AFlagsEnum)value))); flagsEnum1.SetSentinelFromProviderValue(0); flagsEnum1.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + flagsEnum1.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("PrincipalBaseEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalBase_FlagsEnum1", "TestNamespace") }); var flagsEnum2 = runtimeEntityType.AddProperty( "FlagsEnum2", @@ -296,11 +300,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas flagsEnum2.TypeMapping = IntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.AFlagsEnum v1, CompiledModelTestBase.AFlagsEnum v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.AFlagsEnum v) => v.GetHashCode(), + (CompiledModelTestBase.AFlagsEnum v) => ((object)v).GetHashCode(), (CompiledModelTestBase.AFlagsEnum v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.AFlagsEnum v1, CompiledModelTestBase.AFlagsEnum v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.AFlagsEnum v) => v.GetHashCode(), + (CompiledModelTestBase.AFlagsEnum v) => ((object)v).GetHashCode(), (CompiledModelTestBase.AFlagsEnum v) => v), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -316,6 +320,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (int value) => (CompiledModelTestBase.AFlagsEnum)value))); flagsEnum2.SetSentinelFromProviderValue(0); flagsEnum2.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + flagsEnum2.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("PrincipalBaseEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalBase_FlagsEnum2", "TestNamespace") }); var principalBaseId = runtimeEntityType.AddProperty( "PrincipalBaseId", @@ -330,15 +335,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas principalBaseId.TypeMapping = SqlServerLongTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable)), providerValueComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable))); principalBaseId.SetCurrentValueComparer(new EntryCurrentValueComparer(principalBaseId)); principalBaseId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); @@ -371,47 +376,47 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas relationshipIndex: -1, storeGenerationIndex: -1); refTypeArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfReferenceTypesComparer(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))), storeTypePostfix: StoreTypePostfix.None, - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)))), elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), keyComparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(45)", @@ -419,14 +424,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))); refTypeArray.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + refTypeArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("PrincipalBaseEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalBase_RefTypeArray", "TestNamespace") }); var refTypeEnumerable = runtimeEntityType.AddProperty( "RefTypeEnumerable", @@ -456,39 +462,39 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas relationshipIndex: -1, storeGenerationIndex: -1); refTypeEnumerable.TypeMapping = SqlServerStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfReferenceTypesComparer, string>(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfReferenceTypesComparer, string>(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, string>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter, string>( JsonStringReaderWriter.Instance)), storeTypePostfix: StoreTypePostfix.None, - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, string>( + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter, string>( JsonStringReaderWriter.Instance), elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -496,6 +502,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas dbType: System.Data.DbType.String), storeTypePostfix: StoreTypePostfix.None)); refTypeEnumerable.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + refTypeEnumerable.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("PrincipalBaseEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalBase_RefTypeEnumerable", "TestNamespace") }); var refTypeIList = runtimeEntityType.AddProperty( "RefTypeIList", @@ -525,39 +532,39 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas relationshipIndex: -1, storeGenerationIndex: -1); refTypeIList.TypeMapping = SqlServerStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfReferenceTypesComparer, string>(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfReferenceTypesComparer, string>(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, string>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter, string>( JsonStringReaderWriter.Instance)), storeTypePostfix: StoreTypePostfix.None, - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, string>( + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter, string>( JsonStringReaderWriter.Instance), elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -565,6 +572,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas dbType: System.Data.DbType.String), storeTypePostfix: StoreTypePostfix.None)); refTypeIList.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + refTypeIList.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("PrincipalBaseEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalBase_RefTypeIList", "TestNamespace") }); var refTypeList = runtimeEntityType.AddProperty( "RefTypeList", @@ -594,47 +602,47 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas relationshipIndex: -1, storeGenerationIndex: -1); refTypeList.TypeMapping = SqlServerStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfReferenceTypesComparer, IPAddress>(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfReferenceTypesComparer, IPAddress>(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, IPAddress>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter, IPAddress>( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))), storeTypePostfix: StoreTypePostfix.None, - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, IPAddress>( + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter, IPAddress>( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)))), elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), keyComparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(45)", @@ -642,14 +650,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))); refTypeList.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + refTypeList.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("PrincipalBaseEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalBase_RefTypeList", "TestNamespace") }); var valueTypeArray = runtimeEntityType.AddProperty( "ValueTypeArray", @@ -679,41 +688,42 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas relationshipIndex: -1, storeGenerationIndex: -1); valueTypeArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer(new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer(new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( JsonDateTimeReaderWriter.Instance)), storeTypePostfix: StoreTypePostfix.None, - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( JsonDateTimeReaderWriter.Instance), elementMapping: SqlServerDateTimeTypeMapping.Default.Clone( comparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v), keyComparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v), providerValueComparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v))); valueTypeArray.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + valueTypeArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("PrincipalBaseEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalBase_ValueTypeArray", "TestNamespace") }); var valueTypeEnumerable = runtimeEntityType.AddProperty( "ValueTypeEnumerable", @@ -743,26 +753,26 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas relationshipIndex: -1, storeGenerationIndex: -1); valueTypeEnumerable.TypeMapping = SqlServerStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer, byte>(new ValueComparer( (byte v1, byte v2) => v1 == v2, (byte v) => (int)v, (byte v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer, byte>(new ValueComparer( (byte v1, byte v2) => v1 == v2, (byte v) => (int)v, (byte v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, byte>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter, byte>( JsonByteReaderWriter.Instance)), storeTypePostfix: StoreTypePostfix.None, - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, byte>( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, byte>( JsonByteReaderWriter.Instance), elementMapping: SqlServerByteTypeMapping.Default.Clone( comparer: new ValueComparer( @@ -778,6 +788,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (byte v) => (int)v, (byte v) => v))); valueTypeEnumerable.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + valueTypeEnumerable.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("PrincipalBaseEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalBase_ValueTypeEnumerable", "TestNamespace") }); var valueTypeIList = runtimeEntityType.AddProperty( "ValueTypeIList", @@ -807,26 +818,26 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas relationshipIndex: -1, storeGenerationIndex: -1); valueTypeIList.TypeMapping = SqlServerStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer, byte>(new ValueComparer( (byte v1, byte v2) => v1 == v2, (byte v) => (int)v, (byte v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer, byte>(new ValueComparer( (byte v1, byte v2) => v1 == v2, (byte v) => (int)v, (byte v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, byte>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter, byte>( JsonByteReaderWriter.Instance)), storeTypePostfix: StoreTypePostfix.None, - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, byte>( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, byte>( JsonByteReaderWriter.Instance), elementMapping: SqlServerByteTypeMapping.Default.Clone( comparer: new ValueComparer( @@ -842,6 +853,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (byte v) => (int)v, (byte v) => v))); valueTypeIList.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + valueTypeIList.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("PrincipalBaseEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalBase_ValueTypeIList", "TestNamespace") }); var valueTypeList = runtimeEntityType.AddProperty( "ValueTypeList", @@ -871,26 +883,26 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas relationshipIndex: -1, storeGenerationIndex: -1); valueTypeList.TypeMapping = SqlServerStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer, short>(new ValueComparer( (short v1, short v2) => v1 == v2, (short v) => (int)v, (short v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer, short>(new ValueComparer( (short v1, short v2) => v1 == v2, (short v) => (int)v, (short v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, short>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter, short>( JsonInt16ReaderWriter.Instance)), storeTypePostfix: StoreTypePostfix.None, - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, short>( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, short>( JsonInt16ReaderWriter.Instance), elementMapping: SqlServerShortTypeMapping.Default.Clone( comparer: new ValueComparer( @@ -906,6 +918,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (short v) => (int)v, (short v) => v))); valueTypeList.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + valueTypeList.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("PrincipalBaseEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalBase_ValueTypeList", "TestNamespace") }); OwnedComplexProperty.Create(runtimeEntityType); var key = runtimeEntityType.AddKey( @@ -1003,15 +1016,15 @@ public static RuntimeComplexProperty Create(RuntimeEntityType declaringType) details.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "varchar(64)", @@ -1022,6 +1035,7 @@ public static RuntimeComplexProperty Create(RuntimeEntityType declaringType) details.AddAnnotation("Relational:ColumnName", "Deets"); details.AddAnnotation("Relational:ColumnType", "varchar"); details.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + details.AddRuntimeAnnotation("UnsafeAccessors", new[] { ((string)null, (string)null), ((string)null, (string)null), ("PrincipalBaseEntityType.Owned.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_OwnedType__details", "TestNamespace") }); var number = complexType.AddProperty( "Number", @@ -1072,6 +1086,7 @@ public static RuntimeComplexProperty Create(RuntimeEntityType declaringType) (int v) => v, (int v) => v)); number.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + number.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("PrincipalBaseEntityType.Owned.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_OwnedType_Number", "TestNamespace") }); var refTypeArray = complexType.AddProperty( "RefTypeArray", @@ -1109,47 +1124,47 @@ public static RuntimeComplexProperty Create(RuntimeEntityType declaringType) relationshipIndex: -1, storeGenerationIndex: -1); refTypeArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfReferenceTypesComparer(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))), storeTypePostfix: StoreTypePostfix.None, - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)))), elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), keyComparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(45)", @@ -1157,14 +1172,15 @@ public static RuntimeComplexProperty Create(RuntimeEntityType declaringType) unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))); refTypeArray.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + refTypeArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("PrincipalBaseEntityType.Owned.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_OwnedType__refTypeArray", "TestNamespace") }); var refTypeEnumerable = complexType.AddProperty( "RefTypeEnumerable", @@ -1202,39 +1218,39 @@ public static RuntimeComplexProperty Create(RuntimeEntityType declaringType) relationshipIndex: -1, storeGenerationIndex: -1); refTypeEnumerable.TypeMapping = SqlServerStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfReferenceTypesComparer, string>(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfReferenceTypesComparer, string>(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, string>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter, string>( JsonStringReaderWriter.Instance)), storeTypePostfix: StoreTypePostfix.None, - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, string>( + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter, string>( JsonStringReaderWriter.Instance), elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -1242,6 +1258,7 @@ public static RuntimeComplexProperty Create(RuntimeEntityType declaringType) dbType: System.Data.DbType.String), storeTypePostfix: StoreTypePostfix.None)); refTypeEnumerable.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + refTypeEnumerable.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("PrincipalBaseEntityType.Owned.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_OwnedType__refTypeEnumerable", "TestNamespace") }); var refTypeIList = complexType.AddProperty( "RefTypeIList", @@ -1279,39 +1296,39 @@ public static RuntimeComplexProperty Create(RuntimeEntityType declaringType) relationshipIndex: -1, storeGenerationIndex: -1); refTypeIList.TypeMapping = SqlServerStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfReferenceTypesComparer, string>(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfReferenceTypesComparer, string>(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, string>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter, string>( JsonStringReaderWriter.Instance)), storeTypePostfix: StoreTypePostfix.None, - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, string>( + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter, string>( JsonStringReaderWriter.Instance), elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -1319,6 +1336,7 @@ public static RuntimeComplexProperty Create(RuntimeEntityType declaringType) dbType: System.Data.DbType.String), storeTypePostfix: StoreTypePostfix.None)); refTypeIList.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + refTypeIList.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("PrincipalBaseEntityType.Owned.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_OwnedType__refTypeIList", "TestNamespace") }); var refTypeList = complexType.AddProperty( "RefTypeList", @@ -1356,47 +1374,47 @@ public static RuntimeComplexProperty Create(RuntimeEntityType declaringType) relationshipIndex: -1, storeGenerationIndex: -1); refTypeList.TypeMapping = SqlServerStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfReferenceTypesComparer, IPAddress>(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfReferenceTypesComparer, IPAddress>(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, IPAddress>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter, IPAddress>( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))), storeTypePostfix: StoreTypePostfix.None, - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, IPAddress>( + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter, IPAddress>( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)))), elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), keyComparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(45)", @@ -1404,14 +1422,15 @@ public static RuntimeComplexProperty Create(RuntimeEntityType declaringType) unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))); refTypeList.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + refTypeList.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("PrincipalBaseEntityType.Owned.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_OwnedType__refTypeList", "TestNamespace") }); var valueTypeArray = complexType.AddProperty( "ValueTypeArray", @@ -1449,41 +1468,42 @@ public static RuntimeComplexProperty Create(RuntimeEntityType declaringType) relationshipIndex: -1, storeGenerationIndex: -1); valueTypeArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer(new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer(new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( JsonDateTimeReaderWriter.Instance)), storeTypePostfix: StoreTypePostfix.None, - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( JsonDateTimeReaderWriter.Instance), elementMapping: SqlServerDateTimeTypeMapping.Default.Clone( comparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v), keyComparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v), providerValueComparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v))); valueTypeArray.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + valueTypeArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("PrincipalBaseEntityType.Owned.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_OwnedType__valueTypeArray", "TestNamespace") }); var valueTypeEnumerable = complexType.AddProperty( "ValueTypeEnumerable", @@ -1521,26 +1541,26 @@ public static RuntimeComplexProperty Create(RuntimeEntityType declaringType) relationshipIndex: -1, storeGenerationIndex: -1); valueTypeEnumerable.TypeMapping = SqlServerStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer, byte>(new ValueComparer( (byte v1, byte v2) => v1 == v2, (byte v) => (int)v, (byte v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer, byte>(new ValueComparer( (byte v1, byte v2) => v1 == v2, (byte v) => (int)v, (byte v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, byte>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter, byte>( JsonByteReaderWriter.Instance)), storeTypePostfix: StoreTypePostfix.None, - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, byte>( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, byte>( JsonByteReaderWriter.Instance), elementMapping: SqlServerByteTypeMapping.Default.Clone( comparer: new ValueComparer( @@ -1556,6 +1576,7 @@ public static RuntimeComplexProperty Create(RuntimeEntityType declaringType) (byte v) => (int)v, (byte v) => v))); valueTypeEnumerable.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + valueTypeEnumerable.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("PrincipalBaseEntityType.Owned.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_OwnedType__valueTypeEnumerable", "TestNamespace") }); var valueTypeIList = complexType.AddProperty( "ValueTypeIList", @@ -1593,26 +1614,26 @@ public static RuntimeComplexProperty Create(RuntimeEntityType declaringType) relationshipIndex: -1, storeGenerationIndex: -1); valueTypeIList.TypeMapping = SqlServerStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer, byte>(new ValueComparer( (byte v1, byte v2) => v1 == v2, (byte v) => (int)v, (byte v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer, byte>(new ValueComparer( (byte v1, byte v2) => v1 == v2, (byte v) => (int)v, (byte v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, byte>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter, byte>( JsonByteReaderWriter.Instance)), storeTypePostfix: StoreTypePostfix.None, - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, byte>( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, byte>( JsonByteReaderWriter.Instance), elementMapping: SqlServerByteTypeMapping.Default.Clone( comparer: new ValueComparer( @@ -1628,6 +1649,7 @@ public static RuntimeComplexProperty Create(RuntimeEntityType declaringType) (byte v) => (int)v, (byte v) => v))); valueTypeIList.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + valueTypeIList.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("PrincipalBaseEntityType.Owned.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_OwnedType_ValueTypeIList", "TestNamespace") }); var valueTypeList = complexType.AddProperty( "ValueTypeList", @@ -1665,26 +1687,26 @@ public static RuntimeComplexProperty Create(RuntimeEntityType declaringType) relationshipIndex: -1, storeGenerationIndex: -1); valueTypeList.TypeMapping = SqlServerStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer, short>(new ValueComparer( (short v1, short v2) => v1 == v2, (short v) => (int)v, (short v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer, short>(new ValueComparer( (short v1, short v2) => v1 == v2, (short v) => (int)v, (short v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, short>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter, short>( JsonInt16ReaderWriter.Instance)), storeTypePostfix: StoreTypePostfix.None, - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, short>( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, short>( JsonInt16ReaderWriter.Instance), elementMapping: SqlServerShortTypeMapping.Default.Clone( comparer: new ValueComparer( @@ -1700,6 +1722,7 @@ public static RuntimeComplexProperty Create(RuntimeEntityType declaringType) (short v) => (int)v, (short v) => v))); valueTypeList.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + valueTypeList.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("PrincipalBaseEntityType.Owned.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_OwnedType__valueTypeList", "TestNamespace") }); PrincipalComplexProperty.Create(complexType); complexType.AddAnnotation("go", "brr"); @@ -1710,6 +1733,7 @@ public static RuntimeComplexProperty Create(RuntimeEntityType declaringType) complexType.AddAnnotation("Relational:ViewName", "PrincipalBaseView"); complexType.AddAnnotation("Relational:ViewSchema", null); complexProperty.AddAnnotation("goo", "ber"); + complexProperty.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("PrincipalBaseEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalBase__ownedField", "TestNamespace") }); return complexProperty; } @@ -1794,15 +1818,15 @@ public static RuntimeComplexProperty Create(RuntimeComplexType declaringType) alternateId.TypeMapping = GuidTypeMapping.Default.Clone( comparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), keyComparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), providerValueComparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "uniqueidentifier")); @@ -1847,11 +1871,11 @@ public static RuntimeComplexProperty Create(RuntimeComplexType declaringType) enum1.TypeMapping = IntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.AnEnum v1, CompiledModelTestBase.AnEnum v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.AnEnum v) => v.GetHashCode(), + (CompiledModelTestBase.AnEnum v) => ((object)v).GetHashCode(), (CompiledModelTestBase.AnEnum v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.AnEnum v1, CompiledModelTestBase.AnEnum v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.AnEnum v) => v.GetHashCode(), + (CompiledModelTestBase.AnEnum v) => ((object)v).GetHashCode(), (CompiledModelTestBase.AnEnum v) => v), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -1867,6 +1891,7 @@ public static RuntimeComplexProperty Create(RuntimeComplexType declaringType) (int value) => (CompiledModelTestBase.AnEnum)value))); enum1.SetSentinelFromProviderValue(0); enum1.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + enum1.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("PrincipalBaseEntityType.Owned.Principal.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalBase_Enum1", "TestNamespace") }); var enum2 = complexType.AddProperty( "Enum2", @@ -1908,11 +1933,11 @@ public static RuntimeComplexProperty Create(RuntimeComplexType declaringType) enum2.TypeMapping = IntTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.AnEnum)v1, (object)(CompiledModelTestBase.AnEnum)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.AnEnum)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.AnEnum)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.AnEnum)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.AnEnum)v1, (object)(CompiledModelTestBase.AnEnum)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.AnEnum)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.AnEnum)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.AnEnum)v : default(Nullable)), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -1927,6 +1952,7 @@ public static RuntimeComplexProperty Create(RuntimeComplexType declaringType) (CompiledModelTestBase.AnEnum value) => (int)value, (int value) => (CompiledModelTestBase.AnEnum)value))); enum2.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + enum2.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("PrincipalBaseEntityType.Owned.Principal.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalBase_Enum2", "TestNamespace") }); var flagsEnum1 = complexType.AddProperty( "FlagsEnum1", @@ -1967,11 +1993,11 @@ public static RuntimeComplexProperty Create(RuntimeComplexType declaringType) flagsEnum1.TypeMapping = IntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.AFlagsEnum v1, CompiledModelTestBase.AFlagsEnum v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.AFlagsEnum v) => v.GetHashCode(), + (CompiledModelTestBase.AFlagsEnum v) => ((object)v).GetHashCode(), (CompiledModelTestBase.AFlagsEnum v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.AFlagsEnum v1, CompiledModelTestBase.AFlagsEnum v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.AFlagsEnum v) => v.GetHashCode(), + (CompiledModelTestBase.AFlagsEnum v) => ((object)v).GetHashCode(), (CompiledModelTestBase.AFlagsEnum v) => v), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -1987,6 +2013,7 @@ public static RuntimeComplexProperty Create(RuntimeComplexType declaringType) (int value) => (CompiledModelTestBase.AFlagsEnum)value))); flagsEnum1.SetSentinelFromProviderValue(0); flagsEnum1.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + flagsEnum1.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("PrincipalBaseEntityType.Owned.Principal.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalBase_FlagsEnum1", "TestNamespace") }); var flagsEnum2 = complexType.AddProperty( "FlagsEnum2", @@ -2027,11 +2054,11 @@ public static RuntimeComplexProperty Create(RuntimeComplexType declaringType) flagsEnum2.TypeMapping = IntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.AFlagsEnum v1, CompiledModelTestBase.AFlagsEnum v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.AFlagsEnum v) => v.GetHashCode(), + (CompiledModelTestBase.AFlagsEnum v) => ((object)v).GetHashCode(), (CompiledModelTestBase.AFlagsEnum v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.AFlagsEnum v1, CompiledModelTestBase.AFlagsEnum v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.AFlagsEnum v) => v.GetHashCode(), + (CompiledModelTestBase.AFlagsEnum v) => ((object)v).GetHashCode(), (CompiledModelTestBase.AFlagsEnum v) => v), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -2047,6 +2074,7 @@ public static RuntimeComplexProperty Create(RuntimeComplexType declaringType) (int value) => (CompiledModelTestBase.AFlagsEnum)value))); flagsEnum2.SetSentinelFromProviderValue(0); flagsEnum2.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + flagsEnum2.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("PrincipalBaseEntityType.Owned.Principal.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalBase_FlagsEnum2", "TestNamespace") }); var id = complexType.AddProperty( "Id", @@ -2088,17 +2116,18 @@ public static RuntimeComplexProperty Create(RuntimeComplexType declaringType) id.TypeMapping = SqlServerLongTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable)), providerValueComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable))); id.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + id.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("PrincipalBaseEntityType.Owned.Principal.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalBase_Id", "TestNamespace") }); var refTypeArray = complexType.AddProperty( "RefTypeArray", @@ -2138,47 +2167,47 @@ public static RuntimeComplexProperty Create(RuntimeComplexType declaringType) relationshipIndex: -1, storeGenerationIndex: -1); refTypeArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfReferenceTypesComparer(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))), storeTypePostfix: StoreTypePostfix.None, - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)))), elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), keyComparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(45)", @@ -2186,14 +2215,15 @@ public static RuntimeComplexProperty Create(RuntimeComplexType declaringType) unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))); refTypeArray.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + refTypeArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("PrincipalBaseEntityType.Owned.Principal.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalBase_RefTypeArray", "TestNamespace") }); var refTypeEnumerable = complexType.AddProperty( "RefTypeEnumerable", @@ -2233,39 +2263,39 @@ public static RuntimeComplexProperty Create(RuntimeComplexType declaringType) relationshipIndex: -1, storeGenerationIndex: -1); refTypeEnumerable.TypeMapping = SqlServerStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfReferenceTypesComparer, string>(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfReferenceTypesComparer, string>(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, string>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter, string>( JsonStringReaderWriter.Instance)), storeTypePostfix: StoreTypePostfix.None, - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, string>( + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter, string>( JsonStringReaderWriter.Instance), elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -2273,6 +2303,7 @@ public static RuntimeComplexProperty Create(RuntimeComplexType declaringType) dbType: System.Data.DbType.String), storeTypePostfix: StoreTypePostfix.None)); refTypeEnumerable.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + refTypeEnumerable.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("PrincipalBaseEntityType.Owned.Principal.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalBase_RefTypeEnumerable", "TestNamespace") }); var refTypeIList = complexType.AddProperty( "RefTypeIList", @@ -2312,39 +2343,39 @@ public static RuntimeComplexProperty Create(RuntimeComplexType declaringType) relationshipIndex: -1, storeGenerationIndex: -1); refTypeIList.TypeMapping = SqlServerStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfReferenceTypesComparer, string>(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfReferenceTypesComparer, string>(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, string>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter, string>( JsonStringReaderWriter.Instance)), storeTypePostfix: StoreTypePostfix.None, - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, string>( + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter, string>( JsonStringReaderWriter.Instance), elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -2352,6 +2383,7 @@ public static RuntimeComplexProperty Create(RuntimeComplexType declaringType) dbType: System.Data.DbType.String), storeTypePostfix: StoreTypePostfix.None)); refTypeIList.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + refTypeIList.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("PrincipalBaseEntityType.Owned.Principal.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalBase_RefTypeIList", "TestNamespace") }); var refTypeList = complexType.AddProperty( "RefTypeList", @@ -2391,47 +2423,47 @@ public static RuntimeComplexProperty Create(RuntimeComplexType declaringType) relationshipIndex: -1, storeGenerationIndex: -1); refTypeList.TypeMapping = SqlServerStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfReferenceTypesComparer, IPAddress>(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfReferenceTypesComparer, IPAddress>(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, IPAddress>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter, IPAddress>( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))), storeTypePostfix: StoreTypePostfix.None, - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, IPAddress>( + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter, IPAddress>( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)))), elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), keyComparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(45)", @@ -2439,14 +2471,15 @@ public static RuntimeComplexProperty Create(RuntimeComplexType declaringType) unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))); refTypeList.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + refTypeList.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("PrincipalBaseEntityType.Owned.Principal.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalBase_RefTypeList", "TestNamespace") }); var valueTypeArray = complexType.AddProperty( "ValueTypeArray", @@ -2486,41 +2519,42 @@ public static RuntimeComplexProperty Create(RuntimeComplexType declaringType) relationshipIndex: -1, storeGenerationIndex: -1); valueTypeArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer(new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer(new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( JsonDateTimeReaderWriter.Instance)), storeTypePostfix: StoreTypePostfix.None, - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( JsonDateTimeReaderWriter.Instance), elementMapping: SqlServerDateTimeTypeMapping.Default.Clone( comparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v), keyComparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v), providerValueComparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v))); valueTypeArray.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + valueTypeArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("PrincipalBaseEntityType.Owned.Principal.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalBase_ValueTypeArray", "TestNamespace") }); var valueTypeEnumerable = complexType.AddProperty( "ValueTypeEnumerable", @@ -2560,26 +2594,26 @@ public static RuntimeComplexProperty Create(RuntimeComplexType declaringType) relationshipIndex: -1, storeGenerationIndex: -1); valueTypeEnumerable.TypeMapping = SqlServerStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer, byte>(new ValueComparer( (byte v1, byte v2) => v1 == v2, (byte v) => (int)v, (byte v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer, byte>(new ValueComparer( (byte v1, byte v2) => v1 == v2, (byte v) => (int)v, (byte v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, byte>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter, byte>( JsonByteReaderWriter.Instance)), storeTypePostfix: StoreTypePostfix.None, - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, byte>( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, byte>( JsonByteReaderWriter.Instance), elementMapping: SqlServerByteTypeMapping.Default.Clone( comparer: new ValueComparer( @@ -2595,6 +2629,7 @@ public static RuntimeComplexProperty Create(RuntimeComplexType declaringType) (byte v) => (int)v, (byte v) => v))); valueTypeEnumerable.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + valueTypeEnumerable.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("PrincipalBaseEntityType.Owned.Principal.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalBase_ValueTypeEnumerable", "TestNamespace") }); var valueTypeIList = complexType.AddProperty( "ValueTypeIList", @@ -2634,26 +2669,26 @@ public static RuntimeComplexProperty Create(RuntimeComplexType declaringType) relationshipIndex: -1, storeGenerationIndex: -1); valueTypeIList.TypeMapping = SqlServerStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer, byte>(new ValueComparer( (byte v1, byte v2) => v1 == v2, (byte v) => (int)v, (byte v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer, byte>(new ValueComparer( (byte v1, byte v2) => v1 == v2, (byte v) => (int)v, (byte v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, byte>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter, byte>( JsonByteReaderWriter.Instance)), storeTypePostfix: StoreTypePostfix.None, - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, byte>( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, byte>( JsonByteReaderWriter.Instance), elementMapping: SqlServerByteTypeMapping.Default.Clone( comparer: new ValueComparer( @@ -2669,6 +2704,7 @@ public static RuntimeComplexProperty Create(RuntimeComplexType declaringType) (byte v) => (int)v, (byte v) => v))); valueTypeIList.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + valueTypeIList.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("PrincipalBaseEntityType.Owned.Principal.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalBase_ValueTypeIList", "TestNamespace") }); var valueTypeList = complexType.AddProperty( "ValueTypeList", @@ -2708,26 +2744,26 @@ public static RuntimeComplexProperty Create(RuntimeComplexType declaringType) relationshipIndex: -1, storeGenerationIndex: -1); valueTypeList.TypeMapping = SqlServerStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer, short>(new ValueComparer( (short v1, short v2) => v1 == v2, (short v) => (int)v, (short v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer, short>(new ValueComparer( (short v1, short v2) => v1 == v2, (short v) => (int)v, (short v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", unicode: true, dbType: System.Data.DbType.String), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, short>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter, short>( JsonInt16ReaderWriter.Instance)), storeTypePostfix: StoreTypePostfix.None, - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, short>( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, short>( JsonInt16ReaderWriter.Instance), elementMapping: SqlServerShortTypeMapping.Default.Clone( comparer: new ValueComparer( @@ -2743,6 +2779,7 @@ public static RuntimeComplexProperty Create(RuntimeComplexType declaringType) (short v) => (int)v, (short v) => v))); valueTypeList.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); + valueTypeList.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("PrincipalBaseEntityType.Owned.Principal.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalBase_ValueTypeList", "TestNamespace") }); complexType.AddAnnotation("Relational:FunctionName", "PrincipalBaseTvf"); complexType.AddAnnotation("Relational:Schema", null); @@ -2750,6 +2787,7 @@ public static RuntimeComplexProperty Create(RuntimeComplexType declaringType) complexType.AddAnnotation("Relational:TableName", "PrincipalBase"); complexType.AddAnnotation("Relational:ViewName", "PrincipalBaseView"); complexType.AddAnnotation("Relational:ViewSchema", null); + complexProperty.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("PrincipalBaseEntityType.Owned.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_OwnedType_Principal", "TestNamespace") }); return complexProperty; } @@ -2923,12 +2961,12 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (CompiledModelTestBase.PrincipalBase)source.Entity; - var liftedArg = (ISnapshot)new Snapshot, string, CompiledModelTestBase.AnEnum, Nullable, CompiledModelTestBase.AFlagsEnum, CompiledModelTestBase.AFlagsEnum, Nullable, IPAddress[], IEnumerable, IList, List, DateTime[], IEnumerable, IList, List, string, int, IPAddress[], IEnumerable, IList, List, DateTime[], IEnumerable, IList, List, Guid, CompiledModelTestBase.AnEnum, Nullable, CompiledModelTestBase.AFlagsEnum, CompiledModelTestBase.AFlagsEnum>(source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)id.GetValueComparer()).Snapshot(source.GetCurrentValue>(id)), source.GetCurrentValue(discriminator) == null ? null : ((ValueComparer)discriminator.GetValueComparer()).Snapshot(source.GetCurrentValue(discriminator)), ((ValueComparer)enum1.GetValueComparer()).Snapshot(source.GetCurrentValue(enum1)), source.GetCurrentValue>(enum2) == null ? null : ((ValueComparer>)enum2.GetValueComparer()).Snapshot(source.GetCurrentValue>(enum2)), ((ValueComparer)flagsEnum1.GetValueComparer()).Snapshot(source.GetCurrentValue(flagsEnum1)), ((ValueComparer)flagsEnum2.GetValueComparer()).Snapshot(source.GetCurrentValue(flagsEnum2)), source.GetCurrentValue>(principalBaseId) == null ? null : ((ValueComparer>)principalBaseId.GetValueComparer()).Snapshot(source.GetCurrentValue>(principalBaseId)), (IEnumerable)source.GetCurrentValue(refTypeArray) == null ? null : (IPAddress[])((ValueComparer>)refTypeArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(refTypeArray)), source.GetCurrentValue>(refTypeEnumerable) == null ? null : ((ValueComparer>)refTypeEnumerable.GetValueComparer()).Snapshot(source.GetCurrentValue>(refTypeEnumerable)), (IEnumerable)source.GetCurrentValue>(refTypeIList) == null ? null : (IList)((ValueComparer>)refTypeIList.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(refTypeIList)), (IEnumerable)source.GetCurrentValue>(refTypeList) == null ? null : (List)((ValueComparer>)refTypeList.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(refTypeList)), (IEnumerable)source.GetCurrentValue(valueTypeArray) == null ? null : (DateTime[])((ValueComparer>)valueTypeArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(valueTypeArray)), source.GetCurrentValue>(valueTypeEnumerable) == null ? null : ((ValueComparer>)valueTypeEnumerable.GetValueComparer()).Snapshot(source.GetCurrentValue>(valueTypeEnumerable)), (IEnumerable)source.GetCurrentValue>(valueTypeIList) == null ? null : (IList)((ValueComparer>)valueTypeIList.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeIList)), (IEnumerable)source.GetCurrentValue>(valueTypeList) == null ? null : (List)((ValueComparer>)valueTypeList.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeList)), source.GetCurrentValue(details) == null ? null : ((ValueComparer)details.GetValueComparer()).Snapshot(source.GetCurrentValue(details)), ((ValueComparer)number.GetValueComparer()).Snapshot(source.GetCurrentValue(number)), (IEnumerable)source.GetCurrentValue(refTypeArray0) == null ? null : (IPAddress[])((ValueComparer>)refTypeArray0.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(refTypeArray0)), source.GetCurrentValue>(refTypeEnumerable0) == null ? null : ((ValueComparer>)refTypeEnumerable0.GetValueComparer()).Snapshot(source.GetCurrentValue>(refTypeEnumerable0)), (IEnumerable)source.GetCurrentValue>(refTypeIList0) == null ? null : (IList)((ValueComparer>)refTypeIList0.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(refTypeIList0)), (IEnumerable)source.GetCurrentValue>(refTypeList0) == null ? null : (List)((ValueComparer>)refTypeList0.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(refTypeList0)), (IEnumerable)source.GetCurrentValue(valueTypeArray0) == null ? null : (DateTime[])((ValueComparer>)valueTypeArray0.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(valueTypeArray0)), source.GetCurrentValue>(valueTypeEnumerable0) == null ? null : ((ValueComparer>)valueTypeEnumerable0.GetValueComparer()).Snapshot(source.GetCurrentValue>(valueTypeEnumerable0)), (IEnumerable)source.GetCurrentValue>(valueTypeIList0) == null ? null : (IList)((ValueComparer>)valueTypeIList0.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeIList0)), (IEnumerable)source.GetCurrentValue>(valueTypeList0) == null ? null : (List)((ValueComparer>)valueTypeList0.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeList0)), ((ValueComparer)alternateId.GetValueComparer()).Snapshot(source.GetCurrentValue(alternateId)), ((ValueComparer)enum10.GetValueComparer()).Snapshot(source.GetCurrentValue(enum10)), source.GetCurrentValue>(enum20) == null ? null : ((ValueComparer>)enum20.GetValueComparer()).Snapshot(source.GetCurrentValue>(enum20)), ((ValueComparer)flagsEnum10.GetValueComparer()).Snapshot(source.GetCurrentValue(flagsEnum10)), ((ValueComparer)flagsEnum20.GetValueComparer()).Snapshot(source.GetCurrentValue(flagsEnum20))); + var liftedArg = (ISnapshot)new Snapshot, string, CompiledModelTestBase.AnEnum, Nullable, CompiledModelTestBase.AFlagsEnum, CompiledModelTestBase.AFlagsEnum, Nullable, IPAddress[], IEnumerable, IList, List, DateTime[], IEnumerable, IList, List, string, int, IPAddress[], IEnumerable, IList, List, DateTime[], IEnumerable, IList, List, Guid, CompiledModelTestBase.AnEnum, Nullable, CompiledModelTestBase.AFlagsEnum, CompiledModelTestBase.AFlagsEnum>(source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)((IProperty)id).GetValueComparer()).Snapshot(source.GetCurrentValue>(id)), source.GetCurrentValue(discriminator) == null ? null : ((ValueComparer)((IProperty)discriminator).GetValueComparer()).Snapshot(source.GetCurrentValue(discriminator)), ((ValueComparer)((IProperty)enum1).GetValueComparer()).Snapshot(source.GetCurrentValue(enum1)), source.GetCurrentValue>(enum2) == null ? null : ((ValueComparer>)((IProperty)enum2).GetValueComparer()).Snapshot(source.GetCurrentValue>(enum2)), ((ValueComparer)((IProperty)flagsEnum1).GetValueComparer()).Snapshot(source.GetCurrentValue(flagsEnum1)), ((ValueComparer)((IProperty)flagsEnum2).GetValueComparer()).Snapshot(source.GetCurrentValue(flagsEnum2)), source.GetCurrentValue>(principalBaseId) == null ? null : ((ValueComparer>)((IProperty)principalBaseId).GetValueComparer()).Snapshot(source.GetCurrentValue>(principalBaseId)), (object)source.GetCurrentValue(refTypeArray) == null ? null : (IPAddress[])((ValueComparer)((IProperty)refTypeArray).GetValueComparer()).Snapshot((object)source.GetCurrentValue(refTypeArray)), (object)source.GetCurrentValue>(refTypeEnumerable) == null ? null : (IEnumerable)((ValueComparer)((IProperty)refTypeEnumerable).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeEnumerable)), (object)source.GetCurrentValue>(refTypeIList) == null ? null : (IList)((ValueComparer)((IProperty)refTypeIList).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeIList)), (object)source.GetCurrentValue>(refTypeList) == null ? null : (List)((ValueComparer)((IProperty)refTypeList).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeList)), (IEnumerable)source.GetCurrentValue(valueTypeArray) == null ? null : (DateTime[])((ValueComparer>)((IProperty)valueTypeArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(valueTypeArray)), source.GetCurrentValue>(valueTypeEnumerable) == null ? null : ((ValueComparer>)((IProperty)valueTypeEnumerable).GetValueComparer()).Snapshot(source.GetCurrentValue>(valueTypeEnumerable)), (IEnumerable)source.GetCurrentValue>(valueTypeIList) == null ? null : (IList)((ValueComparer>)((IProperty)valueTypeIList).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeIList)), (IEnumerable)source.GetCurrentValue>(valueTypeList) == null ? null : (List)((ValueComparer>)((IProperty)valueTypeList).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeList)), source.GetCurrentValue(details) == null ? null : ((ValueComparer)((IProperty)details).GetValueComparer()).Snapshot(source.GetCurrentValue(details)), ((ValueComparer)((IProperty)number).GetValueComparer()).Snapshot(source.GetCurrentValue(number)), (object)source.GetCurrentValue(refTypeArray0) == null ? null : (IPAddress[])((ValueComparer)((IProperty)refTypeArray0).GetValueComparer()).Snapshot((object)source.GetCurrentValue(refTypeArray0)), (object)source.GetCurrentValue>(refTypeEnumerable0) == null ? null : (IEnumerable)((ValueComparer)((IProperty)refTypeEnumerable0).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeEnumerable0)), (object)source.GetCurrentValue>(refTypeIList0) == null ? null : (IList)((ValueComparer)((IProperty)refTypeIList0).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeIList0)), (object)source.GetCurrentValue>(refTypeList0) == null ? null : (List)((ValueComparer)((IProperty)refTypeList0).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeList0)), (IEnumerable)source.GetCurrentValue(valueTypeArray0) == null ? null : (DateTime[])((ValueComparer>)((IProperty)valueTypeArray0).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(valueTypeArray0)), source.GetCurrentValue>(valueTypeEnumerable0) == null ? null : ((ValueComparer>)((IProperty)valueTypeEnumerable0).GetValueComparer()).Snapshot(source.GetCurrentValue>(valueTypeEnumerable0)), (IEnumerable)source.GetCurrentValue>(valueTypeIList0) == null ? null : (IList)((ValueComparer>)((IProperty)valueTypeIList0).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeIList0)), (IEnumerable)source.GetCurrentValue>(valueTypeList0) == null ? null : (List)((ValueComparer>)((IProperty)valueTypeList0).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeList0)), ((ValueComparer)((IProperty)alternateId).GetValueComparer()).Snapshot(source.GetCurrentValue(alternateId)), ((ValueComparer)((IProperty)enum10).GetValueComparer()).Snapshot(source.GetCurrentValue(enum10)), source.GetCurrentValue>(enum20) == null ? null : ((ValueComparer>)((IProperty)enum20).GetValueComparer()).Snapshot(source.GetCurrentValue>(enum20)), ((ValueComparer)((IProperty)flagsEnum10).GetValueComparer()).Snapshot(source.GetCurrentValue(flagsEnum10)), ((ValueComparer)((IProperty)flagsEnum20).GetValueComparer()).Snapshot(source.GetCurrentValue(flagsEnum20))); var entity0 = (CompiledModelTestBase.PrincipalBase)source.Entity; - return (ISnapshot)new MultiSnapshot(new ISnapshot[] { liftedArg, (ISnapshot)new Snapshot, IPAddress[], IEnumerable, IList, List, DateTime[], IEnumerable, IList, List>(source.GetCurrentValue>(id0) == null ? null : ((ValueComparer>)id0.GetValueComparer()).Snapshot(source.GetCurrentValue>(id0)), (IEnumerable)source.GetCurrentValue(refTypeArray1) == null ? null : (IPAddress[])((ValueComparer>)refTypeArray1.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(refTypeArray1)), source.GetCurrentValue>(refTypeEnumerable1) == null ? null : ((ValueComparer>)refTypeEnumerable1.GetValueComparer()).Snapshot(source.GetCurrentValue>(refTypeEnumerable1)), (IEnumerable)source.GetCurrentValue>(refTypeIList1) == null ? null : (IList)((ValueComparer>)refTypeIList1.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(refTypeIList1)), (IEnumerable)source.GetCurrentValue>(refTypeList1) == null ? null : (List)((ValueComparer>)refTypeList1.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(refTypeList1)), (IEnumerable)source.GetCurrentValue(valueTypeArray1) == null ? null : (DateTime[])((ValueComparer>)valueTypeArray1.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(valueTypeArray1)), source.GetCurrentValue>(valueTypeEnumerable1) == null ? null : ((ValueComparer>)valueTypeEnumerable1.GetValueComparer()).Snapshot(source.GetCurrentValue>(valueTypeEnumerable1)), (IEnumerable)source.GetCurrentValue>(valueTypeIList1) == null ? null : (IList)((ValueComparer>)valueTypeIList1.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeIList1)), (IEnumerable)source.GetCurrentValue>(valueTypeList1) == null ? null : (List)((ValueComparer>)valueTypeList1.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeList1))) }); + return (ISnapshot)new MultiSnapshot(new ISnapshot[] { liftedArg, (ISnapshot)new Snapshot, IPAddress[], IEnumerable, IList, List, DateTime[], IEnumerable, IList, List>(source.GetCurrentValue>(id0) == null ? null : ((ValueComparer>)((IProperty)id0).GetValueComparer()).Snapshot(source.GetCurrentValue>(id0)), (object)source.GetCurrentValue(refTypeArray1) == null ? null : (IPAddress[])((ValueComparer)((IProperty)refTypeArray1).GetValueComparer()).Snapshot((object)source.GetCurrentValue(refTypeArray1)), (object)source.GetCurrentValue>(refTypeEnumerable1) == null ? null : (IEnumerable)((ValueComparer)((IProperty)refTypeEnumerable1).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeEnumerable1)), (object)source.GetCurrentValue>(refTypeIList1) == null ? null : (IList)((ValueComparer)((IProperty)refTypeIList1).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeIList1)), (object)source.GetCurrentValue>(refTypeList1) == null ? null : (List)((ValueComparer)((IProperty)refTypeList1).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeList1)), (IEnumerable)source.GetCurrentValue(valueTypeArray1) == null ? null : (DateTime[])((ValueComparer>)((IProperty)valueTypeArray1).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(valueTypeArray1)), source.GetCurrentValue>(valueTypeEnumerable1) == null ? null : ((ValueComparer>)((IProperty)valueTypeEnumerable1).GetValueComparer()).Snapshot(source.GetCurrentValue>(valueTypeEnumerable1)), (IEnumerable)source.GetCurrentValue>(valueTypeIList1) == null ? null : (IList)((ValueComparer>)((IProperty)valueTypeIList1).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeIList1)), (IEnumerable)source.GetCurrentValue>(valueTypeList1) == null ? null : (List)((ValueComparer>)((IProperty)valueTypeList1).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeList1))) }); }); runtimeEntityType.SetStoreGeneratedValuesFactory( - () => (ISnapshot)new Snapshot, Nullable, string>(default(Nullable) == null ? null : ((ValueComparer>)id.GetValueComparer()).Snapshot(default(Nullable)), default(Nullable) == null ? null : ((ValueComparer>)principalBaseId.GetValueComparer()).Snapshot(default(Nullable)), default(string) == null ? null : ((ValueComparer)details.GetValueComparer()).Snapshot(default(string)))); + () => (ISnapshot)new Snapshot, Nullable, string>(default(Nullable) == null ? null : ((ValueComparer>)((IProperty)id).GetValueComparer()).Snapshot(default(Nullable)), default(Nullable) == null ? null : ((ValueComparer>)((IProperty)principalBaseId).GetValueComparer()).Snapshot(default(Nullable)), default(string) == null ? null : ((ValueComparer)((IProperty)details).GetValueComparer()).Snapshot(default(string)))); runtimeEntityType.SetTemporaryValuesFactory( (InternalEntityEntry source) => (ISnapshot)new Snapshot, Nullable, string>(default(Nullable), default(Nullable), default(string))); runtimeEntityType.SetShadowValuesFactory( @@ -2938,8 +2976,8 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) runtimeEntityType.SetRelationshipSnapshotFactory( (InternalEntityEntry source) => { - var entity = (CompiledModelTestBase.PrincipalBase)source.Entity; - return (ISnapshot)new Snapshot, Nullable, object>(source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)id.GetKeyValueComparer()).Snapshot(source.GetCurrentValue>(id)), source.GetCurrentValue>(principalBaseId) == null ? null : ((ValueComparer>)principalBaseId.GetKeyValueComparer()).Snapshot(source.GetCurrentValue>(principalBaseId)), SnapshotFactoryFactory.SnapshotCollection(UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalBase_Deriveds(entity))); + var entity1 = (CompiledModelTestBase.PrincipalBase)source.Entity; + return (ISnapshot)new Snapshot, Nullable, object>(source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)((IProperty)id).GetKeyValueComparer()).Snapshot(source.GetCurrentValue>(id)), source.GetCurrentValue>(principalBaseId) == null ? null : ((ValueComparer>)((IProperty)principalBaseId).GetKeyValueComparer()).Snapshot(source.GetCurrentValue>(principalBaseId)), SnapshotFactoryFactory.SnapshotCollection(UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalBase_Deriveds(entity1))); }); runtimeEntityType.Counts = new PropertyCounts( propertyCount: 39, diff --git a/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/ComplexTypes/PrincipalDerivedEntityType.cs b/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/ComplexTypes/PrincipalDerivedEntityType.cs index dea19aae7b7..edbf96651c0 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/ComplexTypes/PrincipalDerivedEntityType.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/ComplexTypes/PrincipalDerivedEntityType.cs @@ -81,12 +81,12 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity1 = (CompiledModelTestBase.PrincipalDerived>>)source.Entity; - var liftedArg0 = (ISnapshot)new Snapshot, string, CompiledModelTestBase.AnEnum, Nullable, CompiledModelTestBase.AFlagsEnum, CompiledModelTestBase.AFlagsEnum, Nullable, IPAddress[], IEnumerable, IList, List, DateTime[], IEnumerable, IList, List, string, int, IPAddress[], IEnumerable, IList, List, DateTime[], IEnumerable, IList, List, Guid, CompiledModelTestBase.AnEnum, Nullable, CompiledModelTestBase.AFlagsEnum, CompiledModelTestBase.AFlagsEnum>(source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)id.GetValueComparer()).Snapshot(source.GetCurrentValue>(id)), source.GetCurrentValue(discriminator) == null ? null : ((ValueComparer)discriminator.GetValueComparer()).Snapshot(source.GetCurrentValue(discriminator)), ((ValueComparer)enum1.GetValueComparer()).Snapshot(source.GetCurrentValue(enum1)), source.GetCurrentValue>(enum2) == null ? null : ((ValueComparer>)enum2.GetValueComparer()).Snapshot(source.GetCurrentValue>(enum2)), ((ValueComparer)flagsEnum1.GetValueComparer()).Snapshot(source.GetCurrentValue(flagsEnum1)), ((ValueComparer)flagsEnum2.GetValueComparer()).Snapshot(source.GetCurrentValue(flagsEnum2)), source.GetCurrentValue>(principalBaseId) == null ? null : ((ValueComparer>)principalBaseId.GetValueComparer()).Snapshot(source.GetCurrentValue>(principalBaseId)), (IEnumerable)source.GetCurrentValue(refTypeArray) == null ? null : (IPAddress[])((ValueComparer>)refTypeArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(refTypeArray)), source.GetCurrentValue>(refTypeEnumerable) == null ? null : ((ValueComparer>)refTypeEnumerable.GetValueComparer()).Snapshot(source.GetCurrentValue>(refTypeEnumerable)), (IEnumerable)source.GetCurrentValue>(refTypeIList) == null ? null : (IList)((ValueComparer>)refTypeIList.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(refTypeIList)), (IEnumerable)source.GetCurrentValue>(refTypeList) == null ? null : (List)((ValueComparer>)refTypeList.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(refTypeList)), (IEnumerable)source.GetCurrentValue(valueTypeArray) == null ? null : (DateTime[])((ValueComparer>)valueTypeArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(valueTypeArray)), source.GetCurrentValue>(valueTypeEnumerable) == null ? null : ((ValueComparer>)valueTypeEnumerable.GetValueComparer()).Snapshot(source.GetCurrentValue>(valueTypeEnumerable)), (IEnumerable)source.GetCurrentValue>(valueTypeIList) == null ? null : (IList)((ValueComparer>)valueTypeIList.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeIList)), (IEnumerable)source.GetCurrentValue>(valueTypeList) == null ? null : (List)((ValueComparer>)valueTypeList.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeList)), source.GetCurrentValue(details) == null ? null : ((ValueComparer)details.GetValueComparer()).Snapshot(source.GetCurrentValue(details)), ((ValueComparer)number.GetValueComparer()).Snapshot(source.GetCurrentValue(number)), (IEnumerable)source.GetCurrentValue(refTypeArray0) == null ? null : (IPAddress[])((ValueComparer>)refTypeArray0.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(refTypeArray0)), source.GetCurrentValue>(refTypeEnumerable0) == null ? null : ((ValueComparer>)refTypeEnumerable0.GetValueComparer()).Snapshot(source.GetCurrentValue>(refTypeEnumerable0)), (IEnumerable)source.GetCurrentValue>(refTypeIList0) == null ? null : (IList)((ValueComparer>)refTypeIList0.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(refTypeIList0)), (IEnumerable)source.GetCurrentValue>(refTypeList0) == null ? null : (List)((ValueComparer>)refTypeList0.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(refTypeList0)), (IEnumerable)source.GetCurrentValue(valueTypeArray0) == null ? null : (DateTime[])((ValueComparer>)valueTypeArray0.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(valueTypeArray0)), source.GetCurrentValue>(valueTypeEnumerable0) == null ? null : ((ValueComparer>)valueTypeEnumerable0.GetValueComparer()).Snapshot(source.GetCurrentValue>(valueTypeEnumerable0)), (IEnumerable)source.GetCurrentValue>(valueTypeIList0) == null ? null : (IList)((ValueComparer>)valueTypeIList0.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeIList0)), (IEnumerable)source.GetCurrentValue>(valueTypeList0) == null ? null : (List)((ValueComparer>)valueTypeList0.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeList0)), ((ValueComparer)alternateId.GetValueComparer()).Snapshot(source.GetCurrentValue(alternateId)), ((ValueComparer)enum10.GetValueComparer()).Snapshot(source.GetCurrentValue(enum10)), source.GetCurrentValue>(enum20) == null ? null : ((ValueComparer>)enum20.GetValueComparer()).Snapshot(source.GetCurrentValue>(enum20)), ((ValueComparer)flagsEnum10.GetValueComparer()).Snapshot(source.GetCurrentValue(flagsEnum10)), ((ValueComparer)flagsEnum20.GetValueComparer()).Snapshot(source.GetCurrentValue(flagsEnum20))); + var liftedArg0 = (ISnapshot)new Snapshot, string, CompiledModelTestBase.AnEnum, Nullable, CompiledModelTestBase.AFlagsEnum, CompiledModelTestBase.AFlagsEnum, Nullable, IPAddress[], IEnumerable, IList, List, DateTime[], IEnumerable, IList, List, string, int, IPAddress[], IEnumerable, IList, List, DateTime[], IEnumerable, IList, List, Guid, CompiledModelTestBase.AnEnum, Nullable, CompiledModelTestBase.AFlagsEnum, CompiledModelTestBase.AFlagsEnum>(source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)((IProperty)id).GetValueComparer()).Snapshot(source.GetCurrentValue>(id)), source.GetCurrentValue(discriminator) == null ? null : ((ValueComparer)((IProperty)discriminator).GetValueComparer()).Snapshot(source.GetCurrentValue(discriminator)), ((ValueComparer)((IProperty)enum1).GetValueComparer()).Snapshot(source.GetCurrentValue(enum1)), source.GetCurrentValue>(enum2) == null ? null : ((ValueComparer>)((IProperty)enum2).GetValueComparer()).Snapshot(source.GetCurrentValue>(enum2)), ((ValueComparer)((IProperty)flagsEnum1).GetValueComparer()).Snapshot(source.GetCurrentValue(flagsEnum1)), ((ValueComparer)((IProperty)flagsEnum2).GetValueComparer()).Snapshot(source.GetCurrentValue(flagsEnum2)), source.GetCurrentValue>(principalBaseId) == null ? null : ((ValueComparer>)((IProperty)principalBaseId).GetValueComparer()).Snapshot(source.GetCurrentValue>(principalBaseId)), (object)source.GetCurrentValue(refTypeArray) == null ? null : (IPAddress[])((ValueComparer)((IProperty)refTypeArray).GetValueComparer()).Snapshot((object)source.GetCurrentValue(refTypeArray)), (object)source.GetCurrentValue>(refTypeEnumerable) == null ? null : (IEnumerable)((ValueComparer)((IProperty)refTypeEnumerable).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeEnumerable)), (object)source.GetCurrentValue>(refTypeIList) == null ? null : (IList)((ValueComparer)((IProperty)refTypeIList).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeIList)), (object)source.GetCurrentValue>(refTypeList) == null ? null : (List)((ValueComparer)((IProperty)refTypeList).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeList)), (IEnumerable)source.GetCurrentValue(valueTypeArray) == null ? null : (DateTime[])((ValueComparer>)((IProperty)valueTypeArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(valueTypeArray)), source.GetCurrentValue>(valueTypeEnumerable) == null ? null : ((ValueComparer>)((IProperty)valueTypeEnumerable).GetValueComparer()).Snapshot(source.GetCurrentValue>(valueTypeEnumerable)), (IEnumerable)source.GetCurrentValue>(valueTypeIList) == null ? null : (IList)((ValueComparer>)((IProperty)valueTypeIList).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeIList)), (IEnumerable)source.GetCurrentValue>(valueTypeList) == null ? null : (List)((ValueComparer>)((IProperty)valueTypeList).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeList)), source.GetCurrentValue(details) == null ? null : ((ValueComparer)((IProperty)details).GetValueComparer()).Snapshot(source.GetCurrentValue(details)), ((ValueComparer)((IProperty)number).GetValueComparer()).Snapshot(source.GetCurrentValue(number)), (object)source.GetCurrentValue(refTypeArray0) == null ? null : (IPAddress[])((ValueComparer)((IProperty)refTypeArray0).GetValueComparer()).Snapshot((object)source.GetCurrentValue(refTypeArray0)), (object)source.GetCurrentValue>(refTypeEnumerable0) == null ? null : (IEnumerable)((ValueComparer)((IProperty)refTypeEnumerable0).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeEnumerable0)), (object)source.GetCurrentValue>(refTypeIList0) == null ? null : (IList)((ValueComparer)((IProperty)refTypeIList0).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeIList0)), (object)source.GetCurrentValue>(refTypeList0) == null ? null : (List)((ValueComparer)((IProperty)refTypeList0).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeList0)), (IEnumerable)source.GetCurrentValue(valueTypeArray0) == null ? null : (DateTime[])((ValueComparer>)((IProperty)valueTypeArray0).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(valueTypeArray0)), source.GetCurrentValue>(valueTypeEnumerable0) == null ? null : ((ValueComparer>)((IProperty)valueTypeEnumerable0).GetValueComparer()).Snapshot(source.GetCurrentValue>(valueTypeEnumerable0)), (IEnumerable)source.GetCurrentValue>(valueTypeIList0) == null ? null : (IList)((ValueComparer>)((IProperty)valueTypeIList0).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeIList0)), (IEnumerable)source.GetCurrentValue>(valueTypeList0) == null ? null : (List)((ValueComparer>)((IProperty)valueTypeList0).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeList0)), ((ValueComparer)((IProperty)alternateId).GetValueComparer()).Snapshot(source.GetCurrentValue(alternateId)), ((ValueComparer)((IProperty)enum10).GetValueComparer()).Snapshot(source.GetCurrentValue(enum10)), source.GetCurrentValue>(enum20) == null ? null : ((ValueComparer>)((IProperty)enum20).GetValueComparer()).Snapshot(source.GetCurrentValue>(enum20)), ((ValueComparer)((IProperty)flagsEnum10).GetValueComparer()).Snapshot(source.GetCurrentValue(flagsEnum10)), ((ValueComparer)((IProperty)flagsEnum20).GetValueComparer()).Snapshot(source.GetCurrentValue(flagsEnum20))); var entity2 = (CompiledModelTestBase.PrincipalDerived>>)source.Entity; - return (ISnapshot)new MultiSnapshot(new ISnapshot[] { liftedArg0, (ISnapshot)new Snapshot, IPAddress[], IEnumerable, IList, List, DateTime[], IEnumerable, IList, List>(source.GetCurrentValue>(id0) == null ? null : ((ValueComparer>)id0.GetValueComparer()).Snapshot(source.GetCurrentValue>(id0)), (IEnumerable)source.GetCurrentValue(refTypeArray1) == null ? null : (IPAddress[])((ValueComparer>)refTypeArray1.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(refTypeArray1)), source.GetCurrentValue>(refTypeEnumerable1) == null ? null : ((ValueComparer>)refTypeEnumerable1.GetValueComparer()).Snapshot(source.GetCurrentValue>(refTypeEnumerable1)), (IEnumerable)source.GetCurrentValue>(refTypeIList1) == null ? null : (IList)((ValueComparer>)refTypeIList1.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(refTypeIList1)), (IEnumerable)source.GetCurrentValue>(refTypeList1) == null ? null : (List)((ValueComparer>)refTypeList1.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(refTypeList1)), (IEnumerable)source.GetCurrentValue(valueTypeArray1) == null ? null : (DateTime[])((ValueComparer>)valueTypeArray1.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(valueTypeArray1)), source.GetCurrentValue>(valueTypeEnumerable1) == null ? null : ((ValueComparer>)valueTypeEnumerable1.GetValueComparer()).Snapshot(source.GetCurrentValue>(valueTypeEnumerable1)), (IEnumerable)source.GetCurrentValue>(valueTypeIList1) == null ? null : (IList)((ValueComparer>)valueTypeIList1.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeIList1)), (IEnumerable)source.GetCurrentValue>(valueTypeList1) == null ? null : (List)((ValueComparer>)valueTypeList1.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeList1))) }); + return (ISnapshot)new MultiSnapshot(new ISnapshot[] { liftedArg0, (ISnapshot)new Snapshot, IPAddress[], IEnumerable, IList, List, DateTime[], IEnumerable, IList, List>(source.GetCurrentValue>(id0) == null ? null : ((ValueComparer>)((IProperty)id0).GetValueComparer()).Snapshot(source.GetCurrentValue>(id0)), (object)source.GetCurrentValue(refTypeArray1) == null ? null : (IPAddress[])((ValueComparer)((IProperty)refTypeArray1).GetValueComparer()).Snapshot((object)source.GetCurrentValue(refTypeArray1)), (object)source.GetCurrentValue>(refTypeEnumerable1) == null ? null : (IEnumerable)((ValueComparer)((IProperty)refTypeEnumerable1).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeEnumerable1)), (object)source.GetCurrentValue>(refTypeIList1) == null ? null : (IList)((ValueComparer)((IProperty)refTypeIList1).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeIList1)), (object)source.GetCurrentValue>(refTypeList1) == null ? null : (List)((ValueComparer)((IProperty)refTypeList1).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeList1)), (IEnumerable)source.GetCurrentValue(valueTypeArray1) == null ? null : (DateTime[])((ValueComparer>)((IProperty)valueTypeArray1).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(valueTypeArray1)), source.GetCurrentValue>(valueTypeEnumerable1) == null ? null : ((ValueComparer>)((IProperty)valueTypeEnumerable1).GetValueComparer()).Snapshot(source.GetCurrentValue>(valueTypeEnumerable1)), (IEnumerable)source.GetCurrentValue>(valueTypeIList1) == null ? null : (IList)((ValueComparer>)((IProperty)valueTypeIList1).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeIList1)), (IEnumerable)source.GetCurrentValue>(valueTypeList1) == null ? null : (List)((ValueComparer>)((IProperty)valueTypeList1).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeList1))) }); }); runtimeEntityType.SetStoreGeneratedValuesFactory( - () => (ISnapshot)new Snapshot, Nullable, string>(default(Nullable) == null ? null : ((ValueComparer>)id.GetValueComparer()).Snapshot(default(Nullable)), default(Nullable) == null ? null : ((ValueComparer>)principalBaseId.GetValueComparer()).Snapshot(default(Nullable)), default(string) == null ? null : ((ValueComparer)details.GetValueComparer()).Snapshot(default(string)))); + () => (ISnapshot)new Snapshot, Nullable, string>(default(Nullable) == null ? null : ((ValueComparer>)((IProperty)id).GetValueComparer()).Snapshot(default(Nullable)), default(Nullable) == null ? null : ((ValueComparer>)((IProperty)principalBaseId).GetValueComparer()).Snapshot(default(Nullable)), default(string) == null ? null : ((ValueComparer)((IProperty)details).GetValueComparer()).Snapshot(default(string)))); runtimeEntityType.SetTemporaryValuesFactory( (InternalEntityEntry source) => (ISnapshot)new Snapshot, Nullable, string>(default(Nullable), default(Nullable), default(string))); runtimeEntityType.SetShadowValuesFactory( @@ -96,8 +96,8 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) runtimeEntityType.SetRelationshipSnapshotFactory( (InternalEntityEntry source) => { - var entity = (CompiledModelTestBase.PrincipalDerived>>)source.Entity; - return (ISnapshot)new Snapshot, Nullable, object>(source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)id.GetKeyValueComparer()).Snapshot(source.GetCurrentValue>(id)), source.GetCurrentValue>(principalBaseId) == null ? null : ((ValueComparer>)principalBaseId.GetKeyValueComparer()).Snapshot(source.GetCurrentValue>(principalBaseId)), SnapshotFactoryFactory.SnapshotCollection(PrincipalBaseEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalBase_Deriveds(entity))); + var entity3 = (CompiledModelTestBase.PrincipalDerived>>)source.Entity; + return (ISnapshot)new Snapshot, Nullable, object>(source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)((IProperty)id).GetKeyValueComparer()).Snapshot(source.GetCurrentValue>(id)), source.GetCurrentValue>(principalBaseId) == null ? null : ((ValueComparer>)((IProperty)principalBaseId).GetKeyValueComparer()).Snapshot(source.GetCurrentValue>(principalBaseId)), SnapshotFactoryFactory.SnapshotCollection(PrincipalBaseEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalBase_Deriveds(entity3))); }); runtimeEntityType.Counts = new PropertyCounts( propertyCount: 39, diff --git a/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/Dynamic_schema/DataEntityType.cs b/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/Dynamic_schema/DataEntityType.cs index 58ca91d5145..34d172a6b35 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/Dynamic_schema/DataEntityType.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/Dynamic_schema/DataEntityType.cs @@ -89,7 +89,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas blob.TypeMapping = SqlServerByteArrayTypeMapping.Default.Clone( comparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), - (byte[] v) => v.GetHashCode(), + (byte[] v) => ((object)v).GetHashCode(), (byte[] v) => v), keyComparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), @@ -120,10 +120,10 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (CompiledModelTestBase.Data)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)id.GetValueComparer()).Snapshot(source.GetCurrentValue(id)), source.GetCurrentValue(blob) == null ? null : ((ValueComparer)blob.GetValueComparer()).Snapshot(source.GetCurrentValue(blob))); + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetValueComparer()).Snapshot(source.GetCurrentValue(id)), source.GetCurrentValue(blob) == null ? null : ((ValueComparer)((IProperty)blob).GetValueComparer()).Snapshot(source.GetCurrentValue(blob))); }); runtimeEntityType.SetStoreGeneratedValuesFactory( - () => (ISnapshot)new Snapshot(((ValueComparer)id.GetValueComparer()).Snapshot(default(int)))); + () => (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetValueComparer()).Snapshot(default(int)))); runtimeEntityType.SetTemporaryValuesFactory( (InternalEntityEntry source) => (ISnapshot)new Snapshot(default(int))); runtimeEntityType.SetShadowValuesFactory( @@ -134,7 +134,7 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (CompiledModelTestBase.Data)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)id.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(id))); + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(id))); }); runtimeEntityType.Counts = new PropertyCounts( propertyCount: 2, diff --git a/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/Key_HiLo_sequence/DataEntityType.cs b/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/Key_HiLo_sequence/DataEntityType.cs index 07ce9961576..370b7b8cbd6 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/Key_HiLo_sequence/DataEntityType.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/Key_HiLo_sequence/DataEntityType.cs @@ -91,7 +91,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas blob.TypeMapping = SqlServerByteArrayTypeMapping.Default.Clone( comparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), - (byte[] v) => v.GetHashCode(), + (byte[] v) => ((object)v).GetHashCode(), (byte[] v) => v), keyComparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), @@ -122,10 +122,10 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (CompiledModelTestBase.Data)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)id.GetValueComparer()).Snapshot(source.GetCurrentValue(id)), source.GetCurrentValue(blob) == null ? null : ((ValueComparer)blob.GetValueComparer()).Snapshot(source.GetCurrentValue(blob))); + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetValueComparer()).Snapshot(source.GetCurrentValue(id)), source.GetCurrentValue(blob) == null ? null : ((ValueComparer)((IProperty)blob).GetValueComparer()).Snapshot(source.GetCurrentValue(blob))); }); runtimeEntityType.SetStoreGeneratedValuesFactory( - () => (ISnapshot)new Snapshot(((ValueComparer)id.GetValueComparer()).Snapshot(default(int)))); + () => (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetValueComparer()).Snapshot(default(int)))); runtimeEntityType.SetTemporaryValuesFactory( (InternalEntityEntry source) => (ISnapshot)new Snapshot(default(int))); runtimeEntityType.SetShadowValuesFactory( @@ -136,7 +136,7 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (CompiledModelTestBase.Data)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)id.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(id))); + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(id))); }); runtimeEntityType.Counts = new PropertyCounts( propertyCount: 2, diff --git a/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/Key_sequence/DataEntityType.cs b/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/Key_sequence/DataEntityType.cs index 043e380a45f..39cd0943da6 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/Key_sequence/DataEntityType.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/Key_sequence/DataEntityType.cs @@ -92,7 +92,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas blob.TypeMapping = SqlServerByteArrayTypeMapping.Default.Clone( comparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), - (byte[] v) => v.GetHashCode(), + (byte[] v) => ((object)v).GetHashCode(), (byte[] v) => v), keyComparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), @@ -123,10 +123,10 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (CompiledModelTestBase.Data)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)id.GetValueComparer()).Snapshot(source.GetCurrentValue(id)), source.GetCurrentValue(blob) == null ? null : ((ValueComparer)blob.GetValueComparer()).Snapshot(source.GetCurrentValue(blob))); + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetValueComparer()).Snapshot(source.GetCurrentValue(id)), source.GetCurrentValue(blob) == null ? null : ((ValueComparer)((IProperty)blob).GetValueComparer()).Snapshot(source.GetCurrentValue(blob))); }); runtimeEntityType.SetStoreGeneratedValuesFactory( - () => (ISnapshot)new Snapshot(((ValueComparer)id.GetValueComparer()).Snapshot(default(int)))); + () => (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetValueComparer()).Snapshot(default(int)))); runtimeEntityType.SetTemporaryValuesFactory( (InternalEntityEntry source) => (ISnapshot)new Snapshot(default(int))); runtimeEntityType.SetShadowValuesFactory( @@ -137,7 +137,7 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (CompiledModelTestBase.Data)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)id.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(id))); + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(id))); }); runtimeEntityType.Counts = new PropertyCounts( propertyCount: 2, diff --git a/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/SimpleModel/DependentDerivedEntityType.cs b/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/SimpleModel/DependentDerivedEntityType.cs index 58bc4ebdacb..3c573981e85 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/SimpleModel/DependentDerivedEntityType.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/SimpleModel/DependentDerivedEntityType.cs @@ -104,15 +104,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas data.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -137,7 +137,7 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (CompiledModelTestBase.DependentDerived)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)id.GetValueComparer()).Snapshot(source.GetCurrentValue(id)), source.GetCurrentValue(data) == null ? null : ((ValueComparer)data.GetValueComparer()).Snapshot(source.GetCurrentValue(data))); + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetValueComparer()).Snapshot(source.GetCurrentValue(id)), source.GetCurrentValue(data) == null ? null : ((ValueComparer)((IProperty)data).GetValueComparer()).Snapshot(source.GetCurrentValue(data))); }); runtimeEntityType.SetStoreGeneratedValuesFactory( () => Snapshot.Empty); @@ -151,7 +151,7 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (CompiledModelTestBase.DependentDerived)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)id.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(id))); + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(id))); }); runtimeEntityType.Counts = new PropertyCounts( propertyCount: 2, diff --git a/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/SpatialTypesTest/SpatialTypesEntityType.cs b/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/SpatialTypesTest/SpatialTypesEntityType.cs index af5656d69da..bfc2ebeba76 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/SpatialTypesTest/SpatialTypesEntityType.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/SpatialTypesTest/SpatialTypesEntityType.cs @@ -110,10 +110,10 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (CompiledModelRelationalTestBase.SpatialTypes)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)id.GetValueComparer()).Snapshot(source.GetCurrentValue(id)), source.GetCurrentValue(point) == null ? null : ((ValueComparer)point.GetValueComparer()).Snapshot(source.GetCurrentValue(point))); + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetValueComparer()).Snapshot(source.GetCurrentValue(id)), source.GetCurrentValue(point) == null ? null : ((ValueComparer)((IProperty)point).GetValueComparer()).Snapshot(source.GetCurrentValue(point))); }); runtimeEntityType.SetStoreGeneratedValuesFactory( - () => (ISnapshot)new Snapshot(((ValueComparer)id.GetValueComparer()).Snapshot(default(int)), default(Point) == null ? null : ((ValueComparer)point.GetValueComparer()).Snapshot(default(Point)))); + () => (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetValueComparer()).Snapshot(default(int)), default(Point) == null ? null : ((ValueComparer)((IProperty)point).GetValueComparer()).Snapshot(default(Point)))); runtimeEntityType.SetTemporaryValuesFactory( (InternalEntityEntry source) => (ISnapshot)new Snapshot(default(int), default(Point))); runtimeEntityType.SetShadowValuesFactory( @@ -124,7 +124,7 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (CompiledModelRelationalTestBase.SpatialTypes)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)id.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(id))); + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(id))); }); runtimeEntityType.Counts = new PropertyCounts( propertyCount: 2, diff --git a/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/Tpc_Sprocs/DependentBaseEntityType.cs b/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/Tpc_Sprocs/DependentBaseEntityType.cs index 6f7c6e30be2..a718edda545 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/Tpc_Sprocs/DependentBaseEntityType.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/Tpc_Sprocs/DependentBaseEntityType.cs @@ -90,15 +90,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas principalId.TypeMapping = SqlServerLongTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable)), providerValueComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable))); principalId.SetCurrentValueComparer(new EntryCurrentValueComparer(principalId)); principalId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); @@ -192,10 +192,10 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (CompiledModelTestBase.DependentBase>)source.Entity; - return (ISnapshot)new Snapshot, Nullable>(source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)id.GetValueComparer()).Snapshot(source.GetCurrentValue>(id)), source.GetCurrentValue>(principalId) == null ? null : ((ValueComparer>)principalId.GetValueComparer()).Snapshot(source.GetCurrentValue>(principalId))); + return (ISnapshot)new Snapshot, Nullable>(source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)((IProperty)id).GetValueComparer()).Snapshot(source.GetCurrentValue>(id)), source.GetCurrentValue>(principalId) == null ? null : ((ValueComparer>)((IProperty)principalId).GetValueComparer()).Snapshot(source.GetCurrentValue>(principalId))); }); runtimeEntityType.SetStoreGeneratedValuesFactory( - () => (ISnapshot)new Snapshot>(default(Nullable) == null ? null : ((ValueComparer>)principalId.GetValueComparer()).Snapshot(default(Nullable)))); + () => (ISnapshot)new Snapshot>(default(Nullable) == null ? null : ((ValueComparer>)((IProperty)principalId).GetValueComparer()).Snapshot(default(Nullable)))); runtimeEntityType.SetTemporaryValuesFactory( (InternalEntityEntry source) => (ISnapshot)new Snapshot>(default(Nullable))); runtimeEntityType.SetShadowValuesFactory( @@ -206,7 +206,7 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (CompiledModelTestBase.DependentBase>)source.Entity; - return (ISnapshot)new Snapshot, Nullable, object>(source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)id.GetKeyValueComparer()).Snapshot(source.GetCurrentValue>(id)), source.GetCurrentValue>(principalId) == null ? null : ((ValueComparer>)principalId.GetKeyValueComparer()).Snapshot(source.GetCurrentValue>(principalId)), UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_DependentBase1_Principal(entity)); + return (ISnapshot)new Snapshot, Nullable, object>(source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)((IProperty)id).GetKeyValueComparer()).Snapshot(source.GetCurrentValue>(id)), source.GetCurrentValue>(principalId) == null ? null : ((ValueComparer>)((IProperty)principalId).GetKeyValueComparer()).Snapshot(source.GetCurrentValue>(principalId)), UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_DependentBase1_Principal(entity)); }); runtimeEntityType.Counts = new PropertyCounts( propertyCount: 2, diff --git a/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/Tpc_Sprocs/PrincipalBaseEntityType.cs b/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/Tpc_Sprocs/PrincipalBaseEntityType.cs index f6f3d5f26cc..740c79473fc 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/Tpc_Sprocs/PrincipalBaseEntityType.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/Tpc_Sprocs/PrincipalBaseEntityType.cs @@ -68,15 +68,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas id.TypeMapping = SqlServerLongTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable)), providerValueComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable))); id.SetCurrentValueComparer(new EntryCurrentValueComparer(id)); @@ -123,11 +123,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum1.TypeMapping = IntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.AnEnum v1, CompiledModelTestBase.AnEnum v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.AnEnum v) => v.GetHashCode(), + (CompiledModelTestBase.AnEnum v) => ((object)v).GetHashCode(), (CompiledModelTestBase.AnEnum v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.AnEnum v1, CompiledModelTestBase.AnEnum v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.AnEnum v) => v.GetHashCode(), + (CompiledModelTestBase.AnEnum v) => ((object)v).GetHashCode(), (CompiledModelTestBase.AnEnum v) => v), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -186,11 +186,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum2.TypeMapping = IntTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.AnEnum)v1, (object)(CompiledModelTestBase.AnEnum)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.AnEnum)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.AnEnum)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.AnEnum)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.AnEnum)v1, (object)(CompiledModelTestBase.AnEnum)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.AnEnum)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.AnEnum)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.AnEnum)v : default(Nullable)), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -236,11 +236,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas flagsEnum1.TypeMapping = IntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.AFlagsEnum v1, CompiledModelTestBase.AFlagsEnum v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.AFlagsEnum v) => v.GetHashCode(), + (CompiledModelTestBase.AFlagsEnum v) => ((object)v).GetHashCode(), (CompiledModelTestBase.AFlagsEnum v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.AFlagsEnum v1, CompiledModelTestBase.AFlagsEnum v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.AFlagsEnum v) => v.GetHashCode(), + (CompiledModelTestBase.AFlagsEnum v) => ((object)v).GetHashCode(), (CompiledModelTestBase.AFlagsEnum v) => v), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -287,11 +287,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas flagsEnum2.TypeMapping = IntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.AFlagsEnum v1, CompiledModelTestBase.AFlagsEnum v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.AFlagsEnum v) => v.GetHashCode(), + (CompiledModelTestBase.AFlagsEnum v) => ((object)v).GetHashCode(), (CompiledModelTestBase.AFlagsEnum v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.AFlagsEnum v1, CompiledModelTestBase.AFlagsEnum v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.AFlagsEnum v) => v.GetHashCode(), + (CompiledModelTestBase.AFlagsEnum v) => ((object)v).GetHashCode(), (CompiledModelTestBase.AFlagsEnum v) => v), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -322,15 +322,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas principalBaseId.TypeMapping = SqlServerLongTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable)), providerValueComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable))); principalBaseId.SetCurrentValueComparer(new EntryCurrentValueComparer(principalBaseId)); principalBaseId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); @@ -348,15 +348,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas principalDerivedId.TypeMapping = SqlServerLongTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable)), providerValueComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable))); principalDerivedId.SetCurrentValueComparer(new EntryCurrentValueComparer(principalDerivedId)); principalDerivedId.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); @@ -391,15 +391,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas refTypeArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -409,27 +409,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)))), elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), keyComparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(45)", @@ -437,12 +437,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))); refTypeArray.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); refTypeArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("PrincipalBaseEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalBase_RefTypeArray", "TestNamespace") }); @@ -477,15 +477,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas refTypeEnumerable.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer, string>(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), keyComparer: new ListOfReferenceTypesComparer, string>(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -499,15 +499,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -547,15 +547,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas refTypeIList.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer, string>(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), keyComparer: new ListOfReferenceTypesComparer, string>(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -569,15 +569,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -617,15 +617,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas refTypeList.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfReferenceTypesComparer, IPAddress>(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), keyComparer: new ListOfReferenceTypesComparer, IPAddress>(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -635,27 +635,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))), storeTypePostfix: StoreTypePostfix.None, jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter, IPAddress>( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)))), elementMapping: SqlServerStringTypeMapping.Default.Clone( comparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), keyComparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(45)", @@ -663,12 +663,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas unicode: true, dbType: System.Data.DbType.String), converter: new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))); refTypeList.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); refTypeList.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("PrincipalBaseEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalBase_RefTypeList", "TestNamespace") }); @@ -703,15 +703,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas valueTypeArray.TypeMapping = SqlServerStringTypeMapping.Default.Clone( comparer: new ListOfValueTypesComparer(new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v)), keyComparer: new ListOfValueTypesComparer(new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -725,15 +725,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqlServerDateTimeTypeMapping.Default.Clone( comparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v), keyComparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v), providerValueComparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v))); valueTypeArray.AddAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.None); valueTypeArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("PrincipalBaseEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalBase_ValueTypeArray", "TestNamespace") }); @@ -776,7 +776,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (byte v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -841,7 +841,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (byte v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -906,7 +906,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (short v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "nvarchar(max)", @@ -1058,10 +1058,10 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (CompiledModelTestBase.PrincipalBase)source.Entity; - return (ISnapshot)new Snapshot, CompiledModelTestBase.AnEnum, Nullable, CompiledModelTestBase.AFlagsEnum, CompiledModelTestBase.AFlagsEnum, Nullable, Nullable, IPAddress[], IEnumerable, IList, List, DateTime[], IEnumerable, IList, List>(source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)id.GetValueComparer()).Snapshot(source.GetCurrentValue>(id)), ((ValueComparer)enum1.GetValueComparer()).Snapshot(source.GetCurrentValue(enum1)), source.GetCurrentValue>(enum2) == null ? null : ((ValueComparer>)enum2.GetValueComparer()).Snapshot(source.GetCurrentValue>(enum2)), ((ValueComparer)flagsEnum1.GetValueComparer()).Snapshot(source.GetCurrentValue(flagsEnum1)), ((ValueComparer)flagsEnum2.GetValueComparer()).Snapshot(source.GetCurrentValue(flagsEnum2)), source.GetCurrentValue>(principalBaseId) == null ? null : ((ValueComparer>)principalBaseId.GetValueComparer()).Snapshot(source.GetCurrentValue>(principalBaseId)), source.GetCurrentValue>(principalDerivedId) == null ? null : ((ValueComparer>)principalDerivedId.GetValueComparer()).Snapshot(source.GetCurrentValue>(principalDerivedId)), (object)source.GetCurrentValue(refTypeArray) == null ? null : (IPAddress[])((ValueComparer)refTypeArray.GetValueComparer()).Snapshot((object)source.GetCurrentValue(refTypeArray)), (object)source.GetCurrentValue>(refTypeEnumerable) == null ? null : (IEnumerable)((ValueComparer)refTypeEnumerable.GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeEnumerable)), (object)source.GetCurrentValue>(refTypeIList) == null ? null : (IList)((ValueComparer)refTypeIList.GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeIList)), (object)source.GetCurrentValue>(refTypeList) == null ? null : (List)((ValueComparer)refTypeList.GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeList)), (IEnumerable)source.GetCurrentValue(valueTypeArray) == null ? null : (DateTime[])((ValueComparer>)valueTypeArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(valueTypeArray)), source.GetCurrentValue>(valueTypeEnumerable) == null ? null : ((ValueComparer>)valueTypeEnumerable.GetValueComparer()).Snapshot(source.GetCurrentValue>(valueTypeEnumerable)), (IEnumerable)source.GetCurrentValue>(valueTypeIList) == null ? null : (IList)((ValueComparer>)valueTypeIList.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeIList)), (IEnumerable)source.GetCurrentValue>(valueTypeList) == null ? null : (List)((ValueComparer>)valueTypeList.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeList))); + return (ISnapshot)new Snapshot, CompiledModelTestBase.AnEnum, Nullable, CompiledModelTestBase.AFlagsEnum, CompiledModelTestBase.AFlagsEnum, Nullable, Nullable, IPAddress[], IEnumerable, IList, List, DateTime[], IEnumerable, IList, List>(source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)((IProperty)id).GetValueComparer()).Snapshot(source.GetCurrentValue>(id)), ((ValueComparer)((IProperty)enum1).GetValueComparer()).Snapshot(source.GetCurrentValue(enum1)), source.GetCurrentValue>(enum2) == null ? null : ((ValueComparer>)((IProperty)enum2).GetValueComparer()).Snapshot(source.GetCurrentValue>(enum2)), ((ValueComparer)((IProperty)flagsEnum1).GetValueComparer()).Snapshot(source.GetCurrentValue(flagsEnum1)), ((ValueComparer)((IProperty)flagsEnum2).GetValueComparer()).Snapshot(source.GetCurrentValue(flagsEnum2)), source.GetCurrentValue>(principalBaseId) == null ? null : ((ValueComparer>)((IProperty)principalBaseId).GetValueComparer()).Snapshot(source.GetCurrentValue>(principalBaseId)), source.GetCurrentValue>(principalDerivedId) == null ? null : ((ValueComparer>)((IProperty)principalDerivedId).GetValueComparer()).Snapshot(source.GetCurrentValue>(principalDerivedId)), (object)source.GetCurrentValue(refTypeArray) == null ? null : (IPAddress[])((ValueComparer)((IProperty)refTypeArray).GetValueComparer()).Snapshot((object)source.GetCurrentValue(refTypeArray)), (object)source.GetCurrentValue>(refTypeEnumerable) == null ? null : (IEnumerable)((ValueComparer)((IProperty)refTypeEnumerable).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeEnumerable)), (object)source.GetCurrentValue>(refTypeIList) == null ? null : (IList)((ValueComparer)((IProperty)refTypeIList).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeIList)), (object)source.GetCurrentValue>(refTypeList) == null ? null : (List)((ValueComparer)((IProperty)refTypeList).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeList)), (IEnumerable)source.GetCurrentValue(valueTypeArray) == null ? null : (DateTime[])((ValueComparer>)((IProperty)valueTypeArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(valueTypeArray)), source.GetCurrentValue>(valueTypeEnumerable) == null ? null : ((ValueComparer>)((IProperty)valueTypeEnumerable).GetValueComparer()).Snapshot(source.GetCurrentValue>(valueTypeEnumerable)), (IEnumerable)source.GetCurrentValue>(valueTypeIList) == null ? null : (IList)((ValueComparer>)((IProperty)valueTypeIList).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeIList)), (IEnumerable)source.GetCurrentValue>(valueTypeList) == null ? null : (List)((ValueComparer>)((IProperty)valueTypeList).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeList))); }); runtimeEntityType.SetStoreGeneratedValuesFactory( - () => (ISnapshot)new Snapshot, Nullable>(((ValueComparer)enum1.GetValueComparer()).Snapshot(default(CompiledModelTestBase.AnEnum)), default(Nullable) == null ? null : ((ValueComparer>)principalBaseId.GetValueComparer()).Snapshot(default(Nullable)), default(Nullable) == null ? null : ((ValueComparer>)principalDerivedId.GetValueComparer()).Snapshot(default(Nullable)))); + () => (ISnapshot)new Snapshot, Nullable>(((ValueComparer)((IProperty)enum1).GetValueComparer()).Snapshot(default(CompiledModelTestBase.AnEnum)), default(Nullable) == null ? null : ((ValueComparer>)((IProperty)principalBaseId).GetValueComparer()).Snapshot(default(Nullable)), default(Nullable) == null ? null : ((ValueComparer>)((IProperty)principalDerivedId).GetValueComparer()).Snapshot(default(Nullable)))); runtimeEntityType.SetTemporaryValuesFactory( (InternalEntityEntry source) => (ISnapshot)new Snapshot, Nullable>(default(CompiledModelTestBase.AnEnum), default(Nullable), default(Nullable))); runtimeEntityType.SetShadowValuesFactory( @@ -1072,7 +1072,7 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (CompiledModelTestBase.PrincipalBase)source.Entity; - return (ISnapshot)new Snapshot, Nullable, Nullable, object>(source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)id.GetKeyValueComparer()).Snapshot(source.GetCurrentValue>(id)), source.GetCurrentValue>(principalBaseId) == null ? null : ((ValueComparer>)principalBaseId.GetKeyValueComparer()).Snapshot(source.GetCurrentValue>(principalBaseId)), source.GetCurrentValue>(principalDerivedId) == null ? null : ((ValueComparer>)principalDerivedId.GetKeyValueComparer()).Snapshot(source.GetCurrentValue>(principalDerivedId)), SnapshotFactoryFactory.SnapshotCollection(UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalBase_Deriveds(entity))); + return (ISnapshot)new Snapshot, Nullable, Nullable, object>(source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)((IProperty)id).GetKeyValueComparer()).Snapshot(source.GetCurrentValue>(id)), source.GetCurrentValue>(principalBaseId) == null ? null : ((ValueComparer>)((IProperty)principalBaseId).GetKeyValueComparer()).Snapshot(source.GetCurrentValue>(principalBaseId)), source.GetCurrentValue>(principalDerivedId) == null ? null : ((ValueComparer>)((IProperty)principalDerivedId).GetKeyValueComparer()).Snapshot(source.GetCurrentValue>(principalDerivedId)), SnapshotFactoryFactory.SnapshotCollection(UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalBase_Deriveds(entity))); }); runtimeEntityType.Counts = new PropertyCounts( propertyCount: 15, diff --git a/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/Tpc_Sprocs/PrincipalDerivedEntityType.cs b/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/Tpc_Sprocs/PrincipalDerivedEntityType.cs index 4b77c639d83..afb6ce12aef 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/Tpc_Sprocs/PrincipalDerivedEntityType.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/Tpc_Sprocs/PrincipalDerivedEntityType.cs @@ -56,10 +56,10 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (CompiledModelTestBase.PrincipalDerived>>)source.Entity; - return (ISnapshot)new Snapshot, CompiledModelTestBase.AnEnum, Nullable, CompiledModelTestBase.AFlagsEnum, CompiledModelTestBase.AFlagsEnum, Nullable, Nullable, IPAddress[], IEnumerable, IList, List, DateTime[], IEnumerable, IList, List>(source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)id.GetValueComparer()).Snapshot(source.GetCurrentValue>(id)), ((ValueComparer)enum1.GetValueComparer()).Snapshot(source.GetCurrentValue(enum1)), source.GetCurrentValue>(enum2) == null ? null : ((ValueComparer>)enum2.GetValueComparer()).Snapshot(source.GetCurrentValue>(enum2)), ((ValueComparer)flagsEnum1.GetValueComparer()).Snapshot(source.GetCurrentValue(flagsEnum1)), ((ValueComparer)flagsEnum2.GetValueComparer()).Snapshot(source.GetCurrentValue(flagsEnum2)), source.GetCurrentValue>(principalBaseId) == null ? null : ((ValueComparer>)principalBaseId.GetValueComparer()).Snapshot(source.GetCurrentValue>(principalBaseId)), source.GetCurrentValue>(principalDerivedId) == null ? null : ((ValueComparer>)principalDerivedId.GetValueComparer()).Snapshot(source.GetCurrentValue>(principalDerivedId)), (object)source.GetCurrentValue(refTypeArray) == null ? null : (IPAddress[])((ValueComparer)refTypeArray.GetValueComparer()).Snapshot((object)source.GetCurrentValue(refTypeArray)), (object)source.GetCurrentValue>(refTypeEnumerable) == null ? null : (IEnumerable)((ValueComparer)refTypeEnumerable.GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeEnumerable)), (object)source.GetCurrentValue>(refTypeIList) == null ? null : (IList)((ValueComparer)refTypeIList.GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeIList)), (object)source.GetCurrentValue>(refTypeList) == null ? null : (List)((ValueComparer)refTypeList.GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeList)), (IEnumerable)source.GetCurrentValue(valueTypeArray) == null ? null : (DateTime[])((ValueComparer>)valueTypeArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(valueTypeArray)), source.GetCurrentValue>(valueTypeEnumerable) == null ? null : ((ValueComparer>)valueTypeEnumerable.GetValueComparer()).Snapshot(source.GetCurrentValue>(valueTypeEnumerable)), (IEnumerable)source.GetCurrentValue>(valueTypeIList) == null ? null : (IList)((ValueComparer>)valueTypeIList.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeIList)), (IEnumerable)source.GetCurrentValue>(valueTypeList) == null ? null : (List)((ValueComparer>)valueTypeList.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeList))); + return (ISnapshot)new Snapshot, CompiledModelTestBase.AnEnum, Nullable, CompiledModelTestBase.AFlagsEnum, CompiledModelTestBase.AFlagsEnum, Nullable, Nullable, IPAddress[], IEnumerable, IList, List, DateTime[], IEnumerable, IList, List>(source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)((IProperty)id).GetValueComparer()).Snapshot(source.GetCurrentValue>(id)), ((ValueComparer)((IProperty)enum1).GetValueComparer()).Snapshot(source.GetCurrentValue(enum1)), source.GetCurrentValue>(enum2) == null ? null : ((ValueComparer>)((IProperty)enum2).GetValueComparer()).Snapshot(source.GetCurrentValue>(enum2)), ((ValueComparer)((IProperty)flagsEnum1).GetValueComparer()).Snapshot(source.GetCurrentValue(flagsEnum1)), ((ValueComparer)((IProperty)flagsEnum2).GetValueComparer()).Snapshot(source.GetCurrentValue(flagsEnum2)), source.GetCurrentValue>(principalBaseId) == null ? null : ((ValueComparer>)((IProperty)principalBaseId).GetValueComparer()).Snapshot(source.GetCurrentValue>(principalBaseId)), source.GetCurrentValue>(principalDerivedId) == null ? null : ((ValueComparer>)((IProperty)principalDerivedId).GetValueComparer()).Snapshot(source.GetCurrentValue>(principalDerivedId)), (object)source.GetCurrentValue(refTypeArray) == null ? null : (IPAddress[])((ValueComparer)((IProperty)refTypeArray).GetValueComparer()).Snapshot((object)source.GetCurrentValue(refTypeArray)), (object)source.GetCurrentValue>(refTypeEnumerable) == null ? null : (IEnumerable)((ValueComparer)((IProperty)refTypeEnumerable).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeEnumerable)), (object)source.GetCurrentValue>(refTypeIList) == null ? null : (IList)((ValueComparer)((IProperty)refTypeIList).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeIList)), (object)source.GetCurrentValue>(refTypeList) == null ? null : (List)((ValueComparer)((IProperty)refTypeList).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeList)), (IEnumerable)source.GetCurrentValue(valueTypeArray) == null ? null : (DateTime[])((ValueComparer>)((IProperty)valueTypeArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(valueTypeArray)), source.GetCurrentValue>(valueTypeEnumerable) == null ? null : ((ValueComparer>)((IProperty)valueTypeEnumerable).GetValueComparer()).Snapshot(source.GetCurrentValue>(valueTypeEnumerable)), (IEnumerable)source.GetCurrentValue>(valueTypeIList) == null ? null : (IList)((ValueComparer>)((IProperty)valueTypeIList).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeIList)), (IEnumerable)source.GetCurrentValue>(valueTypeList) == null ? null : (List)((ValueComparer>)((IProperty)valueTypeList).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeList))); }); runtimeEntityType.SetStoreGeneratedValuesFactory( - () => (ISnapshot)new Snapshot, Nullable>(((ValueComparer)enum1.GetValueComparer()).Snapshot(default(CompiledModelTestBase.AnEnum)), default(Nullable) == null ? null : ((ValueComparer>)principalBaseId.GetValueComparer()).Snapshot(default(Nullable)), default(Nullable) == null ? null : ((ValueComparer>)principalDerivedId.GetValueComparer()).Snapshot(default(Nullable)))); + () => (ISnapshot)new Snapshot, Nullable>(((ValueComparer)((IProperty)enum1).GetValueComparer()).Snapshot(default(CompiledModelTestBase.AnEnum)), default(Nullable) == null ? null : ((ValueComparer>)((IProperty)principalBaseId).GetValueComparer()).Snapshot(default(Nullable)), default(Nullable) == null ? null : ((ValueComparer>)((IProperty)principalDerivedId).GetValueComparer()).Snapshot(default(Nullable)))); runtimeEntityType.SetTemporaryValuesFactory( (InternalEntityEntry source) => (ISnapshot)new Snapshot, Nullable>(default(CompiledModelTestBase.AnEnum), default(Nullable), default(Nullable))); runtimeEntityType.SetShadowValuesFactory( @@ -70,7 +70,7 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (CompiledModelTestBase.PrincipalDerived>>)source.Entity; - return (ISnapshot)new Snapshot, Nullable, Nullable, object, object, object>(source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)id.GetKeyValueComparer()).Snapshot(source.GetCurrentValue>(id)), source.GetCurrentValue>(principalBaseId) == null ? null : ((ValueComparer>)principalBaseId.GetKeyValueComparer()).Snapshot(source.GetCurrentValue>(principalBaseId)), source.GetCurrentValue>(principalDerivedId) == null ? null : ((ValueComparer>)principalDerivedId.GetKeyValueComparer()).Snapshot(source.GetCurrentValue>(principalDerivedId)), SnapshotFactoryFactory.SnapshotCollection(PrincipalBaseEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalBase_Deriveds(entity)), UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalDerived1_Dependent(entity), SnapshotFactoryFactory.SnapshotCollection(UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalDerived1_Principals(entity))); + return (ISnapshot)new Snapshot, Nullable, Nullable, object, object, object>(source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)((IProperty)id).GetKeyValueComparer()).Snapshot(source.GetCurrentValue>(id)), source.GetCurrentValue>(principalBaseId) == null ? null : ((ValueComparer>)((IProperty)principalBaseId).GetKeyValueComparer()).Snapshot(source.GetCurrentValue>(principalBaseId)), source.GetCurrentValue>(principalDerivedId) == null ? null : ((ValueComparer>)((IProperty)principalDerivedId).GetKeyValueComparer()).Snapshot(source.GetCurrentValue>(principalDerivedId)), SnapshotFactoryFactory.SnapshotCollection(PrincipalBaseEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalBase_Deriveds(entity)), UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalDerived1_Dependent(entity), SnapshotFactoryFactory.SnapshotCollection(UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalDerived1_Principals(entity))); }); runtimeEntityType.Counts = new PropertyCounts( propertyCount: 15, diff --git a/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/Triggers/DataEntityType.cs b/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/Triggers/DataEntityType.cs index 0cb759e009c..29e45dc5572 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/Triggers/DataEntityType.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Scaffolding/Baselines/Triggers/DataEntityType.cs @@ -90,7 +90,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas blob.TypeMapping = SqlServerByteArrayTypeMapping.Default.Clone( comparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), - (byte[] v) => v.GetHashCode(), + (byte[] v) => ((object)v).GetHashCode(), (byte[] v) => v), keyComparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), @@ -127,10 +127,10 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (CompiledModelTestBase.Data)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)id.GetValueComparer()).Snapshot(source.GetCurrentValue(id)), source.GetCurrentValue(blob) == null ? null : ((ValueComparer)blob.GetValueComparer()).Snapshot(source.GetCurrentValue(blob))); + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetValueComparer()).Snapshot(source.GetCurrentValue(id)), source.GetCurrentValue(blob) == null ? null : ((ValueComparer)((IProperty)blob).GetValueComparer()).Snapshot(source.GetCurrentValue(blob))); }); runtimeEntityType.SetStoreGeneratedValuesFactory( - () => (ISnapshot)new Snapshot(((ValueComparer)id.GetValueComparer()).Snapshot(default(int)))); + () => (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetValueComparer()).Snapshot(default(int)))); runtimeEntityType.SetTemporaryValuesFactory( (InternalEntityEntry source) => (ISnapshot)new Snapshot(default(int))); runtimeEntityType.SetShadowValuesFactory( @@ -141,7 +141,7 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (CompiledModelTestBase.Data)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)id.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(id))); + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(id))); }); runtimeEntityType.Counts = new PropertyCounts( propertyCount: 2, diff --git a/test/EFCore.SqlServer.FunctionalTests/Scaffolding/CompiledModelSqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Scaffolding/CompiledModelSqlServerTest.cs index f90006c1748..375a111d1bf 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Scaffolding/CompiledModelSqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Scaffolding/CompiledModelSqlServerTest.cs @@ -339,7 +339,7 @@ protected override void AssertComplexTypes(IModel model) } [ConditionalFact] - public virtual void Key_HiLo_sequence() + public virtual Task Key_HiLo_sequence() => Test( modelBuilder => { modelBuilder.Entity( @@ -370,7 +370,7 @@ public virtual void Key_HiLo_sequence() }); [ConditionalFact] - public virtual void Key_sequence() + public virtual Task Key_sequence() => Test( modelBuilder => modelBuilder.Entity( eb => @@ -400,7 +400,7 @@ public virtual void Key_sequence() [ConditionalFact] [SqlServerCondition(SqlServerCondition.SupportsSqlClr)] - public virtual void SpatialTypesTest() + public virtual Task SpatialTypesTest() => Test( modelBuilder => modelBuilder.Entity( eb => diff --git a/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/BigModel/DataEntityType.cs b/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/BigModel/DataEntityType.cs index 6b201e76f34..58e274edf46 100644 --- a/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/BigModel/DataEntityType.cs +++ b/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/BigModel/DataEntityType.cs @@ -91,7 +91,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas blob.TypeMapping = SqliteByteArrayTypeMapping.Default.Clone( comparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), - (byte[] v) => v.GetHashCode(), + (byte[] v) => ((object)v).GetHashCode(), (byte[] v) => v), keyComparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), @@ -131,10 +131,10 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (CompiledModelTestBase.Data)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)id.GetValueComparer()).Snapshot(source.GetCurrentValue(id)), source.GetCurrentValue(blob) == null ? null : ((ValueComparer)blob.GetValueComparer()).Snapshot(source.GetCurrentValue(blob)), source.GetCurrentValue(point) == null ? null : ((ValueComparer)point.GetValueComparer()).Snapshot(source.GetCurrentValue(point))); + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetValueComparer()).Snapshot(source.GetCurrentValue(id)), source.GetCurrentValue(blob) == null ? null : ((ValueComparer)((IProperty)blob).GetValueComparer()).Snapshot(source.GetCurrentValue(blob)), source.GetCurrentValue(point) == null ? null : ((ValueComparer)((IProperty)point).GetValueComparer()).Snapshot(source.GetCurrentValue(point))); }); runtimeEntityType.SetStoreGeneratedValuesFactory( - () => (ISnapshot)new Snapshot(((ValueComparer)id.GetValueComparer()).Snapshot(default(int)))); + () => (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetValueComparer()).Snapshot(default(int)))); runtimeEntityType.SetTemporaryValuesFactory( (InternalEntityEntry source) => (ISnapshot)new Snapshot(default(int))); runtimeEntityType.SetShadowValuesFactory( @@ -145,7 +145,7 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (CompiledModelTestBase.Data)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)id.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(id))); + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(id))); }); runtimeEntityType.Counts = new PropertyCounts( propertyCount: 3, diff --git a/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/BigModel/DbContextModelBuilder.cs b/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/BigModel/DbContextModelBuilder.cs index 6a346a214ae..0734f649def 100644 --- a/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/BigModel/DbContextModelBuilder.cs +++ b/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/BigModel/DbContextModelBuilder.cs @@ -241,6 +241,8 @@ private IRelationalModel CreateRelationalModel() microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("Bool", boolColumnBase); var boolArrayColumnBase = new ColumnBase("BoolArray", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("BoolArray", boolArrayColumnBase); + var boolNestedCollectionColumnBase = new ColumnBase("BoolNestedCollection", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); + microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("BoolNestedCollection", boolNestedCollectionColumnBase); var boolToStringConverterPropertyColumnBase = new ColumnBase("BoolToStringConverterProperty", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("BoolToStringConverterProperty", boolToStringConverterPropertyColumnBase); var boolToTwoValuesConverterPropertyColumnBase = new ColumnBase("BoolToTwoValuesConverterProperty", "INTEGER", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); @@ -251,6 +253,8 @@ private IRelationalModel CreateRelationalModel() microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("Bytes", bytesColumnBase); var bytesArrayColumnBase = new ColumnBase("BytesArray", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("BytesArray", bytesArrayColumnBase); + var bytesNestedCollectionColumnBase = new ColumnBase("BytesNestedCollection", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); + microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("BytesNestedCollection", bytesNestedCollectionColumnBase); var bytesToStringConverterPropertyColumnBase = new ColumnBase("BytesToStringConverterProperty", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("BytesToStringConverterProperty", bytesToStringConverterPropertyColumnBase); var castingConverterPropertyColumnBase = new ColumnBase("CastingConverterProperty", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); @@ -259,6 +263,8 @@ private IRelationalModel CreateRelationalModel() microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("Char", charColumnBase); var charArrayColumnBase = new ColumnBase("CharArray", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("CharArray", charArrayColumnBase); + var charNestedCollectionColumnBase = new ColumnBase("CharNestedCollection", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); + microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("CharNestedCollection", charNestedCollectionColumnBase); var charToStringConverterPropertyColumnBase = new ColumnBase("CharToStringConverterProperty", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("CharToStringConverterProperty", charToStringConverterPropertyColumnBase); var dateOnlyColumnBase = new ColumnBase("DateOnly", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); @@ -323,6 +329,8 @@ private IRelationalModel CreateRelationalModel() microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("Enum32AsStringCollection", enum32AsStringCollectionColumnBase); var enum32CollectionColumnBase = new ColumnBase("Enum32Collection", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("Enum32Collection", enum32CollectionColumnBase); + var enum32NestedCollectionColumnBase = new ColumnBase("Enum32NestedCollection", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); + microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("Enum32NestedCollection", enum32NestedCollectionColumnBase); var enum64ColumnBase = new ColumnBase("Enum64", "INTEGER", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("Enum64", enum64ColumnBase); var enum64ArrayColumnBase = new ColumnBase("Enum64Array", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); @@ -347,6 +355,8 @@ private IRelationalModel CreateRelationalModel() microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("Enum8AsStringCollection", enum8AsStringCollectionColumnBase); var enum8CollectionColumnBase = new ColumnBase("Enum8Collection", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("Enum8Collection", enum8CollectionColumnBase); + var enum8NestedCollectionColumnBase = new ColumnBase("Enum8NestedCollection", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); + microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("Enum8NestedCollection", enum8NestedCollectionColumnBase); var enumToNumberConverterPropertyColumnBase = new ColumnBase("EnumToNumberConverterProperty", "INTEGER", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("EnumToNumberConverterProperty", enumToNumberConverterPropertyColumnBase); var enumToStringConverterPropertyColumnBase = new ColumnBase("EnumToStringConverterProperty", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); @@ -387,6 +397,8 @@ private IRelationalModel CreateRelationalModel() microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("EnumU64AsStringCollection", enumU64AsStringCollectionColumnBase); var enumU64CollectionColumnBase = new ColumnBase("EnumU64Collection", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("EnumU64Collection", enumU64CollectionColumnBase); + var enumU64NestedCollectionColumnBase = new ColumnBase("EnumU64NestedCollection", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); + microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("EnumU64NestedCollection", enumU64NestedCollectionColumnBase); var enumU8ColumnBase = new ColumnBase("EnumU8", "INTEGER", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("EnumU8", enumU8ColumnBase); var enumU8ArrayColumnBase = new ColumnBase("EnumU8Array", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); @@ -407,6 +419,8 @@ private IRelationalModel CreateRelationalModel() microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("Guid", guidColumnBase); var guidArrayColumnBase = new ColumnBase("GuidArray", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("GuidArray", guidArrayColumnBase); + var guidNestedCollectionColumnBase = new ColumnBase("GuidNestedCollection", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); + microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("GuidNestedCollection", guidNestedCollectionColumnBase); var guidToBytesConverterPropertyColumnBase = new ColumnBase("GuidToBytesConverterProperty", "BLOB", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("GuidToBytesConverterProperty", guidToBytesConverterPropertyColumnBase); var guidToStringConverterPropertyColumnBase = new ColumnBase("GuidToStringConverterProperty", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); @@ -429,14 +443,20 @@ private IRelationalModel CreateRelationalModel() microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("Int32", int32ColumnBase); var int32ArrayColumnBase = new ColumnBase("Int32Array", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("Int32Array", int32ArrayColumnBase); + var int32NestedCollectionColumnBase = new ColumnBase("Int32NestedCollection", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); + microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("Int32NestedCollection", int32NestedCollectionColumnBase); var int64ColumnBase = new ColumnBase("Int64", "INTEGER", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("Int64", int64ColumnBase); var int64ArrayColumnBase = new ColumnBase("Int64Array", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("Int64Array", int64ArrayColumnBase); + var int64NestedCollectionColumnBase = new ColumnBase("Int64NestedCollection", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); + microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("Int64NestedCollection", int64NestedCollectionColumnBase); var int8ColumnBase = new ColumnBase("Int8", "INTEGER", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("Int8", int8ColumnBase); var int8ArrayColumnBase = new ColumnBase("Int8Array", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("Int8Array", int8ArrayColumnBase); + var int8NestedCollectionColumnBase = new ColumnBase("Int8NestedCollection", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); + microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("Int8NestedCollection", int8NestedCollectionColumnBase); var intNumberToBytesConverterPropertyColumnBase = new ColumnBase("IntNumberToBytesConverterProperty", "BLOB", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("IntNumberToBytesConverterProperty", intNumberToBytesConverterPropertyColumnBase); var intNumberToStringConverterPropertyColumnBase = new ColumnBase("IntNumberToStringConverterProperty", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); @@ -460,6 +480,8 @@ private IRelationalModel CreateRelationalModel() microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("NullableBytes", nullableBytesColumnBase); var nullableBytesArrayColumnBase = new ColumnBase("NullableBytesArray", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("NullableBytesArray", nullableBytesArrayColumnBase); + var nullableBytesNestedCollectionColumnBase = new ColumnBase("NullableBytesNestedCollection", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); + microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("NullableBytesNestedCollection", nullableBytesNestedCollectionColumnBase); var nullableCharColumnBase = new ColumnBase("NullableChar", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase) { IsNullable = true @@ -531,6 +553,8 @@ private IRelationalModel CreateRelationalModel() microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("NullableEnum32AsStringCollection", nullableEnum32AsStringCollectionColumnBase); var nullableEnum32CollectionColumnBase = new ColumnBase("NullableEnum32Collection", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("NullableEnum32Collection", nullableEnum32CollectionColumnBase); + var nullableEnum32NestedCollectionColumnBase = new ColumnBase("NullableEnum32NestedCollection", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); + microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("NullableEnum32NestedCollection", nullableEnum32NestedCollectionColumnBase); var nullableEnum64ColumnBase = new ColumnBase("NullableEnum64", "INTEGER", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase) { IsNullable = true @@ -567,6 +591,8 @@ private IRelationalModel CreateRelationalModel() microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("NullableEnum8AsStringCollection", nullableEnum8AsStringCollectionColumnBase); var nullableEnum8CollectionColumnBase = new ColumnBase("NullableEnum8Collection", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("NullableEnum8Collection", nullableEnum8CollectionColumnBase); + var nullableEnum8NestedCollectionColumnBase = new ColumnBase("NullableEnum8NestedCollection", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); + microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("NullableEnum8NestedCollection", nullableEnum8NestedCollectionColumnBase); var nullableEnumU16ColumnBase = new ColumnBase("NullableEnumU16", "INTEGER", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase) { IsNullable = true @@ -621,6 +647,8 @@ private IRelationalModel CreateRelationalModel() microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("NullableEnumU64AsStringCollection", nullableEnumU64AsStringCollectionColumnBase); var nullableEnumU64CollectionColumnBase = new ColumnBase("NullableEnumU64Collection", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("NullableEnumU64Collection", nullableEnumU64CollectionColumnBase); + var nullableEnumU64NestedCollectionColumnBase = new ColumnBase("NullableEnumU64NestedCollection", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); + microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("NullableEnumU64NestedCollection", nullableEnumU64NestedCollectionColumnBase); var nullableEnumU8ColumnBase = new ColumnBase("NullableEnumU8", "INTEGER", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase) { IsNullable = true @@ -653,6 +681,8 @@ private IRelationalModel CreateRelationalModel() microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("NullableGuid", nullableGuidColumnBase); var nullableGuidArrayColumnBase = new ColumnBase("NullableGuidArray", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("NullableGuidArray", nullableGuidArrayColumnBase); + var nullableGuidNestedCollectionColumnBase = new ColumnBase("NullableGuidNestedCollection", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); + microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("NullableGuidNestedCollection", nullableGuidNestedCollectionColumnBase); var nullableIPAddressColumnBase = new ColumnBase("NullableIPAddress", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase) { IsNullable = true @@ -674,6 +704,8 @@ private IRelationalModel CreateRelationalModel() microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("NullableInt32", nullableInt32ColumnBase); var nullableInt32ArrayColumnBase = new ColumnBase("NullableInt32Array", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("NullableInt32Array", nullableInt32ArrayColumnBase); + var nullableInt32NestedCollectionColumnBase = new ColumnBase("NullableInt32NestedCollection", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); + microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("NullableInt32NestedCollection", nullableInt32NestedCollectionColumnBase); var nullableInt64ColumnBase = new ColumnBase("NullableInt64", "INTEGER", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase) { IsNullable = true @@ -681,6 +713,8 @@ private IRelationalModel CreateRelationalModel() microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("NullableInt64", nullableInt64ColumnBase); var nullableInt64ArrayColumnBase = new ColumnBase("NullableInt64Array", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("NullableInt64Array", nullableInt64ArrayColumnBase); + var nullableInt64NestedCollectionColumnBase = new ColumnBase("NullableInt64NestedCollection", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); + microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("NullableInt64NestedCollection", nullableInt64NestedCollectionColumnBase); var nullableInt8ColumnBase = new ColumnBase("NullableInt8", "INTEGER", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase) { IsNullable = true @@ -695,6 +729,8 @@ private IRelationalModel CreateRelationalModel() microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("NullablePhysicalAddress", nullablePhysicalAddressColumnBase); var nullablePhysicalAddressArrayColumnBase = new ColumnBase("NullablePhysicalAddressArray", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("NullablePhysicalAddressArray", nullablePhysicalAddressArrayColumnBase); + var nullablePhysicalAddressNestedCollectionColumnBase = new ColumnBase("NullablePhysicalAddressNestedCollection", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); + microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("NullablePhysicalAddressNestedCollection", nullablePhysicalAddressNestedCollectionColumnBase); var nullableStringColumnBase = new ColumnBase("NullableString", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase) { IsNullable = true @@ -702,6 +738,8 @@ private IRelationalModel CreateRelationalModel() microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("NullableString", nullableStringColumnBase); var nullableStringArrayColumnBase = new ColumnBase("NullableStringArray", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("NullableStringArray", nullableStringArrayColumnBase); + var nullableStringNestedCollectionColumnBase = new ColumnBase("NullableStringNestedCollection", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); + microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("NullableStringNestedCollection", nullableStringNestedCollectionColumnBase); var nullableTimeOnlyColumnBase = new ColumnBase("NullableTimeOnly", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase) { IsNullable = true @@ -744,6 +782,8 @@ private IRelationalModel CreateRelationalModel() microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("NullableUInt8", nullableUInt8ColumnBase); var nullableUInt8ArrayColumnBase = new ColumnBase("NullableUInt8Array", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("NullableUInt8Array", nullableUInt8ArrayColumnBase); + var nullableUInt8NestedCollectionColumnBase = new ColumnBase("NullableUInt8NestedCollection", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); + microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("NullableUInt8NestedCollection", nullableUInt8NestedCollectionColumnBase); var nullableUriColumnBase = new ColumnBase("NullableUri", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase) { IsNullable = true @@ -763,6 +803,8 @@ private IRelationalModel CreateRelationalModel() microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("String", stringColumnBase); var stringArrayColumnBase = new ColumnBase("StringArray", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("StringArray", stringArrayColumnBase); + var stringNestedCollectionColumnBase = new ColumnBase("StringNestedCollection", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); + microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("StringNestedCollection", stringNestedCollectionColumnBase); var stringToBoolConverterPropertyColumnBase = new ColumnBase("StringToBoolConverterProperty", "INTEGER", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("StringToBoolConverterProperty", stringToBoolConverterPropertyColumnBase); var stringToBytesConverterPropertyColumnBase = new ColumnBase("StringToBytesConverterProperty", "BLOB", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase) @@ -826,6 +868,8 @@ private IRelationalModel CreateRelationalModel() microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("UInt8", uInt8ColumnBase); var uInt8ArrayColumnBase = new ColumnBase("UInt8Array", "BLOB", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("UInt8Array", uInt8ArrayColumnBase); + var uInt8NestedCollectionColumnBase = new ColumnBase("UInt8NestedCollection", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); + microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("UInt8NestedCollection", uInt8NestedCollectionColumnBase); var uriColumnBase = new ColumnBase("Uri", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("Uri", uriColumnBase); var uriArrayColumnBase = new ColumnBase("UriArray", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); @@ -839,15 +883,18 @@ private IRelationalModel CreateRelationalModel() RelationalModel.CreateColumnMapping((ColumnBase)idColumnBase1, manyTypes.FindProperty("Id")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)boolColumnBase, manyTypes.FindProperty("Bool")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)boolArrayColumnBase, manyTypes.FindProperty("BoolArray")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)boolNestedCollectionColumnBase, manyTypes.FindProperty("BoolNestedCollection")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)boolToStringConverterPropertyColumnBase, manyTypes.FindProperty("BoolToStringConverterProperty")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)boolToTwoValuesConverterPropertyColumnBase, manyTypes.FindProperty("BoolToTwoValuesConverterProperty")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)boolToZeroOneConverterPropertyColumnBase, manyTypes.FindProperty("BoolToZeroOneConverterProperty")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)bytesColumnBase, manyTypes.FindProperty("Bytes")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)bytesArrayColumnBase, manyTypes.FindProperty("BytesArray")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)bytesNestedCollectionColumnBase, manyTypes.FindProperty("BytesNestedCollection")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)bytesToStringConverterPropertyColumnBase, manyTypes.FindProperty("BytesToStringConverterProperty")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)castingConverterPropertyColumnBase, manyTypes.FindProperty("CastingConverterProperty")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)charColumnBase, manyTypes.FindProperty("Char")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)charArrayColumnBase, manyTypes.FindProperty("CharArray")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)charNestedCollectionColumnBase, manyTypes.FindProperty("CharNestedCollection")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)charToStringConverterPropertyColumnBase, manyTypes.FindProperty("CharToStringConverterProperty")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)dateOnlyColumnBase, manyTypes.FindProperty("DateOnly")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)dateOnlyArrayColumnBase, manyTypes.FindProperty("DateOnlyArray")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); @@ -880,6 +927,7 @@ private IRelationalModel CreateRelationalModel() RelationalModel.CreateColumnMapping((ColumnBase)enum32AsStringArrayColumnBase, manyTypes.FindProperty("Enum32AsStringArray")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)enum32AsStringCollectionColumnBase, manyTypes.FindProperty("Enum32AsStringCollection")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)enum32CollectionColumnBase, manyTypes.FindProperty("Enum32Collection")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)enum32NestedCollectionColumnBase, manyTypes.FindProperty("Enum32NestedCollection")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)enum64ColumnBase, manyTypes.FindProperty("Enum64")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)enum64ArrayColumnBase, manyTypes.FindProperty("Enum64Array")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)enum64AsStringColumnBase, manyTypes.FindProperty("Enum64AsString")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); @@ -892,6 +940,7 @@ private IRelationalModel CreateRelationalModel() RelationalModel.CreateColumnMapping((ColumnBase)enum8AsStringArrayColumnBase, manyTypes.FindProperty("Enum8AsStringArray")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)enum8AsStringCollectionColumnBase, manyTypes.FindProperty("Enum8AsStringCollection")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)enum8CollectionColumnBase, manyTypes.FindProperty("Enum8Collection")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)enum8NestedCollectionColumnBase, manyTypes.FindProperty("Enum8NestedCollection")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)enumToNumberConverterPropertyColumnBase, manyTypes.FindProperty("EnumToNumberConverterProperty")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)enumToStringConverterPropertyColumnBase, manyTypes.FindProperty("EnumToStringConverterProperty")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)enumU16ColumnBase, manyTypes.FindProperty("EnumU16")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); @@ -912,6 +961,7 @@ private IRelationalModel CreateRelationalModel() RelationalModel.CreateColumnMapping((ColumnBase)enumU64AsStringArrayColumnBase, manyTypes.FindProperty("EnumU64AsStringArray")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)enumU64AsStringCollectionColumnBase, manyTypes.FindProperty("EnumU64AsStringCollection")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)enumU64CollectionColumnBase, manyTypes.FindProperty("EnumU64Collection")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)enumU64NestedCollectionColumnBase, manyTypes.FindProperty("EnumU64NestedCollection")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)enumU8ColumnBase, manyTypes.FindProperty("EnumU8")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)enumU8ArrayColumnBase, manyTypes.FindProperty("EnumU8Array")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)enumU8AsStringColumnBase, manyTypes.FindProperty("EnumU8AsString")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); @@ -922,6 +972,7 @@ private IRelationalModel CreateRelationalModel() RelationalModel.CreateColumnMapping((ColumnBase)floatArrayColumnBase, manyTypes.FindProperty("FloatArray")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)guidColumnBase, manyTypes.FindProperty("Guid")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)guidArrayColumnBase, manyTypes.FindProperty("GuidArray")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)guidNestedCollectionColumnBase, manyTypes.FindProperty("GuidNestedCollection")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)guidToBytesConverterPropertyColumnBase, manyTypes.FindProperty("GuidToBytesConverterProperty")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)guidToStringConverterPropertyColumnBase, manyTypes.FindProperty("GuidToStringConverterProperty")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)iPAddressColumnBase, manyTypes.FindProperty("IPAddress")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); @@ -932,10 +983,13 @@ private IRelationalModel CreateRelationalModel() RelationalModel.CreateColumnMapping((ColumnBase)int16ArrayColumnBase, manyTypes.FindProperty("Int16Array")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)int32ColumnBase, manyTypes.FindProperty("Int32")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)int32ArrayColumnBase, manyTypes.FindProperty("Int32Array")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)int32NestedCollectionColumnBase, manyTypes.FindProperty("Int32NestedCollection")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)int64ColumnBase, manyTypes.FindProperty("Int64")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)int64ArrayColumnBase, manyTypes.FindProperty("Int64Array")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)int64NestedCollectionColumnBase, manyTypes.FindProperty("Int64NestedCollection")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)int8ColumnBase, manyTypes.FindProperty("Int8")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)int8ArrayColumnBase, manyTypes.FindProperty("Int8Array")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)int8NestedCollectionColumnBase, manyTypes.FindProperty("Int8NestedCollection")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)intNumberToBytesConverterPropertyColumnBase, manyTypes.FindProperty("IntNumberToBytesConverterProperty")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)intNumberToStringConverterPropertyColumnBase, manyTypes.FindProperty("IntNumberToStringConverterProperty")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullIntToNullStringConverterPropertyColumnBase, manyTypes.FindProperty("NullIntToNullStringConverterProperty")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); @@ -943,6 +997,7 @@ private IRelationalModel CreateRelationalModel() RelationalModel.CreateColumnMapping((ColumnBase)nullableBoolArrayColumnBase, manyTypes.FindProperty("NullableBoolArray")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullableBytesColumnBase, manyTypes.FindProperty("NullableBytes")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullableBytesArrayColumnBase, manyTypes.FindProperty("NullableBytesArray")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nullableBytesNestedCollectionColumnBase, manyTypes.FindProperty("NullableBytesNestedCollection")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullableCharColumnBase, manyTypes.FindProperty("NullableChar")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullableCharArrayColumnBase, manyTypes.FindProperty("NullableCharArray")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullableDateOnlyColumnBase, manyTypes.FindProperty("NullableDateOnly")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); @@ -965,6 +1020,7 @@ private IRelationalModel CreateRelationalModel() RelationalModel.CreateColumnMapping((ColumnBase)nullableEnum32AsStringArrayColumnBase, manyTypes.FindProperty("NullableEnum32AsStringArray")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullableEnum32AsStringCollectionColumnBase, manyTypes.FindProperty("NullableEnum32AsStringCollection")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullableEnum32CollectionColumnBase, manyTypes.FindProperty("NullableEnum32Collection")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nullableEnum32NestedCollectionColumnBase, manyTypes.FindProperty("NullableEnum32NestedCollection")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullableEnum64ColumnBase, manyTypes.FindProperty("NullableEnum64")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullableEnum64ArrayColumnBase, manyTypes.FindProperty("NullableEnum64Array")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullableEnum64AsStringColumnBase, manyTypes.FindProperty("NullableEnum64AsString")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); @@ -977,6 +1033,7 @@ private IRelationalModel CreateRelationalModel() RelationalModel.CreateColumnMapping((ColumnBase)nullableEnum8AsStringArrayColumnBase, manyTypes.FindProperty("NullableEnum8AsStringArray")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullableEnum8AsStringCollectionColumnBase, manyTypes.FindProperty("NullableEnum8AsStringCollection")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullableEnum8CollectionColumnBase, manyTypes.FindProperty("NullableEnum8Collection")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nullableEnum8NestedCollectionColumnBase, manyTypes.FindProperty("NullableEnum8NestedCollection")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullableEnumU16ColumnBase, manyTypes.FindProperty("NullableEnumU16")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullableEnumU16ArrayColumnBase, manyTypes.FindProperty("NullableEnumU16Array")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullableEnumU16AsStringColumnBase, manyTypes.FindProperty("NullableEnumU16AsString")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); @@ -995,6 +1052,7 @@ private IRelationalModel CreateRelationalModel() RelationalModel.CreateColumnMapping((ColumnBase)nullableEnumU64AsStringArrayColumnBase, manyTypes.FindProperty("NullableEnumU64AsStringArray")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullableEnumU64AsStringCollectionColumnBase, manyTypes.FindProperty("NullableEnumU64AsStringCollection")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullableEnumU64CollectionColumnBase, manyTypes.FindProperty("NullableEnumU64Collection")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nullableEnumU64NestedCollectionColumnBase, manyTypes.FindProperty("NullableEnumU64NestedCollection")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullableEnumU8ColumnBase, manyTypes.FindProperty("NullableEnumU8")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullableEnumU8ArrayColumnBase, manyTypes.FindProperty("NullableEnumU8Array")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullableEnumU8AsStringColumnBase, manyTypes.FindProperty("NullableEnumU8AsString")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); @@ -1005,20 +1063,25 @@ private IRelationalModel CreateRelationalModel() RelationalModel.CreateColumnMapping((ColumnBase)nullableFloatArrayColumnBase, manyTypes.FindProperty("NullableFloatArray")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullableGuidColumnBase, manyTypes.FindProperty("NullableGuid")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullableGuidArrayColumnBase, manyTypes.FindProperty("NullableGuidArray")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nullableGuidNestedCollectionColumnBase, manyTypes.FindProperty("NullableGuidNestedCollection")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullableIPAddressColumnBase, manyTypes.FindProperty("NullableIPAddress")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullableIPAddressArrayColumnBase, manyTypes.FindProperty("NullableIPAddressArray")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullableInt16ColumnBase, manyTypes.FindProperty("NullableInt16")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullableInt16ArrayColumnBase, manyTypes.FindProperty("NullableInt16Array")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullableInt32ColumnBase, manyTypes.FindProperty("NullableInt32")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullableInt32ArrayColumnBase, manyTypes.FindProperty("NullableInt32Array")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nullableInt32NestedCollectionColumnBase, manyTypes.FindProperty("NullableInt32NestedCollection")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullableInt64ColumnBase, manyTypes.FindProperty("NullableInt64")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullableInt64ArrayColumnBase, manyTypes.FindProperty("NullableInt64Array")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nullableInt64NestedCollectionColumnBase, manyTypes.FindProperty("NullableInt64NestedCollection")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullableInt8ColumnBase, manyTypes.FindProperty("NullableInt8")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullableInt8ArrayColumnBase, manyTypes.FindProperty("NullableInt8Array")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullablePhysicalAddressColumnBase, manyTypes.FindProperty("NullablePhysicalAddress")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullablePhysicalAddressArrayColumnBase, manyTypes.FindProperty("NullablePhysicalAddressArray")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nullablePhysicalAddressNestedCollectionColumnBase, manyTypes.FindProperty("NullablePhysicalAddressNestedCollection")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullableStringColumnBase, manyTypes.FindProperty("NullableString")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullableStringArrayColumnBase, manyTypes.FindProperty("NullableStringArray")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nullableStringNestedCollectionColumnBase, manyTypes.FindProperty("NullableStringNestedCollection")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullableTimeOnlyColumnBase, manyTypes.FindProperty("NullableTimeOnly")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullableTimeOnlyArrayColumnBase, manyTypes.FindProperty("NullableTimeOnlyArray")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullableTimeSpanColumnBase, manyTypes.FindProperty("NullableTimeSpan")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); @@ -1031,6 +1094,7 @@ private IRelationalModel CreateRelationalModel() RelationalModel.CreateColumnMapping((ColumnBase)nullableUInt64ArrayColumnBase, manyTypes.FindProperty("NullableUInt64Array")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullableUInt8ColumnBase, manyTypes.FindProperty("NullableUInt8")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullableUInt8ArrayColumnBase, manyTypes.FindProperty("NullableUInt8Array")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nullableUInt8NestedCollectionColumnBase, manyTypes.FindProperty("NullableUInt8NestedCollection")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullableUriColumnBase, manyTypes.FindProperty("NullableUri")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullableUriArrayColumnBase, manyTypes.FindProperty("NullableUriArray")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)physicalAddressColumnBase, manyTypes.FindProperty("PhysicalAddress")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); @@ -1039,6 +1103,7 @@ private IRelationalModel CreateRelationalModel() RelationalModel.CreateColumnMapping((ColumnBase)physicalAddressToStringConverterPropertyColumnBase, manyTypes.FindProperty("PhysicalAddressToStringConverterProperty")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)stringColumnBase, manyTypes.FindProperty("String")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)stringArrayColumnBase, manyTypes.FindProperty("StringArray")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)stringNestedCollectionColumnBase, manyTypes.FindProperty("StringNestedCollection")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)stringToBoolConverterPropertyColumnBase, manyTypes.FindProperty("StringToBoolConverterProperty")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)stringToBytesConverterPropertyColumnBase, manyTypes.FindProperty("StringToBytesConverterProperty")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)stringToCharConverterPropertyColumnBase, manyTypes.FindProperty("StringToCharConverterProperty")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); @@ -1069,6 +1134,7 @@ private IRelationalModel CreateRelationalModel() RelationalModel.CreateColumnMapping((ColumnBase)uInt64ArrayColumnBase, manyTypes.FindProperty("UInt64Array")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)uInt8ColumnBase, manyTypes.FindProperty("UInt8")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)uInt8ArrayColumnBase, manyTypes.FindProperty("UInt8Array")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)uInt8NestedCollectionColumnBase, manyTypes.FindProperty("UInt8NestedCollection")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)uriColumnBase, manyTypes.FindProperty("Uri")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)uriArrayColumnBase, manyTypes.FindProperty("UriArray")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)uriToStringConverterPropertyColumnBase, manyTypes.FindProperty("UriToStringConverterProperty")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); @@ -1082,6 +1148,8 @@ private IRelationalModel CreateRelationalModel() manyTypesTable.Columns.Add("Bool", boolColumn); var boolArrayColumn = new Column("BoolArray", "TEXT", manyTypesTable); manyTypesTable.Columns.Add("BoolArray", boolArrayColumn); + var boolNestedCollectionColumn = new Column("BoolNestedCollection", "TEXT", manyTypesTable); + manyTypesTable.Columns.Add("BoolNestedCollection", boolNestedCollectionColumn); var boolToStringConverterPropertyColumn = new Column("BoolToStringConverterProperty", "TEXT", manyTypesTable); manyTypesTable.Columns.Add("BoolToStringConverterProperty", boolToStringConverterPropertyColumn); var boolToTwoValuesConverterPropertyColumn = new Column("BoolToTwoValuesConverterProperty", "INTEGER", manyTypesTable); @@ -1092,6 +1160,8 @@ private IRelationalModel CreateRelationalModel() manyTypesTable.Columns.Add("Bytes", bytesColumn); var bytesArrayColumn = new Column("BytesArray", "TEXT", manyTypesTable); manyTypesTable.Columns.Add("BytesArray", bytesArrayColumn); + var bytesNestedCollectionColumn = new Column("BytesNestedCollection", "TEXT", manyTypesTable); + manyTypesTable.Columns.Add("BytesNestedCollection", bytesNestedCollectionColumn); var bytesToStringConverterPropertyColumn = new Column("BytesToStringConverterProperty", "TEXT", manyTypesTable); manyTypesTable.Columns.Add("BytesToStringConverterProperty", bytesToStringConverterPropertyColumn); var castingConverterPropertyColumn = new Column("CastingConverterProperty", "TEXT", manyTypesTable); @@ -1100,6 +1170,8 @@ private IRelationalModel CreateRelationalModel() manyTypesTable.Columns.Add("Char", charColumn); var charArrayColumn = new Column("CharArray", "TEXT", manyTypesTable); manyTypesTable.Columns.Add("CharArray", charArrayColumn); + var charNestedCollectionColumn = new Column("CharNestedCollection", "TEXT", manyTypesTable); + manyTypesTable.Columns.Add("CharNestedCollection", charNestedCollectionColumn); var charToStringConverterPropertyColumn = new Column("CharToStringConverterProperty", "TEXT", manyTypesTable); manyTypesTable.Columns.Add("CharToStringConverterProperty", charToStringConverterPropertyColumn); var dateOnlyColumn = new Column("DateOnly", "TEXT", manyTypesTable); @@ -1164,6 +1236,8 @@ private IRelationalModel CreateRelationalModel() manyTypesTable.Columns.Add("Enum32AsStringCollection", enum32AsStringCollectionColumn); var enum32CollectionColumn = new Column("Enum32Collection", "TEXT", manyTypesTable); manyTypesTable.Columns.Add("Enum32Collection", enum32CollectionColumn); + var enum32NestedCollectionColumn = new Column("Enum32NestedCollection", "TEXT", manyTypesTable); + manyTypesTable.Columns.Add("Enum32NestedCollection", enum32NestedCollectionColumn); var enum64Column = new Column("Enum64", "INTEGER", manyTypesTable); manyTypesTable.Columns.Add("Enum64", enum64Column); var enum64ArrayColumn = new Column("Enum64Array", "TEXT", manyTypesTable); @@ -1188,6 +1262,8 @@ private IRelationalModel CreateRelationalModel() manyTypesTable.Columns.Add("Enum8AsStringCollection", enum8AsStringCollectionColumn); var enum8CollectionColumn = new Column("Enum8Collection", "TEXT", manyTypesTable); manyTypesTable.Columns.Add("Enum8Collection", enum8CollectionColumn); + var enum8NestedCollectionColumn = new Column("Enum8NestedCollection", "TEXT", manyTypesTable); + manyTypesTable.Columns.Add("Enum8NestedCollection", enum8NestedCollectionColumn); var enumToNumberConverterPropertyColumn = new Column("EnumToNumberConverterProperty", "INTEGER", manyTypesTable); manyTypesTable.Columns.Add("EnumToNumberConverterProperty", enumToNumberConverterPropertyColumn); var enumToStringConverterPropertyColumn = new Column("EnumToStringConverterProperty", "TEXT", manyTypesTable); @@ -1228,6 +1304,8 @@ private IRelationalModel CreateRelationalModel() manyTypesTable.Columns.Add("EnumU64AsStringCollection", enumU64AsStringCollectionColumn); var enumU64CollectionColumn = new Column("EnumU64Collection", "TEXT", manyTypesTable); manyTypesTable.Columns.Add("EnumU64Collection", enumU64CollectionColumn); + var enumU64NestedCollectionColumn = new Column("EnumU64NestedCollection", "TEXT", manyTypesTable); + manyTypesTable.Columns.Add("EnumU64NestedCollection", enumU64NestedCollectionColumn); var enumU8Column = new Column("EnumU8", "INTEGER", manyTypesTable); manyTypesTable.Columns.Add("EnumU8", enumU8Column); var enumU8ArrayColumn = new Column("EnumU8Array", "TEXT", manyTypesTable); @@ -1248,6 +1326,8 @@ private IRelationalModel CreateRelationalModel() manyTypesTable.Columns.Add("Guid", guidColumn); var guidArrayColumn = new Column("GuidArray", "TEXT", manyTypesTable); manyTypesTable.Columns.Add("GuidArray", guidArrayColumn); + var guidNestedCollectionColumn = new Column("GuidNestedCollection", "TEXT", manyTypesTable); + manyTypesTable.Columns.Add("GuidNestedCollection", guidNestedCollectionColumn); var guidToBytesConverterPropertyColumn = new Column("GuidToBytesConverterProperty", "BLOB", manyTypesTable); manyTypesTable.Columns.Add("GuidToBytesConverterProperty", guidToBytesConverterPropertyColumn); var guidToStringConverterPropertyColumn = new Column("GuidToStringConverterProperty", "TEXT", manyTypesTable); @@ -1268,14 +1348,20 @@ private IRelationalModel CreateRelationalModel() manyTypesTable.Columns.Add("Int32", int32Column); var int32ArrayColumn = new Column("Int32Array", "TEXT", manyTypesTable); manyTypesTable.Columns.Add("Int32Array", int32ArrayColumn); + var int32NestedCollectionColumn = new Column("Int32NestedCollection", "TEXT", manyTypesTable); + manyTypesTable.Columns.Add("Int32NestedCollection", int32NestedCollectionColumn); var int64Column = new Column("Int64", "INTEGER", manyTypesTable); manyTypesTable.Columns.Add("Int64", int64Column); var int64ArrayColumn = new Column("Int64Array", "TEXT", manyTypesTable); manyTypesTable.Columns.Add("Int64Array", int64ArrayColumn); + var int64NestedCollectionColumn = new Column("Int64NestedCollection", "TEXT", manyTypesTable); + manyTypesTable.Columns.Add("Int64NestedCollection", int64NestedCollectionColumn); var int8Column = new Column("Int8", "INTEGER", manyTypesTable); manyTypesTable.Columns.Add("Int8", int8Column); var int8ArrayColumn = new Column("Int8Array", "TEXT", manyTypesTable); manyTypesTable.Columns.Add("Int8Array", int8ArrayColumn); + var int8NestedCollectionColumn = new Column("Int8NestedCollection", "TEXT", manyTypesTable); + manyTypesTable.Columns.Add("Int8NestedCollection", int8NestedCollectionColumn); var intNumberToBytesConverterPropertyColumn = new Column("IntNumberToBytesConverterProperty", "BLOB", manyTypesTable); manyTypesTable.Columns.Add("IntNumberToBytesConverterProperty", intNumberToBytesConverterPropertyColumn); var intNumberToStringConverterPropertyColumn = new Column("IntNumberToStringConverterProperty", "TEXT", manyTypesTable); @@ -1299,6 +1385,8 @@ private IRelationalModel CreateRelationalModel() manyTypesTable.Columns.Add("NullableBytes", nullableBytesColumn); var nullableBytesArrayColumn = new Column("NullableBytesArray", "TEXT", manyTypesTable); manyTypesTable.Columns.Add("NullableBytesArray", nullableBytesArrayColumn); + var nullableBytesNestedCollectionColumn = new Column("NullableBytesNestedCollection", "TEXT", manyTypesTable); + manyTypesTable.Columns.Add("NullableBytesNestedCollection", nullableBytesNestedCollectionColumn); var nullableCharColumn = new Column("NullableChar", "TEXT", manyTypesTable) { IsNullable = true @@ -1370,6 +1458,8 @@ private IRelationalModel CreateRelationalModel() manyTypesTable.Columns.Add("NullableEnum32AsStringCollection", nullableEnum32AsStringCollectionColumn); var nullableEnum32CollectionColumn = new Column("NullableEnum32Collection", "TEXT", manyTypesTable); manyTypesTable.Columns.Add("NullableEnum32Collection", nullableEnum32CollectionColumn); + var nullableEnum32NestedCollectionColumn = new Column("NullableEnum32NestedCollection", "TEXT", manyTypesTable); + manyTypesTable.Columns.Add("NullableEnum32NestedCollection", nullableEnum32NestedCollectionColumn); var nullableEnum64Column = new Column("NullableEnum64", "INTEGER", manyTypesTable) { IsNullable = true @@ -1406,6 +1496,8 @@ private IRelationalModel CreateRelationalModel() manyTypesTable.Columns.Add("NullableEnum8AsStringCollection", nullableEnum8AsStringCollectionColumn); var nullableEnum8CollectionColumn = new Column("NullableEnum8Collection", "TEXT", manyTypesTable); manyTypesTable.Columns.Add("NullableEnum8Collection", nullableEnum8CollectionColumn); + var nullableEnum8NestedCollectionColumn = new Column("NullableEnum8NestedCollection", "TEXT", manyTypesTable); + manyTypesTable.Columns.Add("NullableEnum8NestedCollection", nullableEnum8NestedCollectionColumn); var nullableEnumU16Column = new Column("NullableEnumU16", "INTEGER", manyTypesTable) { IsNullable = true @@ -1460,6 +1552,8 @@ private IRelationalModel CreateRelationalModel() manyTypesTable.Columns.Add("NullableEnumU64AsStringCollection", nullableEnumU64AsStringCollectionColumn); var nullableEnumU64CollectionColumn = new Column("NullableEnumU64Collection", "TEXT", manyTypesTable); manyTypesTable.Columns.Add("NullableEnumU64Collection", nullableEnumU64CollectionColumn); + var nullableEnumU64NestedCollectionColumn = new Column("NullableEnumU64NestedCollection", "TEXT", manyTypesTable); + manyTypesTable.Columns.Add("NullableEnumU64NestedCollection", nullableEnumU64NestedCollectionColumn); var nullableEnumU8Column = new Column("NullableEnumU8", "INTEGER", manyTypesTable) { IsNullable = true @@ -1492,6 +1586,8 @@ private IRelationalModel CreateRelationalModel() manyTypesTable.Columns.Add("NullableGuid", nullableGuidColumn); var nullableGuidArrayColumn = new Column("NullableGuidArray", "TEXT", manyTypesTable); manyTypesTable.Columns.Add("NullableGuidArray", nullableGuidArrayColumn); + var nullableGuidNestedCollectionColumn = new Column("NullableGuidNestedCollection", "TEXT", manyTypesTable); + manyTypesTable.Columns.Add("NullableGuidNestedCollection", nullableGuidNestedCollectionColumn); var nullableIPAddressColumn = new Column("NullableIPAddress", "TEXT", manyTypesTable) { IsNullable = true @@ -1513,6 +1609,8 @@ private IRelationalModel CreateRelationalModel() manyTypesTable.Columns.Add("NullableInt32", nullableInt32Column); var nullableInt32ArrayColumn = new Column("NullableInt32Array", "TEXT", manyTypesTable); manyTypesTable.Columns.Add("NullableInt32Array", nullableInt32ArrayColumn); + var nullableInt32NestedCollectionColumn = new Column("NullableInt32NestedCollection", "TEXT", manyTypesTable); + manyTypesTable.Columns.Add("NullableInt32NestedCollection", nullableInt32NestedCollectionColumn); var nullableInt64Column = new Column("NullableInt64", "INTEGER", manyTypesTable) { IsNullable = true @@ -1520,6 +1618,8 @@ private IRelationalModel CreateRelationalModel() manyTypesTable.Columns.Add("NullableInt64", nullableInt64Column); var nullableInt64ArrayColumn = new Column("NullableInt64Array", "TEXT", manyTypesTable); manyTypesTable.Columns.Add("NullableInt64Array", nullableInt64ArrayColumn); + var nullableInt64NestedCollectionColumn = new Column("NullableInt64NestedCollection", "TEXT", manyTypesTable); + manyTypesTable.Columns.Add("NullableInt64NestedCollection", nullableInt64NestedCollectionColumn); var nullableInt8Column = new Column("NullableInt8", "INTEGER", manyTypesTable) { IsNullable = true @@ -1534,6 +1634,8 @@ private IRelationalModel CreateRelationalModel() manyTypesTable.Columns.Add("NullablePhysicalAddress", nullablePhysicalAddressColumn); var nullablePhysicalAddressArrayColumn = new Column("NullablePhysicalAddressArray", "TEXT", manyTypesTable); manyTypesTable.Columns.Add("NullablePhysicalAddressArray", nullablePhysicalAddressArrayColumn); + var nullablePhysicalAddressNestedCollectionColumn = new Column("NullablePhysicalAddressNestedCollection", "TEXT", manyTypesTable); + manyTypesTable.Columns.Add("NullablePhysicalAddressNestedCollection", nullablePhysicalAddressNestedCollectionColumn); var nullableStringColumn = new Column("NullableString", "TEXT", manyTypesTable) { IsNullable = true @@ -1541,6 +1643,8 @@ private IRelationalModel CreateRelationalModel() manyTypesTable.Columns.Add("NullableString", nullableStringColumn); var nullableStringArrayColumn = new Column("NullableStringArray", "TEXT", manyTypesTable); manyTypesTable.Columns.Add("NullableStringArray", nullableStringArrayColumn); + var nullableStringNestedCollectionColumn = new Column("NullableStringNestedCollection", "TEXT", manyTypesTable); + manyTypesTable.Columns.Add("NullableStringNestedCollection", nullableStringNestedCollectionColumn); var nullableTimeOnlyColumn = new Column("NullableTimeOnly", "TEXT", manyTypesTable) { IsNullable = true @@ -1583,6 +1687,8 @@ private IRelationalModel CreateRelationalModel() manyTypesTable.Columns.Add("NullableUInt8", nullableUInt8Column); var nullableUInt8ArrayColumn = new Column("NullableUInt8Array", "TEXT", manyTypesTable); manyTypesTable.Columns.Add("NullableUInt8Array", nullableUInt8ArrayColumn); + var nullableUInt8NestedCollectionColumn = new Column("NullableUInt8NestedCollection", "TEXT", manyTypesTable); + manyTypesTable.Columns.Add("NullableUInt8NestedCollection", nullableUInt8NestedCollectionColumn); var nullableUriColumn = new Column("NullableUri", "TEXT", manyTypesTable) { IsNullable = true @@ -1602,6 +1708,8 @@ private IRelationalModel CreateRelationalModel() manyTypesTable.Columns.Add("String", stringColumn); var stringArrayColumn = new Column("StringArray", "TEXT", manyTypesTable); manyTypesTable.Columns.Add("StringArray", stringArrayColumn); + var stringNestedCollectionColumn = new Column("StringNestedCollection", "TEXT", manyTypesTable); + manyTypesTable.Columns.Add("StringNestedCollection", stringNestedCollectionColumn); var stringToBoolConverterPropertyColumn = new Column("StringToBoolConverterProperty", "INTEGER", manyTypesTable); manyTypesTable.Columns.Add("StringToBoolConverterProperty", stringToBoolConverterPropertyColumn); var stringToBytesConverterPropertyColumn = new Column("StringToBytesConverterProperty", "BLOB", manyTypesTable) @@ -1665,6 +1773,8 @@ private IRelationalModel CreateRelationalModel() manyTypesTable.Columns.Add("UInt8", uInt8Column); var uInt8ArrayColumn = new Column("UInt8Array", "BLOB", manyTypesTable); manyTypesTable.Columns.Add("UInt8Array", uInt8ArrayColumn); + var uInt8NestedCollectionColumn = new Column("UInt8NestedCollection", "TEXT", manyTypesTable); + manyTypesTable.Columns.Add("UInt8NestedCollection", uInt8NestedCollectionColumn); var uriColumn = new Column("Uri", "TEXT", manyTypesTable); manyTypesTable.Columns.Add("Uri", uriColumn); var uriArrayColumn = new Column("UriArray", "TEXT", manyTypesTable); @@ -1686,15 +1796,18 @@ private IRelationalModel CreateRelationalModel() RelationalModel.CreateColumnMapping(idColumn1, manyTypes.FindProperty("Id")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(boolColumn, manyTypes.FindProperty("Bool")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(boolArrayColumn, manyTypes.FindProperty("BoolArray")!, manyTypesTableMapping); + RelationalModel.CreateColumnMapping(boolNestedCollectionColumn, manyTypes.FindProperty("BoolNestedCollection")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(boolToStringConverterPropertyColumn, manyTypes.FindProperty("BoolToStringConverterProperty")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(boolToTwoValuesConverterPropertyColumn, manyTypes.FindProperty("BoolToTwoValuesConverterProperty")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(boolToZeroOneConverterPropertyColumn, manyTypes.FindProperty("BoolToZeroOneConverterProperty")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(bytesColumn, manyTypes.FindProperty("Bytes")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(bytesArrayColumn, manyTypes.FindProperty("BytesArray")!, manyTypesTableMapping); + RelationalModel.CreateColumnMapping(bytesNestedCollectionColumn, manyTypes.FindProperty("BytesNestedCollection")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(bytesToStringConverterPropertyColumn, manyTypes.FindProperty("BytesToStringConverterProperty")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(castingConverterPropertyColumn, manyTypes.FindProperty("CastingConverterProperty")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(charColumn, manyTypes.FindProperty("Char")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(charArrayColumn, manyTypes.FindProperty("CharArray")!, manyTypesTableMapping); + RelationalModel.CreateColumnMapping(charNestedCollectionColumn, manyTypes.FindProperty("CharNestedCollection")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(charToStringConverterPropertyColumn, manyTypes.FindProperty("CharToStringConverterProperty")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(dateOnlyColumn, manyTypes.FindProperty("DateOnly")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(dateOnlyArrayColumn, manyTypes.FindProperty("DateOnlyArray")!, manyTypesTableMapping); @@ -1727,6 +1840,7 @@ private IRelationalModel CreateRelationalModel() RelationalModel.CreateColumnMapping(enum32AsStringArrayColumn, manyTypes.FindProperty("Enum32AsStringArray")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(enum32AsStringCollectionColumn, manyTypes.FindProperty("Enum32AsStringCollection")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(enum32CollectionColumn, manyTypes.FindProperty("Enum32Collection")!, manyTypesTableMapping); + RelationalModel.CreateColumnMapping(enum32NestedCollectionColumn, manyTypes.FindProperty("Enum32NestedCollection")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(enum64Column, manyTypes.FindProperty("Enum64")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(enum64ArrayColumn, manyTypes.FindProperty("Enum64Array")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(enum64AsStringColumn, manyTypes.FindProperty("Enum64AsString")!, manyTypesTableMapping); @@ -1739,6 +1853,7 @@ private IRelationalModel CreateRelationalModel() RelationalModel.CreateColumnMapping(enum8AsStringArrayColumn, manyTypes.FindProperty("Enum8AsStringArray")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(enum8AsStringCollectionColumn, manyTypes.FindProperty("Enum8AsStringCollection")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(enum8CollectionColumn, manyTypes.FindProperty("Enum8Collection")!, manyTypesTableMapping); + RelationalModel.CreateColumnMapping(enum8NestedCollectionColumn, manyTypes.FindProperty("Enum8NestedCollection")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(enumToNumberConverterPropertyColumn, manyTypes.FindProperty("EnumToNumberConverterProperty")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(enumToStringConverterPropertyColumn, manyTypes.FindProperty("EnumToStringConverterProperty")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(enumU16Column, manyTypes.FindProperty("EnumU16")!, manyTypesTableMapping); @@ -1759,6 +1874,7 @@ private IRelationalModel CreateRelationalModel() RelationalModel.CreateColumnMapping(enumU64AsStringArrayColumn, manyTypes.FindProperty("EnumU64AsStringArray")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(enumU64AsStringCollectionColumn, manyTypes.FindProperty("EnumU64AsStringCollection")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(enumU64CollectionColumn, manyTypes.FindProperty("EnumU64Collection")!, manyTypesTableMapping); + RelationalModel.CreateColumnMapping(enumU64NestedCollectionColumn, manyTypes.FindProperty("EnumU64NestedCollection")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(enumU8Column, manyTypes.FindProperty("EnumU8")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(enumU8ArrayColumn, manyTypes.FindProperty("EnumU8Array")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(enumU8AsStringColumn, manyTypes.FindProperty("EnumU8AsString")!, manyTypesTableMapping); @@ -1769,6 +1885,7 @@ private IRelationalModel CreateRelationalModel() RelationalModel.CreateColumnMapping(floatArrayColumn, manyTypes.FindProperty("FloatArray")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(guidColumn, manyTypes.FindProperty("Guid")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(guidArrayColumn, manyTypes.FindProperty("GuidArray")!, manyTypesTableMapping); + RelationalModel.CreateColumnMapping(guidNestedCollectionColumn, manyTypes.FindProperty("GuidNestedCollection")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(guidToBytesConverterPropertyColumn, manyTypes.FindProperty("GuidToBytesConverterProperty")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(guidToStringConverterPropertyColumn, manyTypes.FindProperty("GuidToStringConverterProperty")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(iPAddressColumn, manyTypes.FindProperty("IPAddress")!, manyTypesTableMapping); @@ -1779,10 +1896,13 @@ private IRelationalModel CreateRelationalModel() RelationalModel.CreateColumnMapping(int16ArrayColumn, manyTypes.FindProperty("Int16Array")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(int32Column, manyTypes.FindProperty("Int32")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(int32ArrayColumn, manyTypes.FindProperty("Int32Array")!, manyTypesTableMapping); + RelationalModel.CreateColumnMapping(int32NestedCollectionColumn, manyTypes.FindProperty("Int32NestedCollection")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(int64Column, manyTypes.FindProperty("Int64")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(int64ArrayColumn, manyTypes.FindProperty("Int64Array")!, manyTypesTableMapping); + RelationalModel.CreateColumnMapping(int64NestedCollectionColumn, manyTypes.FindProperty("Int64NestedCollection")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(int8Column, manyTypes.FindProperty("Int8")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(int8ArrayColumn, manyTypes.FindProperty("Int8Array")!, manyTypesTableMapping); + RelationalModel.CreateColumnMapping(int8NestedCollectionColumn, manyTypes.FindProperty("Int8NestedCollection")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(intNumberToBytesConverterPropertyColumn, manyTypes.FindProperty("IntNumberToBytesConverterProperty")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(intNumberToStringConverterPropertyColumn, manyTypes.FindProperty("IntNumberToStringConverterProperty")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullIntToNullStringConverterPropertyColumn, manyTypes.FindProperty("NullIntToNullStringConverterProperty")!, manyTypesTableMapping); @@ -1790,6 +1910,7 @@ private IRelationalModel CreateRelationalModel() RelationalModel.CreateColumnMapping(nullableBoolArrayColumn, manyTypes.FindProperty("NullableBoolArray")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullableBytesColumn, manyTypes.FindProperty("NullableBytes")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullableBytesArrayColumn, manyTypes.FindProperty("NullableBytesArray")!, manyTypesTableMapping); + RelationalModel.CreateColumnMapping(nullableBytesNestedCollectionColumn, manyTypes.FindProperty("NullableBytesNestedCollection")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullableCharColumn, manyTypes.FindProperty("NullableChar")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullableCharArrayColumn, manyTypes.FindProperty("NullableCharArray")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullableDateOnlyColumn, manyTypes.FindProperty("NullableDateOnly")!, manyTypesTableMapping); @@ -1812,6 +1933,7 @@ private IRelationalModel CreateRelationalModel() RelationalModel.CreateColumnMapping(nullableEnum32AsStringArrayColumn, manyTypes.FindProperty("NullableEnum32AsStringArray")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullableEnum32AsStringCollectionColumn, manyTypes.FindProperty("NullableEnum32AsStringCollection")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullableEnum32CollectionColumn, manyTypes.FindProperty("NullableEnum32Collection")!, manyTypesTableMapping); + RelationalModel.CreateColumnMapping(nullableEnum32NestedCollectionColumn, manyTypes.FindProperty("NullableEnum32NestedCollection")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullableEnum64Column, manyTypes.FindProperty("NullableEnum64")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullableEnum64ArrayColumn, manyTypes.FindProperty("NullableEnum64Array")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullableEnum64AsStringColumn, manyTypes.FindProperty("NullableEnum64AsString")!, manyTypesTableMapping); @@ -1824,6 +1946,7 @@ private IRelationalModel CreateRelationalModel() RelationalModel.CreateColumnMapping(nullableEnum8AsStringArrayColumn, manyTypes.FindProperty("NullableEnum8AsStringArray")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullableEnum8AsStringCollectionColumn, manyTypes.FindProperty("NullableEnum8AsStringCollection")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullableEnum8CollectionColumn, manyTypes.FindProperty("NullableEnum8Collection")!, manyTypesTableMapping); + RelationalModel.CreateColumnMapping(nullableEnum8NestedCollectionColumn, manyTypes.FindProperty("NullableEnum8NestedCollection")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullableEnumU16Column, manyTypes.FindProperty("NullableEnumU16")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullableEnumU16ArrayColumn, manyTypes.FindProperty("NullableEnumU16Array")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullableEnumU16AsStringColumn, manyTypes.FindProperty("NullableEnumU16AsString")!, manyTypesTableMapping); @@ -1842,6 +1965,7 @@ private IRelationalModel CreateRelationalModel() RelationalModel.CreateColumnMapping(nullableEnumU64AsStringArrayColumn, manyTypes.FindProperty("NullableEnumU64AsStringArray")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullableEnumU64AsStringCollectionColumn, manyTypes.FindProperty("NullableEnumU64AsStringCollection")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullableEnumU64CollectionColumn, manyTypes.FindProperty("NullableEnumU64Collection")!, manyTypesTableMapping); + RelationalModel.CreateColumnMapping(nullableEnumU64NestedCollectionColumn, manyTypes.FindProperty("NullableEnumU64NestedCollection")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullableEnumU8Column, manyTypes.FindProperty("NullableEnumU8")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullableEnumU8ArrayColumn, manyTypes.FindProperty("NullableEnumU8Array")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullableEnumU8AsStringColumn, manyTypes.FindProperty("NullableEnumU8AsString")!, manyTypesTableMapping); @@ -1852,20 +1976,25 @@ private IRelationalModel CreateRelationalModel() RelationalModel.CreateColumnMapping(nullableFloatArrayColumn, manyTypes.FindProperty("NullableFloatArray")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullableGuidColumn, manyTypes.FindProperty("NullableGuid")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullableGuidArrayColumn, manyTypes.FindProperty("NullableGuidArray")!, manyTypesTableMapping); + RelationalModel.CreateColumnMapping(nullableGuidNestedCollectionColumn, manyTypes.FindProperty("NullableGuidNestedCollection")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullableIPAddressColumn, manyTypes.FindProperty("NullableIPAddress")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullableIPAddressArrayColumn, manyTypes.FindProperty("NullableIPAddressArray")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullableInt16Column, manyTypes.FindProperty("NullableInt16")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullableInt16ArrayColumn, manyTypes.FindProperty("NullableInt16Array")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullableInt32Column, manyTypes.FindProperty("NullableInt32")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullableInt32ArrayColumn, manyTypes.FindProperty("NullableInt32Array")!, manyTypesTableMapping); + RelationalModel.CreateColumnMapping(nullableInt32NestedCollectionColumn, manyTypes.FindProperty("NullableInt32NestedCollection")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullableInt64Column, manyTypes.FindProperty("NullableInt64")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullableInt64ArrayColumn, manyTypes.FindProperty("NullableInt64Array")!, manyTypesTableMapping); + RelationalModel.CreateColumnMapping(nullableInt64NestedCollectionColumn, manyTypes.FindProperty("NullableInt64NestedCollection")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullableInt8Column, manyTypes.FindProperty("NullableInt8")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullableInt8ArrayColumn, manyTypes.FindProperty("NullableInt8Array")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullablePhysicalAddressColumn, manyTypes.FindProperty("NullablePhysicalAddress")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullablePhysicalAddressArrayColumn, manyTypes.FindProperty("NullablePhysicalAddressArray")!, manyTypesTableMapping); + RelationalModel.CreateColumnMapping(nullablePhysicalAddressNestedCollectionColumn, manyTypes.FindProperty("NullablePhysicalAddressNestedCollection")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullableStringColumn, manyTypes.FindProperty("NullableString")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullableStringArrayColumn, manyTypes.FindProperty("NullableStringArray")!, manyTypesTableMapping); + RelationalModel.CreateColumnMapping(nullableStringNestedCollectionColumn, manyTypes.FindProperty("NullableStringNestedCollection")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullableTimeOnlyColumn, manyTypes.FindProperty("NullableTimeOnly")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullableTimeOnlyArrayColumn, manyTypes.FindProperty("NullableTimeOnlyArray")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullableTimeSpanColumn, manyTypes.FindProperty("NullableTimeSpan")!, manyTypesTableMapping); @@ -1878,6 +2007,7 @@ private IRelationalModel CreateRelationalModel() RelationalModel.CreateColumnMapping(nullableUInt64ArrayColumn, manyTypes.FindProperty("NullableUInt64Array")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullableUInt8Column, manyTypes.FindProperty("NullableUInt8")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullableUInt8ArrayColumn, manyTypes.FindProperty("NullableUInt8Array")!, manyTypesTableMapping); + RelationalModel.CreateColumnMapping(nullableUInt8NestedCollectionColumn, manyTypes.FindProperty("NullableUInt8NestedCollection")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullableUriColumn, manyTypes.FindProperty("NullableUri")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullableUriArrayColumn, manyTypes.FindProperty("NullableUriArray")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(physicalAddressColumn, manyTypes.FindProperty("PhysicalAddress")!, manyTypesTableMapping); @@ -1886,6 +2016,7 @@ private IRelationalModel CreateRelationalModel() RelationalModel.CreateColumnMapping(physicalAddressToStringConverterPropertyColumn, manyTypes.FindProperty("PhysicalAddressToStringConverterProperty")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(stringColumn, manyTypes.FindProperty("String")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(stringArrayColumn, manyTypes.FindProperty("StringArray")!, manyTypesTableMapping); + RelationalModel.CreateColumnMapping(stringNestedCollectionColumn, manyTypes.FindProperty("StringNestedCollection")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(stringToBoolConverterPropertyColumn, manyTypes.FindProperty("StringToBoolConverterProperty")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(stringToBytesConverterPropertyColumn, manyTypes.FindProperty("StringToBytesConverterProperty")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(stringToCharConverterPropertyColumn, manyTypes.FindProperty("StringToCharConverterProperty")!, manyTypesTableMapping); @@ -1916,6 +2047,7 @@ private IRelationalModel CreateRelationalModel() RelationalModel.CreateColumnMapping(uInt64ArrayColumn, manyTypes.FindProperty("UInt64Array")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(uInt8Column, manyTypes.FindProperty("UInt8")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(uInt8ArrayColumn, manyTypes.FindProperty("UInt8Array")!, manyTypesTableMapping); + RelationalModel.CreateColumnMapping(uInt8NestedCollectionColumn, manyTypes.FindProperty("UInt8NestedCollection")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(uriColumn, manyTypes.FindProperty("Uri")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(uriArrayColumn, manyTypes.FindProperty("UriArray")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(uriToStringConverterPropertyColumn, manyTypes.FindProperty("UriToStringConverterProperty")!, manyTypesTableMapping); diff --git a/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/BigModel/DependentBaseEntityType.cs b/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/BigModel/DependentBaseEntityType.cs index 18c333b6e91..7074b0d0b2f 100644 --- a/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/BigModel/DependentBaseEntityType.cs +++ b/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/BigModel/DependentBaseEntityType.cs @@ -53,15 +53,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas principalId.TypeMapping = LongTypeMapping.Default.Clone( comparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), keyComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "INTEGER")); @@ -95,11 +95,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumDiscriminator.TypeMapping = IntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum1 v1, CompiledModelTestBase.Enum1 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum1 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum1 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum1 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum1 v1, CompiledModelTestBase.Enum1 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum1 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum1 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum1 v) => v), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -265,10 +265,10 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (CompiledModelTestBase.DependentBase>)source.Entity; - return (ISnapshot)new Snapshot>(((ValueComparer)principalId.GetValueComparer()).Snapshot(source.GetCurrentValue(principalId)), ((ValueComparer)principalAlternateId.GetValueComparer()).Snapshot(source.GetCurrentValue(principalAlternateId)), ((ValueComparer)enumDiscriminator.GetValueComparer()).Snapshot(source.GetCurrentValue(enumDiscriminator)), source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)id.GetValueComparer()).Snapshot(source.GetCurrentValue>(id))); + return (ISnapshot)new Snapshot>(((ValueComparer)((IProperty)principalId).GetValueComparer()).Snapshot(source.GetCurrentValue(principalId)), ((ValueComparer)((IProperty)principalAlternateId).GetValueComparer()).Snapshot(source.GetCurrentValue(principalAlternateId)), ((ValueComparer)((IProperty)enumDiscriminator).GetValueComparer()).Snapshot(source.GetCurrentValue(enumDiscriminator)), source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)((IProperty)id).GetValueComparer()).Snapshot(source.GetCurrentValue>(id))); }); runtimeEntityType.SetStoreGeneratedValuesFactory( - () => (ISnapshot)new Snapshot(((ValueComparer)principalId.GetValueComparer()).Snapshot(default(long)), ((ValueComparer)principalAlternateId.GetValueComparer()).Snapshot(default(Guid)))); + () => (ISnapshot)new Snapshot(((ValueComparer)((IProperty)principalId).GetValueComparer()).Snapshot(default(long)), ((ValueComparer)((IProperty)principalAlternateId).GetValueComparer()).Snapshot(default(Guid)))); runtimeEntityType.SetTemporaryValuesFactory( (InternalEntityEntry source) => (ISnapshot)new Snapshot(default(long), default(Guid))); runtimeEntityType.SetShadowValuesFactory( @@ -279,7 +279,7 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (CompiledModelTestBase.DependentBase>)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)principalId.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalId)), ((ValueComparer)principalAlternateId.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalAlternateId)), UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_DependentBase1_Principal(entity)); + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)principalId).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalId)), ((ValueComparer)((IProperty)principalAlternateId).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalAlternateId)), UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_DependentBase1_Principal(entity)); }); runtimeEntityType.Counts = new PropertyCounts( propertyCount: 4, diff --git a/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/BigModel/DependentDerivedEntityType.cs b/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/BigModel/DependentDerivedEntityType.cs index bdcc8f7335a..024698d8e4a 100644 --- a/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/BigModel/DependentDerivedEntityType.cs +++ b/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/BigModel/DependentDerivedEntityType.cs @@ -92,11 +92,11 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) runtimeEntityType.SetOriginalValuesFactory( (InternalEntityEntry source) => { - var entity = (CompiledModelTestBase.DependentDerived>)source.Entity; - return (ISnapshot)new Snapshot, string, decimal>(((ValueComparer)principalId.GetValueComparer()).Snapshot(source.GetCurrentValue(principalId)), ((ValueComparer)principalAlternateId.GetValueComparer()).Snapshot(source.GetCurrentValue(principalAlternateId)), ((ValueComparer)enumDiscriminator.GetValueComparer()).Snapshot(source.GetCurrentValue(enumDiscriminator)), source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)id.GetValueComparer()).Snapshot(source.GetCurrentValue>(id)), source.GetCurrentValue(data) == null ? null : ((ValueComparer)data.GetValueComparer()).Snapshot(source.GetCurrentValue(data)), ((ValueComparer)money.GetValueComparer()).Snapshot(source.GetCurrentValue(money))); + var entity8 = (CompiledModelTestBase.DependentDerived>)source.Entity; + return (ISnapshot)new Snapshot, string, decimal>(((ValueComparer)((IProperty)principalId).GetValueComparer()).Snapshot(source.GetCurrentValue(principalId)), ((ValueComparer)((IProperty)principalAlternateId).GetValueComparer()).Snapshot(source.GetCurrentValue(principalAlternateId)), ((ValueComparer)((IProperty)enumDiscriminator).GetValueComparer()).Snapshot(source.GetCurrentValue(enumDiscriminator)), source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)((IProperty)id).GetValueComparer()).Snapshot(source.GetCurrentValue>(id)), source.GetCurrentValue(data) == null ? null : ((ValueComparer)((IProperty)data).GetValueComparer()).Snapshot(source.GetCurrentValue(data)), ((ValueComparer)((IProperty)money).GetValueComparer()).Snapshot(source.GetCurrentValue(money))); }); runtimeEntityType.SetStoreGeneratedValuesFactory( - () => (ISnapshot)new Snapshot(((ValueComparer)principalId.GetValueComparer()).Snapshot(default(long)), ((ValueComparer)principalAlternateId.GetValueComparer()).Snapshot(default(Guid)))); + () => (ISnapshot)new Snapshot(((ValueComparer)((IProperty)principalId).GetValueComparer()).Snapshot(default(long)), ((ValueComparer)((IProperty)principalAlternateId).GetValueComparer()).Snapshot(default(Guid)))); runtimeEntityType.SetTemporaryValuesFactory( (InternalEntityEntry source) => (ISnapshot)new Snapshot(default(long), default(Guid))); runtimeEntityType.SetShadowValuesFactory( @@ -106,8 +106,8 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) runtimeEntityType.SetRelationshipSnapshotFactory( (InternalEntityEntry source) => { - var entity = (CompiledModelTestBase.DependentDerived>)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)principalId.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalId)), ((ValueComparer)principalAlternateId.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalAlternateId)), DependentBaseEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_DependentBase1_Principal(entity)); + var entity8 = (CompiledModelTestBase.DependentDerived>)source.Entity; + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)principalId).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalId)), ((ValueComparer)((IProperty)principalAlternateId).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalAlternateId)), DependentBaseEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_DependentBase1_Principal(entity8)); }); runtimeEntityType.Counts = new PropertyCounts( propertyCount: 6, diff --git a/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/BigModel/ManyTypesEntityType.cs b/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/BigModel/ManyTypesEntityType.cs index cf357d74fd2..7e73cae1ba1 100644 --- a/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/BigModel/ManyTypesEntityType.cs +++ b/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/BigModel/ManyTypesEntityType.cs @@ -36,7 +36,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas "Microsoft.EntityFrameworkCore.Scaffolding.CompiledModelTestBase+ManyTypes", typeof(CompiledModelTestBase.ManyTypes), baseEntityType, - propertyCount: 236, + propertyCount: 258, keyCount: 1); var id = runtimeEntityType.AddProperty( @@ -71,11 +71,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas id.TypeMapping = IntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.ManyTypesId v1, CompiledModelTestBase.ManyTypesId v2) => v1.Equals(v2), - (CompiledModelTestBase.ManyTypesId v) => v.GetHashCode(), + (CompiledModelTestBase.ManyTypesId v) => ((object)v).GetHashCode(), (CompiledModelTestBase.ManyTypesId v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.ManyTypesId v1, CompiledModelTestBase.ManyTypesId v2) => v1.Equals(v2), - (CompiledModelTestBase.ManyTypesId v) => v.GetHashCode(), + (CompiledModelTestBase.ManyTypesId v) => ((object)v).GetHashCode(), (CompiledModelTestBase.ManyTypesId v) => v), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -125,15 +125,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas @bool.TypeMapping = BoolTypeMapping.Default.Clone( comparer: new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v), keyComparer: new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v), providerValueComparer: new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "INTEGER")); @@ -166,39 +166,118 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas relationshipIndex: -1, storeGenerationIndex: -1); boolArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer(new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer(new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( JsonBoolReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( JsonBoolReaderWriter.Instance), elementMapping: BoolTypeMapping.Default.Clone( comparer: new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v), keyComparer: new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v), providerValueComparer: new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "INTEGER"))); boolArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BoolArray", "TestNamespace") }); + var boolNestedCollection = runtimeEntityType.AddProperty( + "BoolNestedCollection", + typeof(bool[][]), + propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("BoolNestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + boolNestedCollection.SetGetter( + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BoolNestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BoolNestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BoolNestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BoolNestedCollection(instance) == null); + boolNestedCollection.SetSetter( + (CompiledModelTestBase.ManyTypes entity, bool[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BoolNestedCollection(entity) = value); + boolNestedCollection.SetMaterializationSetter( + (CompiledModelTestBase.ManyTypes entity, bool[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BoolNestedCollection(entity) = value); + boolNestedCollection.SetAccessors( + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BoolNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BoolNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => entry.ReadOriginalValue(boolNestedCollection, 3), + (InternalEntityEntry entry) => entry.GetCurrentValue(boolNestedCollection), + (ValueBuffer valueBuffer) => valueBuffer[3]); + boolNestedCollection.SetPropertyIndexes( + index: 3, + originalValueIndex: 3, + shadowIndex: -1, + relationshipIndex: -1, + storeGenerationIndex: -1); + boolNestedCollection.TypeMapping = SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfReferenceTypesComparer(new ListOfValueTypesComparer(new ValueComparer( + (bool v1, bool v2) => v1 == v2, + (bool v) => ((object)v).GetHashCode(), + (bool v) => v))), + keyComparer: new ListOfReferenceTypesComparer(new ListOfValueTypesComparer(new ValueComparer( + (bool v1, bool v2) => v1 == v2, + (bool v) => ((object)v).GetHashCode(), + (bool v) => v))), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfStructsReaderWriter( + JsonBoolReaderWriter.Instance))), + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfStructsReaderWriter( + JsonBoolReaderWriter.Instance)), + elementMapping: SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfValueTypesComparer(new ValueComparer( + (bool v1, bool v2) => v1 == v2, + (bool v) => ((object)v).GetHashCode(), + (bool v) => v)), + keyComparer: new ListOfValueTypesComparer(new ValueComparer( + (bool v1, bool v2) => v1 == v2, + (bool v) => ((object)v).GetHashCode(), + (bool v) => v)), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( + JsonBoolReaderWriter.Instance)), + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( + JsonBoolReaderWriter.Instance), + elementMapping: BoolTypeMapping.Default.Clone( + comparer: new ValueComparer( + (bool v1, bool v2) => v1 == v2, + (bool v) => ((object)v).GetHashCode(), + (bool v) => v), + keyComparer: new ValueComparer( + (bool v1, bool v2) => v1 == v2, + (bool v) => ((object)v).GetHashCode(), + (bool v) => v), + providerValueComparer: new ValueComparer( + (bool v1, bool v2) => v1 == v2, + (bool v) => ((object)v).GetHashCode(), + (bool v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "INTEGER")))); + boolNestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BoolNestedCollection", "TestNamespace") }); + var boolToStringConverterProperty = runtimeEntityType.AddProperty( "BoolToStringConverterProperty", typeof(bool), @@ -216,27 +295,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas boolToStringConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BoolToStringConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BoolToStringConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(boolToStringConverterProperty, 3), + (InternalEntityEntry entry) => entry.ReadOriginalValue(boolToStringConverterProperty, 4), (InternalEntityEntry entry) => entry.GetCurrentValue(boolToStringConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[3]); + (ValueBuffer valueBuffer) => valueBuffer[4]); boolToStringConverterProperty.SetPropertyIndexes( - index: 3, - originalValueIndex: 3, + index: 4, + originalValueIndex: 4, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); boolToStringConverterProperty.TypeMapping = SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v), keyComparer: new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( size: 1), @@ -268,23 +347,23 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas boolToTwoValuesConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BoolToTwoValuesConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BoolToTwoValuesConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(boolToTwoValuesConverterProperty, 4), + (InternalEntityEntry entry) => entry.ReadOriginalValue(boolToTwoValuesConverterProperty, 5), (InternalEntityEntry entry) => entry.GetCurrentValue(boolToTwoValuesConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[4]); + (ValueBuffer valueBuffer) => valueBuffer[5]); boolToTwoValuesConverterProperty.SetPropertyIndexes( - index: 4, - originalValueIndex: 4, + index: 5, + originalValueIndex: 5, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); boolToTwoValuesConverterProperty.TypeMapping = ByteTypeMapping.Default.Clone( comparer: new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v), keyComparer: new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v), providerValueComparer: new ValueComparer( (byte v1, byte v2) => v1 == v2, @@ -321,23 +400,23 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas boolToZeroOneConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BoolToZeroOneConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BoolToZeroOneConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(boolToZeroOneConverterProperty, 5), + (InternalEntityEntry entry) => entry.ReadOriginalValue(boolToZeroOneConverterProperty, 6), (InternalEntityEntry entry) => entry.GetCurrentValue(boolToZeroOneConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[5]); + (ValueBuffer valueBuffer) => valueBuffer[6]); boolToZeroOneConverterProperty.SetPropertyIndexes( - index: 5, - originalValueIndex: 5, + index: 6, + originalValueIndex: 6, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); boolToZeroOneConverterProperty.TypeMapping = ShortTypeMapping.Default.Clone( comparer: new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v), keyComparer: new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v), providerValueComparer: new ValueComparer( (short v1, short v2) => v1 == v2, @@ -373,19 +452,19 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas bytes.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Bytes((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Bytes((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(bytes, 6), + (InternalEntityEntry entry) => entry.ReadOriginalValue(bytes, 7), (InternalEntityEntry entry) => entry.GetCurrentValue(bytes), - (ValueBuffer valueBuffer) => valueBuffer[6]); + (ValueBuffer valueBuffer) => valueBuffer[7]); bytes.SetPropertyIndexes( - index: 6, - originalValueIndex: 6, + index: 7, + originalValueIndex: 7, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); bytes.TypeMapping = SqliteByteArrayTypeMapping.Default.Clone( comparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), - (byte[] v) => v.GetHashCode(), + (byte[] v) => ((object)v).GetHashCode(), (byte[] v) => v), keyComparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), @@ -414,36 +493,36 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas bytesArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BytesArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BytesArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(bytesArray, 7), + (InternalEntityEntry entry) => entry.ReadOriginalValue(bytesArray, 8), (InternalEntityEntry entry) => entry.GetCurrentValue(bytesArray), - (ValueBuffer valueBuffer) => valueBuffer[7]); + (ValueBuffer valueBuffer) => valueBuffer[8]); bytesArray.SetPropertyIndexes( - index: 7, - originalValueIndex: 7, + index: 8, + originalValueIndex: 8, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); bytesArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfReferenceTypesComparer(new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), - (byte[] v) => v.GetHashCode(), + (byte[] v) => ((object)v).GetHashCode(), (byte[] v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), - (byte[] v) => v.GetHashCode(), + (byte[] v) => ((object)v).GetHashCode(), (byte[] v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter( SqliteJsonByteArrayReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( SqliteJsonByteArrayReaderWriter.Instance), elementMapping: SqliteByteArrayTypeMapping.Default.Clone( comparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), - (byte[] v) => v.GetHashCode(), + (byte[] v) => ((object)v).GetHashCode(), (byte[] v) => v), keyComparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), @@ -455,6 +534,83 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (byte[] source) => source.ToArray()))); bytesArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BytesArray", "TestNamespace") }); + var bytesNestedCollection = runtimeEntityType.AddProperty( + "BytesNestedCollection", + typeof(byte[][][]), + propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("BytesNestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + bytesNestedCollection.SetGetter( + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BytesNestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BytesNestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BytesNestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BytesNestedCollection(instance) == null); + bytesNestedCollection.SetSetter( + (CompiledModelTestBase.ManyTypes entity, byte[][][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BytesNestedCollection(entity) = value); + bytesNestedCollection.SetMaterializationSetter( + (CompiledModelTestBase.ManyTypes entity, byte[][][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BytesNestedCollection(entity) = value); + bytesNestedCollection.SetAccessors( + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BytesNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BytesNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => entry.ReadOriginalValue(bytesNestedCollection, 9), + (InternalEntityEntry entry) => entry.GetCurrentValue(bytesNestedCollection), + (ValueBuffer valueBuffer) => valueBuffer[9]); + bytesNestedCollection.SetPropertyIndexes( + index: 9, + originalValueIndex: 9, + shadowIndex: -1, + relationshipIndex: -1, + storeGenerationIndex: -1); + bytesNestedCollection.TypeMapping = SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfReferenceTypesComparer(new ListOfReferenceTypesComparer(new ValueComparer( + (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), + (byte[] v) => ((object)v).GetHashCode(), + (byte[] v) => v))), + keyComparer: new ListOfReferenceTypesComparer(new ListOfReferenceTypesComparer(new ValueComparer( + (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), + (byte[] v) => ((object)v).GetHashCode(), + (byte[] v) => v))), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfReferencesReaderWriter( + SqliteJsonByteArrayReaderWriter.Instance))), + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfReferencesReaderWriter( + SqliteJsonByteArrayReaderWriter.Instance)), + elementMapping: SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfReferenceTypesComparer(new ValueComparer( + (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), + (byte[] v) => ((object)v).GetHashCode(), + (byte[] v) => v)), + keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( + (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), + (byte[] v) => ((object)v).GetHashCode(), + (byte[] v) => v)), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter( + SqliteJsonByteArrayReaderWriter.Instance)), + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( + SqliteJsonByteArrayReaderWriter.Instance), + elementMapping: SqliteByteArrayTypeMapping.Default.Clone( + comparer: new ValueComparer( + (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), + (byte[] v) => ((object)v).GetHashCode(), + (byte[] v) => v), + keyComparer: new ValueComparer( + (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), + (byte[] v) => StructuralComparisons.StructuralEqualityComparer.GetHashCode((object)v), + (byte[] source) => source.ToArray()), + providerValueComparer: new ValueComparer( + (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), + (byte[] v) => StructuralComparisons.StructuralEqualityComparer.GetHashCode((object)v), + (byte[] source) => source.ToArray())))); + bytesNestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BytesNestedCollection", "TestNamespace") }); + var bytesToStringConverterProperty = runtimeEntityType.AddProperty( "BytesToStringConverterProperty", typeof(byte[]), @@ -474,12 +630,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas bytesToStringConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BytesToStringConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BytesToStringConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(bytesToStringConverterProperty, 8), + (InternalEntityEntry entry) => entry.ReadOriginalValue(bytesToStringConverterProperty, 10), (InternalEntityEntry entry) => entry.GetCurrentValue(bytesToStringConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[8]); + (ValueBuffer valueBuffer) => valueBuffer[10]); bytesToStringConverterProperty.SetPropertyIndexes( - index: 8, - originalValueIndex: 8, + index: 10, + originalValueIndex: 10, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); @@ -494,7 +650,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (byte[] v) => v.ToArray()), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), converter: new ValueConverter( (byte[] v) => Convert.ToBase64String(v), @@ -524,12 +680,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas castingConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_CastingConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_CastingConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(castingConverterProperty, 9), + (InternalEntityEntry entry) => entry.ReadOriginalValue(castingConverterProperty, 11), (InternalEntityEntry entry) => entry.GetCurrentValue(castingConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[9]); + (ValueBuffer valueBuffer) => valueBuffer[11]); castingConverterProperty.SetPropertyIndexes( - index: 9, - originalValueIndex: 9, + index: 11, + originalValueIndex: 11, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); @@ -544,7 +700,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (int v) => v), providerValueComparer: new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v), converter: new ValueConverter( (int v) => (decimal)v, @@ -575,12 +731,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas @char.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Char((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Char((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(@char, 10), + (InternalEntityEntry entry) => entry.ReadOriginalValue(@char, 12), (InternalEntityEntry entry) => entry.GetCurrentValue(@char), - (ValueBuffer valueBuffer) => valueBuffer[10]); + (ValueBuffer valueBuffer) => valueBuffer[12]); @char.SetPropertyIndexes( - index: 10, - originalValueIndex: 10, + index: 12, + originalValueIndex: 12, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); @@ -618,31 +774,31 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas charArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_CharArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_CharArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(charArray, 11), + (InternalEntityEntry entry) => entry.ReadOriginalValue(charArray, 13), (InternalEntityEntry entry) => entry.GetCurrentValue(charArray), - (ValueBuffer valueBuffer) => valueBuffer[11]); + (ValueBuffer valueBuffer) => valueBuffer[13]); charArray.SetPropertyIndexes( - index: 11, - originalValueIndex: 11, + index: 13, + originalValueIndex: 13, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); charArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer(new ValueComparer( (char v1, char v2) => v1 == v2, (char v) => (int)v, (char v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer(new ValueComparer( (char v1, char v2) => v1 == v2, (char v) => (int)v, (char v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( JsonCharReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( JsonCharReaderWriter.Instance), elementMapping: CharTypeMapping.Default.Clone( comparer: new ValueComparer( @@ -661,6 +817,85 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas storeTypeName: "TEXT"))); charArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_CharArray", "TestNamespace") }); + var charNestedCollection = runtimeEntityType.AddProperty( + "CharNestedCollection", + typeof(char[][]), + propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("CharNestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + charNestedCollection.SetGetter( + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_CharNestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_CharNestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_CharNestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_CharNestedCollection(instance) == null); + charNestedCollection.SetSetter( + (CompiledModelTestBase.ManyTypes entity, char[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_CharNestedCollection(entity) = value); + charNestedCollection.SetMaterializationSetter( + (CompiledModelTestBase.ManyTypes entity, char[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_CharNestedCollection(entity) = value); + charNestedCollection.SetAccessors( + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_CharNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_CharNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => entry.ReadOriginalValue(charNestedCollection, 14), + (InternalEntityEntry entry) => entry.GetCurrentValue(charNestedCollection), + (ValueBuffer valueBuffer) => valueBuffer[14]); + charNestedCollection.SetPropertyIndexes( + index: 14, + originalValueIndex: 14, + shadowIndex: -1, + relationshipIndex: -1, + storeGenerationIndex: -1); + charNestedCollection.TypeMapping = SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfReferenceTypesComparer(new ListOfValueTypesComparer(new ValueComparer( + (char v1, char v2) => v1 == v2, + (char v) => (int)v, + (char v) => v))), + keyComparer: new ListOfReferenceTypesComparer(new ListOfValueTypesComparer(new ValueComparer( + (char v1, char v2) => v1 == v2, + (char v) => (int)v, + (char v) => v))), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfStructsReaderWriter( + JsonCharReaderWriter.Instance))), + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfStructsReaderWriter( + JsonCharReaderWriter.Instance)), + elementMapping: SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfValueTypesComparer(new ValueComparer( + (char v1, char v2) => v1 == v2, + (char v) => (int)v, + (char v) => v)), + keyComparer: new ListOfValueTypesComparer(new ValueComparer( + (char v1, char v2) => v1 == v2, + (char v) => (int)v, + (char v) => v)), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( + JsonCharReaderWriter.Instance)), + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( + JsonCharReaderWriter.Instance), + elementMapping: CharTypeMapping.Default.Clone( + comparer: new ValueComparer( + (char v1, char v2) => v1 == v2, + (char v) => (int)v, + (char v) => v), + keyComparer: new ValueComparer( + (char v1, char v2) => v1 == v2, + (char v) => (int)v, + (char v) => v), + providerValueComparer: new ValueComparer( + (char v1, char v2) => v1 == v2, + (char v) => (int)v, + (char v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "TEXT")))); + charNestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_CharNestedCollection", "TestNamespace") }); + var charToStringConverterProperty = runtimeEntityType.AddProperty( "CharToStringConverterProperty", typeof(char), @@ -679,12 +914,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas charToStringConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_CharToStringConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_CharToStringConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(charToStringConverterProperty, 12), + (InternalEntityEntry entry) => entry.ReadOriginalValue(charToStringConverterProperty, 15), (InternalEntityEntry entry) => entry.GetCurrentValue(charToStringConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[12]); + (ValueBuffer valueBuffer) => valueBuffer[15]); charToStringConverterProperty.SetPropertyIndexes( - index: 12, - originalValueIndex: 12, + index: 15, + originalValueIndex: 15, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); @@ -699,7 +934,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (char v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( size: 1), @@ -732,12 +967,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas dateOnly.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DateOnly((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DateOnly((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(dateOnly, 13), + (InternalEntityEntry entry) => entry.ReadOriginalValue(dateOnly, 16), (InternalEntityEntry entry) => entry.GetCurrentValue(dateOnly), - (ValueBuffer valueBuffer) => valueBuffer[13]); + (ValueBuffer valueBuffer) => valueBuffer[16]); dateOnly.SetPropertyIndexes( - index: 13, - originalValueIndex: 13, + index: 16, + originalValueIndex: 16, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); @@ -761,31 +996,31 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas dateOnlyArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DateOnlyArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DateOnlyArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(dateOnlyArray, 14), + (InternalEntityEntry entry) => entry.ReadOriginalValue(dateOnlyArray, 17), (InternalEntityEntry entry) => entry.GetCurrentValue(dateOnlyArray), - (ValueBuffer valueBuffer) => valueBuffer[14]); + (ValueBuffer valueBuffer) => valueBuffer[17]); dateOnlyArray.SetPropertyIndexes( - index: 14, - originalValueIndex: 14, + index: 17, + originalValueIndex: 17, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); dateOnlyArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer(new ValueComparer( (DateOnly v1, DateOnly v2) => v1.Equals(v2), - (DateOnly v) => v.GetHashCode(), + (DateOnly v) => ((object)v).GetHashCode(), (DateOnly v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer(new ValueComparer( (DateOnly v1, DateOnly v2) => v1.Equals(v2), - (DateOnly v) => v.GetHashCode(), + (DateOnly v) => ((object)v).GetHashCode(), (DateOnly v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( JsonDateOnlyReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( JsonDateOnlyReaderWriter.Instance), elementMapping: SqliteDateOnlyTypeMapping.Default); dateOnlyArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DateOnlyArray", "TestNamespace") }); @@ -808,27 +1043,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas dateOnlyToStringConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DateOnlyToStringConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DateOnlyToStringConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(dateOnlyToStringConverterProperty, 15), + (InternalEntityEntry entry) => entry.ReadOriginalValue(dateOnlyToStringConverterProperty, 18), (InternalEntityEntry entry) => entry.GetCurrentValue(dateOnlyToStringConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[15]); + (ValueBuffer valueBuffer) => valueBuffer[18]); dateOnlyToStringConverterProperty.SetPropertyIndexes( - index: 15, - originalValueIndex: 15, + index: 18, + originalValueIndex: 18, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); dateOnlyToStringConverterProperty.TypeMapping = SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (DateOnly v1, DateOnly v2) => v1.Equals(v2), - (DateOnly v) => v.GetHashCode(), + (DateOnly v) => ((object)v).GetHashCode(), (DateOnly v) => v), keyComparer: new ValueComparer( (DateOnly v1, DateOnly v2) => v1.Equals(v2), - (DateOnly v) => v.GetHashCode(), + (DateOnly v) => ((object)v).GetHashCode(), (DateOnly v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( size: 10), @@ -861,12 +1096,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas dateTime.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DateTime((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DateTime((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(dateTime, 16), + (InternalEntityEntry entry) => entry.ReadOriginalValue(dateTime, 19), (InternalEntityEntry entry) => entry.GetCurrentValue(dateTime), - (ValueBuffer valueBuffer) => valueBuffer[16]); + (ValueBuffer valueBuffer) => valueBuffer[19]); dateTime.SetPropertyIndexes( - index: 16, - originalValueIndex: 16, + index: 19, + originalValueIndex: 19, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); @@ -890,31 +1125,31 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas dateTimeArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DateTimeArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DateTimeArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(dateTimeArray, 17), + (InternalEntityEntry entry) => entry.ReadOriginalValue(dateTimeArray, 20), (InternalEntityEntry entry) => entry.GetCurrentValue(dateTimeArray), - (ValueBuffer valueBuffer) => valueBuffer[17]); + (ValueBuffer valueBuffer) => valueBuffer[20]); dateTimeArray.SetPropertyIndexes( - index: 17, - originalValueIndex: 17, + index: 20, + originalValueIndex: 20, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); dateTimeArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer(new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer(new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( SqliteJsonDateTimeReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( SqliteJsonDateTimeReaderWriter.Instance), elementMapping: SqliteDateTimeTypeMapping.Default); dateTimeArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DateTimeArray", "TestNamespace") }); @@ -937,27 +1172,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas dateTimeOffsetToBinaryConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DateTimeOffsetToBinaryConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DateTimeOffsetToBinaryConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(dateTimeOffsetToBinaryConverterProperty, 18), + (InternalEntityEntry entry) => entry.ReadOriginalValue(dateTimeOffsetToBinaryConverterProperty, 21), (InternalEntityEntry entry) => entry.GetCurrentValue(dateTimeOffsetToBinaryConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[18]); + (ValueBuffer valueBuffer) => valueBuffer[21]); dateTimeOffsetToBinaryConverterProperty.SetPropertyIndexes( - index: 18, - originalValueIndex: 18, + index: 21, + originalValueIndex: 21, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); dateTimeOffsetToBinaryConverterProperty.TypeMapping = LongTypeMapping.Default.Clone( comparer: new ValueComparer( (DateTimeOffset v1, DateTimeOffset v2) => v1.EqualsExact(v2), - (DateTimeOffset v) => v.GetHashCode(), + (DateTimeOffset v) => ((object)v).GetHashCode(), (DateTimeOffset v) => v), keyComparer: new ValueComparer( (DateTimeOffset v1, DateTimeOffset v2) => v1.EqualsExact(v2), - (DateTimeOffset v) => v.GetHashCode(), + (DateTimeOffset v) => ((object)v).GetHashCode(), (DateTimeOffset v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "INTEGER"), @@ -990,23 +1225,23 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas dateTimeOffsetToBytesConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DateTimeOffsetToBytesConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DateTimeOffsetToBytesConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(dateTimeOffsetToBytesConverterProperty, 19), + (InternalEntityEntry entry) => entry.ReadOriginalValue(dateTimeOffsetToBytesConverterProperty, 22), (InternalEntityEntry entry) => entry.GetCurrentValue(dateTimeOffsetToBytesConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[19]); + (ValueBuffer valueBuffer) => valueBuffer[22]); dateTimeOffsetToBytesConverterProperty.SetPropertyIndexes( - index: 19, - originalValueIndex: 19, + index: 22, + originalValueIndex: 22, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); dateTimeOffsetToBytesConverterProperty.TypeMapping = SqliteByteArrayTypeMapping.Default.Clone( comparer: new ValueComparer( (DateTimeOffset v1, DateTimeOffset v2) => v1.EqualsExact(v2), - (DateTimeOffset v) => v.GetHashCode(), + (DateTimeOffset v) => ((object)v).GetHashCode(), (DateTimeOffset v) => v), keyComparer: new ValueComparer( (DateTimeOffset v1, DateTimeOffset v2) => v1.EqualsExact(v2), - (DateTimeOffset v) => v.GetHashCode(), + (DateTimeOffset v) => ((object)v).GetHashCode(), (DateTimeOffset v) => v), providerValueComparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), @@ -1043,27 +1278,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas dateTimeOffsetToStringConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DateTimeOffsetToStringConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DateTimeOffsetToStringConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(dateTimeOffsetToStringConverterProperty, 20), + (InternalEntityEntry entry) => entry.ReadOriginalValue(dateTimeOffsetToStringConverterProperty, 23), (InternalEntityEntry entry) => entry.GetCurrentValue(dateTimeOffsetToStringConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[20]); + (ValueBuffer valueBuffer) => valueBuffer[23]); dateTimeOffsetToStringConverterProperty.SetPropertyIndexes( - index: 20, - originalValueIndex: 20, + index: 23, + originalValueIndex: 23, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); dateTimeOffsetToStringConverterProperty.TypeMapping = SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (DateTimeOffset v1, DateTimeOffset v2) => v1.EqualsExact(v2), - (DateTimeOffset v) => v.GetHashCode(), + (DateTimeOffset v) => ((object)v).GetHashCode(), (DateTimeOffset v) => v), keyComparer: new ValueComparer( (DateTimeOffset v1, DateTimeOffset v2) => v1.EqualsExact(v2), - (DateTimeOffset v) => v.GetHashCode(), + (DateTimeOffset v) => ((object)v).GetHashCode(), (DateTimeOffset v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( size: 48), @@ -1096,27 +1331,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas dateTimeToBinaryConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DateTimeToBinaryConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DateTimeToBinaryConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(dateTimeToBinaryConverterProperty, 21), + (InternalEntityEntry entry) => entry.ReadOriginalValue(dateTimeToBinaryConverterProperty, 24), (InternalEntityEntry entry) => entry.GetCurrentValue(dateTimeToBinaryConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[21]); + (ValueBuffer valueBuffer) => valueBuffer[24]); dateTimeToBinaryConverterProperty.SetPropertyIndexes( - index: 21, - originalValueIndex: 21, + index: 24, + originalValueIndex: 24, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); dateTimeToBinaryConverterProperty.TypeMapping = LongTypeMapping.Default.Clone( comparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v), keyComparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "INTEGER"), @@ -1149,27 +1384,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas dateTimeToStringConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DateTimeToStringConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DateTimeToStringConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(dateTimeToStringConverterProperty, 22), + (InternalEntityEntry entry) => entry.ReadOriginalValue(dateTimeToStringConverterProperty, 25), (InternalEntityEntry entry) => entry.GetCurrentValue(dateTimeToStringConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[22]); + (ValueBuffer valueBuffer) => valueBuffer[25]); dateTimeToStringConverterProperty.SetPropertyIndexes( - index: 22, - originalValueIndex: 22, + index: 25, + originalValueIndex: 25, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); dateTimeToStringConverterProperty.TypeMapping = SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v), keyComparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( size: 48), @@ -1202,12 +1437,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas dateTimeToTicksConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DateTimeToTicksConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DateTimeToTicksConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(dateTimeToTicksConverterProperty, 23), + (InternalEntityEntry entry) => entry.ReadOriginalValue(dateTimeToTicksConverterProperty, 26), (InternalEntityEntry entry) => entry.GetCurrentValue(dateTimeToTicksConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[23]); + (ValueBuffer valueBuffer) => valueBuffer[26]); dateTimeToTicksConverterProperty.SetPropertyIndexes( - index: 23, - originalValueIndex: 23, + index: 26, + originalValueIndex: 26, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); @@ -1232,12 +1467,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas @decimal.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Decimal((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Decimal((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(@decimal, 24), + (InternalEntityEntry entry) => entry.ReadOriginalValue(@decimal, 27), (InternalEntityEntry entry) => entry.GetCurrentValue(@decimal), - (ValueBuffer valueBuffer) => valueBuffer[24]); + (ValueBuffer valueBuffer) => valueBuffer[27]); @decimal.SetPropertyIndexes( - index: 24, - originalValueIndex: 24, + index: 27, + originalValueIndex: 27, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); @@ -1261,31 +1496,31 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas decimalArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DecimalArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DecimalArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(decimalArray, 25), + (InternalEntityEntry entry) => entry.ReadOriginalValue(decimalArray, 28), (InternalEntityEntry entry) => entry.GetCurrentValue(decimalArray), - (ValueBuffer valueBuffer) => valueBuffer[25]); + (ValueBuffer valueBuffer) => valueBuffer[28]); decimalArray.SetPropertyIndexes( - index: 25, - originalValueIndex: 25, + index: 28, + originalValueIndex: 28, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); decimalArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer(new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer(new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( SqliteJsonDecimalReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( SqliteJsonDecimalReaderWriter.Instance), elementMapping: SqliteDecimalTypeMapping.Default); decimalArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DecimalArray", "TestNamespace") }); @@ -1308,23 +1543,23 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas decimalNumberToBytesConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DecimalNumberToBytesConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DecimalNumberToBytesConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(decimalNumberToBytesConverterProperty, 26), + (InternalEntityEntry entry) => entry.ReadOriginalValue(decimalNumberToBytesConverterProperty, 29), (InternalEntityEntry entry) => entry.GetCurrentValue(decimalNumberToBytesConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[26]); + (ValueBuffer valueBuffer) => valueBuffer[29]); decimalNumberToBytesConverterProperty.SetPropertyIndexes( - index: 26, - originalValueIndex: 26, + index: 29, + originalValueIndex: 29, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); decimalNumberToBytesConverterProperty.TypeMapping = SqliteByteArrayTypeMapping.Default.Clone( comparer: new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v), keyComparer: new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v), providerValueComparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), @@ -1361,27 +1596,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas decimalNumberToStringConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DecimalNumberToStringConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DecimalNumberToStringConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(decimalNumberToStringConverterProperty, 27), + (InternalEntityEntry entry) => entry.ReadOriginalValue(decimalNumberToStringConverterProperty, 30), (InternalEntityEntry entry) => entry.GetCurrentValue(decimalNumberToStringConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[27]); + (ValueBuffer valueBuffer) => valueBuffer[30]); decimalNumberToStringConverterProperty.SetPropertyIndexes( - index: 27, - originalValueIndex: 27, + index: 30, + originalValueIndex: 30, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); decimalNumberToStringConverterProperty.TypeMapping = SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v), keyComparer: new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( size: 64), @@ -1414,27 +1649,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas @double.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Double((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Double((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(@double, 28), + (InternalEntityEntry entry) => entry.ReadOriginalValue(@double, 31), (InternalEntityEntry entry) => entry.GetCurrentValue(@double), - (ValueBuffer valueBuffer) => valueBuffer[28]); + (ValueBuffer valueBuffer) => valueBuffer[31]); @double.SetPropertyIndexes( - index: 28, - originalValueIndex: 28, + index: 31, + originalValueIndex: 31, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); @double.TypeMapping = DoubleTypeMapping.Default.Clone( comparer: new ValueComparer( (double v1, double v2) => v1.Equals(v2), - (double v) => v.GetHashCode(), + (double v) => ((object)v).GetHashCode(), (double v) => v), keyComparer: new ValueComparer( (double v1, double v2) => v1.Equals(v2), - (double v) => v.GetHashCode(), + (double v) => ((object)v).GetHashCode(), (double v) => v), providerValueComparer: new ValueComparer( (double v1, double v2) => v1.Equals(v2), - (double v) => v.GetHashCode(), + (double v) => ((object)v).GetHashCode(), (double v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "REAL")); @@ -1457,44 +1692,44 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas doubleArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DoubleArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DoubleArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(doubleArray, 29), + (InternalEntityEntry entry) => entry.ReadOriginalValue(doubleArray, 32), (InternalEntityEntry entry) => entry.GetCurrentValue(doubleArray), - (ValueBuffer valueBuffer) => valueBuffer[29]); + (ValueBuffer valueBuffer) => valueBuffer[32]); doubleArray.SetPropertyIndexes( - index: 29, - originalValueIndex: 29, + index: 32, + originalValueIndex: 32, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); doubleArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer(new ValueComparer( (double v1, double v2) => v1.Equals(v2), - (double v) => v.GetHashCode(), + (double v) => ((object)v).GetHashCode(), (double v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer(new ValueComparer( (double v1, double v2) => v1.Equals(v2), - (double v) => v.GetHashCode(), + (double v) => ((object)v).GetHashCode(), (double v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( JsonDoubleReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( JsonDoubleReaderWriter.Instance), elementMapping: DoubleTypeMapping.Default.Clone( comparer: new ValueComparer( (double v1, double v2) => v1.Equals(v2), - (double v) => v.GetHashCode(), + (double v) => ((object)v).GetHashCode(), (double v) => v), keyComparer: new ValueComparer( (double v1, double v2) => v1.Equals(v2), - (double v) => v.GetHashCode(), + (double v) => ((object)v).GetHashCode(), (double v) => v), providerValueComparer: new ValueComparer( (double v1, double v2) => v1.Equals(v2), - (double v) => v.GetHashCode(), + (double v) => ((object)v).GetHashCode(), (double v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "REAL"))); @@ -1518,23 +1753,23 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas doubleNumberToBytesConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DoubleNumberToBytesConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DoubleNumberToBytesConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(doubleNumberToBytesConverterProperty, 30), + (InternalEntityEntry entry) => entry.ReadOriginalValue(doubleNumberToBytesConverterProperty, 33), (InternalEntityEntry entry) => entry.GetCurrentValue(doubleNumberToBytesConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[30]); + (ValueBuffer valueBuffer) => valueBuffer[33]); doubleNumberToBytesConverterProperty.SetPropertyIndexes( - index: 30, - originalValueIndex: 30, + index: 33, + originalValueIndex: 33, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); doubleNumberToBytesConverterProperty.TypeMapping = SqliteByteArrayTypeMapping.Default.Clone( comparer: new ValueComparer( (double v1, double v2) => v1.Equals(v2), - (double v) => v.GetHashCode(), + (double v) => ((object)v).GetHashCode(), (double v) => v), keyComparer: new ValueComparer( (double v1, double v2) => v1.Equals(v2), - (double v) => v.GetHashCode(), + (double v) => ((object)v).GetHashCode(), (double v) => v), providerValueComparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), @@ -1571,27 +1806,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas doubleNumberToStringConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DoubleNumberToStringConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DoubleNumberToStringConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(doubleNumberToStringConverterProperty, 31), + (InternalEntityEntry entry) => entry.ReadOriginalValue(doubleNumberToStringConverterProperty, 34), (InternalEntityEntry entry) => entry.GetCurrentValue(doubleNumberToStringConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[31]); + (ValueBuffer valueBuffer) => valueBuffer[34]); doubleNumberToStringConverterProperty.SetPropertyIndexes( - index: 31, - originalValueIndex: 31, + index: 34, + originalValueIndex: 34, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); doubleNumberToStringConverterProperty.TypeMapping = SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (double v1, double v2) => v1.Equals(v2), - (double v) => v.GetHashCode(), + (double v) => ((object)v).GetHashCode(), (double v) => v), keyComparer: new ValueComparer( (double v1, double v2) => v1.Equals(v2), - (double v) => v.GetHashCode(), + (double v) => ((object)v).GetHashCode(), (double v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( size: 64), @@ -1623,23 +1858,23 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum16.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum16((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum16((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(enum16, 32), + (InternalEntityEntry entry) => entry.ReadOriginalValue(enum16, 35), (InternalEntityEntry entry) => entry.GetCurrentValue(enum16), - (ValueBuffer valueBuffer) => valueBuffer[32]); + (ValueBuffer valueBuffer) => valueBuffer[35]); enum16.SetPropertyIndexes( - index: 32, - originalValueIndex: 32, + index: 35, + originalValueIndex: 35, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enum16.TypeMapping = ShortTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v), providerValueComparer: new ValueComparer( (short v1, short v2) => v1 == v2, @@ -1675,35 +1910,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum16Array.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum16Array((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum16Array((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(enum16Array, 33), + (InternalEntityEntry entry) => entry.ReadOriginalValue(enum16Array, 36), (InternalEntityEntry entry) => entry.GetCurrentValue(enum16Array), - (ValueBuffer valueBuffer) => valueBuffer[33]); + (ValueBuffer valueBuffer) => valueBuffer[36]); enum16Array.SetPropertyIndexes( - index: 33, - originalValueIndex: 33, + index: 36, + originalValueIndex: 36, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enum16Array.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonInt16ReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.Enum16 value) => (short)value, (short value) => (CompiledModelTestBase.Enum16)value)))), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonInt16ReaderWriter.Instance, new ValueConverter( @@ -1712,11 +1947,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: ShortTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v), providerValueComparer: new ValueComparer( (short v1, short v2) => v1 == v2, @@ -1752,35 +1987,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum16AsString.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum16AsString((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum16AsString((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(enum16AsString, 34), + (InternalEntityEntry entry) => entry.ReadOriginalValue(enum16AsString, 37), (InternalEntityEntry entry) => entry.GetCurrentValue(enum16AsString), - (ValueBuffer valueBuffer) => valueBuffer[34]); + (ValueBuffer valueBuffer) => valueBuffer[37]); enum16AsString.SetPropertyIndexes( - index: 34, - originalValueIndex: 34, + index: 37, + originalValueIndex: 37, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enum16AsString.TypeMapping = SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), converter: new ValueConverter( - (CompiledModelTestBase.Enum16 v) => v.ToString(), + (CompiledModelTestBase.Enum16 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum16 v) => v.ToString(), + (CompiledModelTestBase.Enum16 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))); enum16AsString.SetSentinelFromProviderValue("Default"); enum16AsString.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum16AsString", "TestNamespace") }); @@ -1802,60 +2037,60 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum16AsStringArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum16AsStringArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum16AsStringArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(enum16AsStringArray, 35), + (InternalEntityEntry entry) => entry.ReadOriginalValue(enum16AsStringArray, 38), (InternalEntityEntry entry) => entry.GetCurrentValue(enum16AsStringArray), - (ValueBuffer valueBuffer) => valueBuffer[35]); + (ValueBuffer valueBuffer) => valueBuffer[38]); enum16AsStringArray.SetPropertyIndexes( - index: 35, - originalValueIndex: 35, + index: 38, + originalValueIndex: 38, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enum16AsStringArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum16 v) => v.ToString(), + (CompiledModelTestBase.Enum16 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum16 v) => v.ToString(), + (CompiledModelTestBase.Enum16 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))), elementMapping: SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), converter: new ValueConverter( - (CompiledModelTestBase.Enum16 v) => v.ToString(), + (CompiledModelTestBase.Enum16 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum16 v) => v.ToString(), + (CompiledModelTestBase.Enum16 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))); enum16AsStringArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum16AsStringArray", "TestNamespace") }); @@ -1876,60 +2111,60 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum16AsStringCollection.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum16AsStringCollection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum16AsStringCollection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(enum16AsStringCollection, 36), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(enum16AsStringCollection, 39), (InternalEntityEntry entry) => entry.GetCurrentValue>(enum16AsStringCollection), - (ValueBuffer valueBuffer) => valueBuffer[36]); + (ValueBuffer valueBuffer) => valueBuffer[39]); enum16AsStringCollection.SetPropertyIndexes( - index: 36, - originalValueIndex: 36, + index: 39, + originalValueIndex: 39, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enum16AsStringCollection.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer, CompiledModelTestBase.Enum16>(new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer, CompiledModelTestBase.Enum16>(new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, CompiledModelTestBase.Enum16>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.Enum16>( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum16 v) => v.ToString(), + (CompiledModelTestBase.Enum16 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, CompiledModelTestBase.Enum16>( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.Enum16>( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum16 v) => v.ToString(), + (CompiledModelTestBase.Enum16 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))), elementMapping: SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), converter: new ValueConverter( - (CompiledModelTestBase.Enum16 v) => v.ToString(), + (CompiledModelTestBase.Enum16 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum16 v) => v.ToString(), + (CompiledModelTestBase.Enum16 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))); enum16AsStringCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum16AsStringCollection", "TestNamespace") }); @@ -1950,35 +2185,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum16Collection.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum16Collection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum16Collection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(enum16Collection, 37), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(enum16Collection, 40), (InternalEntityEntry entry) => entry.GetCurrentValue>(enum16Collection), - (ValueBuffer valueBuffer) => valueBuffer[37]); + (ValueBuffer valueBuffer) => valueBuffer[40]); enum16Collection.SetPropertyIndexes( - index: 37, - originalValueIndex: 37, + index: 40, + originalValueIndex: 40, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enum16Collection.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer, CompiledModelTestBase.Enum16>(new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer, CompiledModelTestBase.Enum16>(new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, CompiledModelTestBase.Enum16>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.Enum16>( new JsonConvertedValueReaderWriter( JsonInt16ReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.Enum16 value) => (short)value, (short value) => (CompiledModelTestBase.Enum16)value)))), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, CompiledModelTestBase.Enum16>( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.Enum16>( new JsonConvertedValueReaderWriter( JsonInt16ReaderWriter.Instance, new ValueConverter( @@ -1987,11 +2222,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: ShortTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v), providerValueComparer: new ValueComparer( (short v1, short v2) => v1 == v2, @@ -2026,23 +2261,23 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum32.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum32((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum32((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(enum32, 38), + (InternalEntityEntry entry) => entry.ReadOriginalValue(enum32, 41), (InternalEntityEntry entry) => entry.GetCurrentValue(enum32), - (ValueBuffer valueBuffer) => valueBuffer[38]); + (ValueBuffer valueBuffer) => valueBuffer[41]); enum32.SetPropertyIndexes( - index: 38, - originalValueIndex: 38, + index: 41, + originalValueIndex: 41, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enum32.TypeMapping = IntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -2078,35 +2313,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum32Array.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum32Array((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum32Array((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(enum32Array, 39), + (InternalEntityEntry entry) => entry.ReadOriginalValue(enum32Array, 42), (InternalEntityEntry entry) => entry.GetCurrentValue(enum32Array), - (ValueBuffer valueBuffer) => valueBuffer[39]); + (ValueBuffer valueBuffer) => valueBuffer[42]); enum32Array.SetPropertyIndexes( - index: 39, - originalValueIndex: 39, + index: 42, + originalValueIndex: 42, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enum32Array.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonInt32ReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.Enum32 value) => (int)value, (int value) => (CompiledModelTestBase.Enum32)value)))), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonInt32ReaderWriter.Instance, new ValueConverter( @@ -2115,11 +2350,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: IntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -2155,35 +2390,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum32AsString.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum32AsString((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum32AsString((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(enum32AsString, 40), + (InternalEntityEntry entry) => entry.ReadOriginalValue(enum32AsString, 43), (InternalEntityEntry entry) => entry.GetCurrentValue(enum32AsString), - (ValueBuffer valueBuffer) => valueBuffer[40]); + (ValueBuffer valueBuffer) => valueBuffer[43]); enum32AsString.SetPropertyIndexes( - index: 40, - originalValueIndex: 40, + index: 43, + originalValueIndex: 43, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enum32AsString.TypeMapping = SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), converter: new ValueConverter( - (CompiledModelTestBase.Enum32 v) => v.ToString(), + (CompiledModelTestBase.Enum32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum32 v) => v.ToString(), + (CompiledModelTestBase.Enum32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))); enum32AsString.SetSentinelFromProviderValue("Default"); enum32AsString.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum32AsString", "TestNamespace") }); @@ -2205,60 +2440,60 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum32AsStringArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum32AsStringArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum32AsStringArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(enum32AsStringArray, 41), + (InternalEntityEntry entry) => entry.ReadOriginalValue(enum32AsStringArray, 44), (InternalEntityEntry entry) => entry.GetCurrentValue(enum32AsStringArray), - (ValueBuffer valueBuffer) => valueBuffer[41]); + (ValueBuffer valueBuffer) => valueBuffer[44]); enum32AsStringArray.SetPropertyIndexes( - index: 41, - originalValueIndex: 41, + index: 44, + originalValueIndex: 44, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enum32AsStringArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum32 v) => v.ToString(), + (CompiledModelTestBase.Enum32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum32 v) => v.ToString(), + (CompiledModelTestBase.Enum32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))), elementMapping: SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), converter: new ValueConverter( - (CompiledModelTestBase.Enum32 v) => v.ToString(), + (CompiledModelTestBase.Enum32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum32 v) => v.ToString(), + (CompiledModelTestBase.Enum32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))); enum32AsStringArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum32AsStringArray", "TestNamespace") }); @@ -2279,60 +2514,60 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum32AsStringCollection.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum32AsStringCollection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum32AsStringCollection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(enum32AsStringCollection, 42), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(enum32AsStringCollection, 45), (InternalEntityEntry entry) => entry.GetCurrentValue>(enum32AsStringCollection), - (ValueBuffer valueBuffer) => valueBuffer[42]); + (ValueBuffer valueBuffer) => valueBuffer[45]); enum32AsStringCollection.SetPropertyIndexes( - index: 42, - originalValueIndex: 42, + index: 45, + originalValueIndex: 45, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enum32AsStringCollection.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer, CompiledModelTestBase.Enum32>(new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer, CompiledModelTestBase.Enum32>(new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, CompiledModelTestBase.Enum32>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.Enum32>( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum32 v) => v.ToString(), + (CompiledModelTestBase.Enum32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, CompiledModelTestBase.Enum32>( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.Enum32>( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum32 v) => v.ToString(), + (CompiledModelTestBase.Enum32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))), elementMapping: SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), converter: new ValueConverter( - (CompiledModelTestBase.Enum32 v) => v.ToString(), + (CompiledModelTestBase.Enum32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum32 v) => v.ToString(), + (CompiledModelTestBase.Enum32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))); enum32AsStringCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum32AsStringCollection", "TestNamespace") }); @@ -2353,35 +2588,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum32Collection.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum32Collection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum32Collection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(enum32Collection, 43), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(enum32Collection, 46), (InternalEntityEntry entry) => entry.GetCurrentValue>(enum32Collection), - (ValueBuffer valueBuffer) => valueBuffer[43]); + (ValueBuffer valueBuffer) => valueBuffer[46]); enum32Collection.SetPropertyIndexes( - index: 43, - originalValueIndex: 43, + index: 46, + originalValueIndex: 46, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enum32Collection.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer, CompiledModelTestBase.Enum32>(new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer, CompiledModelTestBase.Enum32>(new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, CompiledModelTestBase.Enum32>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.Enum32>( new JsonConvertedValueReaderWriter( JsonInt32ReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.Enum32 value) => (int)value, (int value) => (CompiledModelTestBase.Enum32)value)))), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, CompiledModelTestBase.Enum32>( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.Enum32>( new JsonConvertedValueReaderWriter( JsonInt32ReaderWriter.Instance, new ValueConverter( @@ -2390,11 +2625,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: IntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -2412,6 +2647,138 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (int value) => (CompiledModelTestBase.Enum32)value)))); enum32Collection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum32Collection", "TestNamespace") }); + var enum32NestedCollection = runtimeEntityType.AddProperty( + "Enum32NestedCollection", + typeof(List[][]), + propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("Enum32NestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + enum32NestedCollection.SetGetter( + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum32NestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum32NestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum32NestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum32NestedCollection(instance) == null); + enum32NestedCollection.SetSetter( + (CompiledModelTestBase.ManyTypes entity, List[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum32NestedCollection(entity) = value); + enum32NestedCollection.SetMaterializationSetter( + (CompiledModelTestBase.ManyTypes entity, List[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum32NestedCollection(entity) = value); + enum32NestedCollection.SetAccessors( + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum32NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum32NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => entry.ReadOriginalValue[][]>(enum32NestedCollection, 47), + (InternalEntityEntry entry) => entry.GetCurrentValue[][]>(enum32NestedCollection), + (ValueBuffer valueBuffer) => valueBuffer[47]); + enum32NestedCollection.SetPropertyIndexes( + index: 47, + originalValueIndex: 47, + shadowIndex: -1, + relationshipIndex: -1, + storeGenerationIndex: -1); + enum32NestedCollection.TypeMapping = SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfReferenceTypesComparer[][], List[]>(new ListOfReferenceTypesComparer[], List>(new ListOfValueTypesComparer, CompiledModelTestBase.Enum32>(new ValueComparer( + (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), + (CompiledModelTestBase.Enum32 v) => v)))), + keyComparer: new ListOfReferenceTypesComparer[][], List[]>(new ListOfReferenceTypesComparer[], List>(new ListOfValueTypesComparer, CompiledModelTestBase.Enum32>(new ValueComparer( + (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), + (CompiledModelTestBase.Enum32 v) => v)))), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter[]>(new JsonCollectionOfReferencesReaderWriter[][], List[]>( + new JsonCollectionOfReferencesReaderWriter[], List>( + new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.Enum32>( + new JsonConvertedValueReaderWriter( + JsonInt32ReaderWriter.Instance, + new ValueConverter( + (CompiledModelTestBase.Enum32 value) => (int)value, + (int value) => (CompiledModelTestBase.Enum32)value)))))), + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter[][], List[]>( + new JsonCollectionOfReferencesReaderWriter[], List>( + new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.Enum32>( + new JsonConvertedValueReaderWriter( + JsonInt32ReaderWriter.Instance, + new ValueConverter( + (CompiledModelTestBase.Enum32 value) => (int)value, + (int value) => (CompiledModelTestBase.Enum32)value))))), + elementMapping: SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfReferenceTypesComparer[], List>(new ListOfValueTypesComparer, CompiledModelTestBase.Enum32>(new ValueComparer( + (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), + (CompiledModelTestBase.Enum32 v) => v))), + keyComparer: new ListOfReferenceTypesComparer[], List>(new ListOfValueTypesComparer, CompiledModelTestBase.Enum32>(new ValueComparer( + (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), + (CompiledModelTestBase.Enum32 v) => v))), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter>(new JsonCollectionOfReferencesReaderWriter[], List>( + new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.Enum32>( + new JsonConvertedValueReaderWriter( + JsonInt32ReaderWriter.Instance, + new ValueConverter( + (CompiledModelTestBase.Enum32 value) => (int)value, + (int value) => (CompiledModelTestBase.Enum32)value))))), + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter[], List>( + new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.Enum32>( + new JsonConvertedValueReaderWriter( + JsonInt32ReaderWriter.Instance, + new ValueConverter( + (CompiledModelTestBase.Enum32 value) => (int)value, + (int value) => (CompiledModelTestBase.Enum32)value)))), + elementMapping: SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfValueTypesComparer, CompiledModelTestBase.Enum32>(new ValueComparer( + (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), + (CompiledModelTestBase.Enum32 v) => v)), + keyComparer: new ListOfValueTypesComparer, CompiledModelTestBase.Enum32>(new ValueComparer( + (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), + (CompiledModelTestBase.Enum32 v) => v)), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.Enum32>( + new JsonConvertedValueReaderWriter( + JsonInt32ReaderWriter.Instance, + new ValueConverter( + (CompiledModelTestBase.Enum32 value) => (int)value, + (int value) => (CompiledModelTestBase.Enum32)value)))), + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.Enum32>( + new JsonConvertedValueReaderWriter( + JsonInt32ReaderWriter.Instance, + new ValueConverter( + (CompiledModelTestBase.Enum32 value) => (int)value, + (int value) => (CompiledModelTestBase.Enum32)value))), + elementMapping: IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), + (CompiledModelTestBase.Enum32 v) => v), + keyComparer: new ValueComparer( + (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), + (CompiledModelTestBase.Enum32 v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "INTEGER"), + converter: new ValueConverter( + (CompiledModelTestBase.Enum32 value) => (int)value, + (int value) => (CompiledModelTestBase.Enum32)value), + jsonValueReaderWriter: new JsonConvertedValueReaderWriter( + JsonInt32ReaderWriter.Instance, + new ValueConverter( + (CompiledModelTestBase.Enum32 value) => (int)value, + (int value) => (CompiledModelTestBase.Enum32)value)))))); + enum32NestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum32NestedCollection", "TestNamespace") }); + var enum64 = runtimeEntityType.AddProperty( "Enum64", typeof(CompiledModelTestBase.Enum64), @@ -2429,27 +2796,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum64.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum64((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum64((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(enum64, 44), + (InternalEntityEntry entry) => entry.ReadOriginalValue(enum64, 48), (InternalEntityEntry entry) => entry.GetCurrentValue(enum64), - (ValueBuffer valueBuffer) => valueBuffer[44]); + (ValueBuffer valueBuffer) => valueBuffer[48]); enum64.SetPropertyIndexes( - index: 44, - originalValueIndex: 44, + index: 48, + originalValueIndex: 48, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enum64.TypeMapping = LongTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "INTEGER"), @@ -2481,35 +2848,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum64Array.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum64Array((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum64Array((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(enum64Array, 45), + (InternalEntityEntry entry) => entry.ReadOriginalValue(enum64Array, 49), (InternalEntityEntry entry) => entry.GetCurrentValue(enum64Array), - (ValueBuffer valueBuffer) => valueBuffer[45]); + (ValueBuffer valueBuffer) => valueBuffer[49]); enum64Array.SetPropertyIndexes( - index: 45, - originalValueIndex: 45, + index: 49, + originalValueIndex: 49, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enum64Array.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonInt64ReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.Enum64 value) => (long)value, (long value) => (CompiledModelTestBase.Enum64)value)))), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonInt64ReaderWriter.Instance, new ValueConverter( @@ -2518,15 +2885,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: LongTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "INTEGER"), @@ -2558,35 +2925,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum64AsString.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum64AsString((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum64AsString((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(enum64AsString, 46), + (InternalEntityEntry entry) => entry.ReadOriginalValue(enum64AsString, 50), (InternalEntityEntry entry) => entry.GetCurrentValue(enum64AsString), - (ValueBuffer valueBuffer) => valueBuffer[46]); + (ValueBuffer valueBuffer) => valueBuffer[50]); enum64AsString.SetPropertyIndexes( - index: 46, - originalValueIndex: 46, + index: 50, + originalValueIndex: 50, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enum64AsString.TypeMapping = SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), converter: new ValueConverter( - (CompiledModelTestBase.Enum64 v) => v.ToString(), + (CompiledModelTestBase.Enum64 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum64 v) => v.ToString(), + (CompiledModelTestBase.Enum64 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))); enum64AsString.SetSentinelFromProviderValue("Default"); enum64AsString.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum64AsString", "TestNamespace") }); @@ -2608,60 +2975,60 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum64AsStringArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum64AsStringArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum64AsStringArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(enum64AsStringArray, 47), + (InternalEntityEntry entry) => entry.ReadOriginalValue(enum64AsStringArray, 51), (InternalEntityEntry entry) => entry.GetCurrentValue(enum64AsStringArray), - (ValueBuffer valueBuffer) => valueBuffer[47]); + (ValueBuffer valueBuffer) => valueBuffer[51]); enum64AsStringArray.SetPropertyIndexes( - index: 47, - originalValueIndex: 47, + index: 51, + originalValueIndex: 51, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enum64AsStringArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum64 v) => v.ToString(), + (CompiledModelTestBase.Enum64 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum64 v) => v.ToString(), + (CompiledModelTestBase.Enum64 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))), elementMapping: SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), converter: new ValueConverter( - (CompiledModelTestBase.Enum64 v) => v.ToString(), + (CompiledModelTestBase.Enum64 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum64 v) => v.ToString(), + (CompiledModelTestBase.Enum64 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))); enum64AsStringArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum64AsStringArray", "TestNamespace") }); @@ -2682,60 +3049,60 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum64AsStringCollection.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum64AsStringCollection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum64AsStringCollection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(enum64AsStringCollection, 48), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(enum64AsStringCollection, 52), (InternalEntityEntry entry) => entry.GetCurrentValue>(enum64AsStringCollection), - (ValueBuffer valueBuffer) => valueBuffer[48]); + (ValueBuffer valueBuffer) => valueBuffer[52]); enum64AsStringCollection.SetPropertyIndexes( - index: 48, - originalValueIndex: 48, + index: 52, + originalValueIndex: 52, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enum64AsStringCollection.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer, CompiledModelTestBase.Enum64>(new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer, CompiledModelTestBase.Enum64>(new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, CompiledModelTestBase.Enum64>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.Enum64>( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum64 v) => v.ToString(), + (CompiledModelTestBase.Enum64 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, CompiledModelTestBase.Enum64>( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.Enum64>( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum64 v) => v.ToString(), + (CompiledModelTestBase.Enum64 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))), elementMapping: SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), converter: new ValueConverter( - (CompiledModelTestBase.Enum64 v) => v.ToString(), + (CompiledModelTestBase.Enum64 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum64 v) => v.ToString(), + (CompiledModelTestBase.Enum64 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))); enum64AsStringCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum64AsStringCollection", "TestNamespace") }); @@ -2756,35 +3123,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum64Collection.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum64Collection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum64Collection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(enum64Collection, 49), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(enum64Collection, 53), (InternalEntityEntry entry) => entry.GetCurrentValue>(enum64Collection), - (ValueBuffer valueBuffer) => valueBuffer[49]); + (ValueBuffer valueBuffer) => valueBuffer[53]); enum64Collection.SetPropertyIndexes( - index: 49, - originalValueIndex: 49, + index: 53, + originalValueIndex: 53, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enum64Collection.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer, CompiledModelTestBase.Enum64>(new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer, CompiledModelTestBase.Enum64>(new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, CompiledModelTestBase.Enum64>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.Enum64>( new JsonConvertedValueReaderWriter( JsonInt64ReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.Enum64 value) => (long)value, (long value) => (CompiledModelTestBase.Enum64)value)))), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, CompiledModelTestBase.Enum64>( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.Enum64>( new JsonConvertedValueReaderWriter( JsonInt64ReaderWriter.Instance, new ValueConverter( @@ -2793,15 +3160,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: LongTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "INTEGER"), @@ -2832,23 +3199,23 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum8.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum8((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum8((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(enum8, 50), + (InternalEntityEntry entry) => entry.ReadOriginalValue(enum8, 54), (InternalEntityEntry entry) => entry.GetCurrentValue(enum8), - (ValueBuffer valueBuffer) => valueBuffer[50]); + (ValueBuffer valueBuffer) => valueBuffer[54]); enum8.SetPropertyIndexes( - index: 50, - originalValueIndex: 50, + index: 54, + originalValueIndex: 54, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enum8.TypeMapping = SByteTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), providerValueComparer: new ValueComparer( (sbyte v1, sbyte v2) => v1 == v2, @@ -2884,35 +3251,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum8Array.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum8Array((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum8Array((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(enum8Array, 51), + (InternalEntityEntry entry) => entry.ReadOriginalValue(enum8Array, 55), (InternalEntityEntry entry) => entry.GetCurrentValue(enum8Array), - (ValueBuffer valueBuffer) => valueBuffer[51]); + (ValueBuffer valueBuffer) => valueBuffer[55]); enum8Array.SetPropertyIndexes( - index: 51, - originalValueIndex: 51, + index: 55, + originalValueIndex: 55, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enum8Array.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonSByteReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.Enum8 value) => (sbyte)value, (sbyte value) => (CompiledModelTestBase.Enum8)value)))), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonSByteReaderWriter.Instance, new ValueConverter( @@ -2921,11 +3288,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SByteTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), providerValueComparer: new ValueComparer( (sbyte v1, sbyte v2) => v1 == v2, @@ -2961,35 +3328,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum8AsString.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum8AsString((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum8AsString((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(enum8AsString, 52), + (InternalEntityEntry entry) => entry.ReadOriginalValue(enum8AsString, 56), (InternalEntityEntry entry) => entry.GetCurrentValue(enum8AsString), - (ValueBuffer valueBuffer) => valueBuffer[52]); + (ValueBuffer valueBuffer) => valueBuffer[56]); enum8AsString.SetPropertyIndexes( - index: 52, - originalValueIndex: 52, + index: 56, + originalValueIndex: 56, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enum8AsString.TypeMapping = SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), converter: new ValueConverter( - (CompiledModelTestBase.Enum8 v) => v.ToString(), + (CompiledModelTestBase.Enum8 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum8 v) => v.ToString(), + (CompiledModelTestBase.Enum8 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))); enum8AsString.SetSentinelFromProviderValue("Default"); enum8AsString.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum8AsString", "TestNamespace") }); @@ -3011,60 +3378,60 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum8AsStringArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum8AsStringArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum8AsStringArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(enum8AsStringArray, 53), + (InternalEntityEntry entry) => entry.ReadOriginalValue(enum8AsStringArray, 57), (InternalEntityEntry entry) => entry.GetCurrentValue(enum8AsStringArray), - (ValueBuffer valueBuffer) => valueBuffer[53]); + (ValueBuffer valueBuffer) => valueBuffer[57]); enum8AsStringArray.SetPropertyIndexes( - index: 53, - originalValueIndex: 53, + index: 57, + originalValueIndex: 57, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enum8AsStringArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum8 v) => v.ToString(), + (CompiledModelTestBase.Enum8 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum8 v) => v.ToString(), + (CompiledModelTestBase.Enum8 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))), elementMapping: SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), converter: new ValueConverter( - (CompiledModelTestBase.Enum8 v) => v.ToString(), + (CompiledModelTestBase.Enum8 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum8 v) => v.ToString(), + (CompiledModelTestBase.Enum8 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))); enum8AsStringArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum8AsStringArray", "TestNamespace") }); @@ -3085,60 +3452,60 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum8AsStringCollection.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum8AsStringCollection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum8AsStringCollection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(enum8AsStringCollection, 54), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(enum8AsStringCollection, 58), (InternalEntityEntry entry) => entry.GetCurrentValue>(enum8AsStringCollection), - (ValueBuffer valueBuffer) => valueBuffer[54]); + (ValueBuffer valueBuffer) => valueBuffer[58]); enum8AsStringCollection.SetPropertyIndexes( - index: 54, - originalValueIndex: 54, + index: 58, + originalValueIndex: 58, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enum8AsStringCollection.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer, CompiledModelTestBase.Enum8>(new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer, CompiledModelTestBase.Enum8>(new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, CompiledModelTestBase.Enum8>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.Enum8>( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum8 v) => v.ToString(), + (CompiledModelTestBase.Enum8 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, CompiledModelTestBase.Enum8>( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.Enum8>( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum8 v) => v.ToString(), + (CompiledModelTestBase.Enum8 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))), elementMapping: SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), converter: new ValueConverter( - (CompiledModelTestBase.Enum8 v) => v.ToString(), + (CompiledModelTestBase.Enum8 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum8 v) => v.ToString(), + (CompiledModelTestBase.Enum8 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))); enum8AsStringCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum8AsStringCollection", "TestNamespace") }); @@ -3159,35 +3526,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum8Collection.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum8Collection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum8Collection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(enum8Collection, 55), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(enum8Collection, 59), (InternalEntityEntry entry) => entry.GetCurrentValue>(enum8Collection), - (ValueBuffer valueBuffer) => valueBuffer[55]); + (ValueBuffer valueBuffer) => valueBuffer[59]); enum8Collection.SetPropertyIndexes( - index: 55, - originalValueIndex: 55, + index: 59, + originalValueIndex: 59, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enum8Collection.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer, CompiledModelTestBase.Enum8>(new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer, CompiledModelTestBase.Enum8>(new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, CompiledModelTestBase.Enum8>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.Enum8>( new JsonConvertedValueReaderWriter( JsonSByteReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.Enum8 value) => (sbyte)value, (sbyte value) => (CompiledModelTestBase.Enum8)value)))), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, CompiledModelTestBase.Enum8>( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.Enum8>( new JsonConvertedValueReaderWriter( JsonSByteReaderWriter.Instance, new ValueConverter( @@ -3196,11 +3563,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SByteTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), providerValueComparer: new ValueComparer( (sbyte v1, sbyte v2) => v1 == v2, @@ -3218,6 +3585,109 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (sbyte value) => (CompiledModelTestBase.Enum8)value)))); enum8Collection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum8Collection", "TestNamespace") }); + var enum8NestedCollection = runtimeEntityType.AddProperty( + "Enum8NestedCollection", + typeof(CompiledModelTestBase.Enum8[][]), + propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("Enum8NestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + enum8NestedCollection.SetGetter( + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum8NestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum8NestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum8NestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum8NestedCollection(instance) == null); + enum8NestedCollection.SetSetter( + (CompiledModelTestBase.ManyTypes entity, CompiledModelTestBase.Enum8[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum8NestedCollection(entity) = value); + enum8NestedCollection.SetMaterializationSetter( + (CompiledModelTestBase.ManyTypes entity, CompiledModelTestBase.Enum8[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum8NestedCollection(entity) = value); + enum8NestedCollection.SetAccessors( + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum8NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum8NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => entry.ReadOriginalValue(enum8NestedCollection, 60), + (InternalEntityEntry entry) => entry.GetCurrentValue(enum8NestedCollection), + (ValueBuffer valueBuffer) => valueBuffer[60]); + enum8NestedCollection.SetPropertyIndexes( + index: 60, + originalValueIndex: 60, + shadowIndex: -1, + relationshipIndex: -1, + storeGenerationIndex: -1); + enum8NestedCollection.TypeMapping = SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfReferenceTypesComparer(new ListOfValueTypesComparer(new ValueComparer( + (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), + (CompiledModelTestBase.Enum8 v) => v))), + keyComparer: new ListOfReferenceTypesComparer(new ListOfValueTypesComparer(new ValueComparer( + (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), + (CompiledModelTestBase.Enum8 v) => v))), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfStructsReaderWriter( + new JsonConvertedValueReaderWriter( + JsonSByteReaderWriter.Instance, + new ValueConverter( + (CompiledModelTestBase.Enum8 value) => (sbyte)value, + (sbyte value) => (CompiledModelTestBase.Enum8)value))))), + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfStructsReaderWriter( + new JsonConvertedValueReaderWriter( + JsonSByteReaderWriter.Instance, + new ValueConverter( + (CompiledModelTestBase.Enum8 value) => (sbyte)value, + (sbyte value) => (CompiledModelTestBase.Enum8)value)))), + elementMapping: SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfValueTypesComparer(new ValueComparer( + (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), + (CompiledModelTestBase.Enum8 v) => v)), + keyComparer: new ListOfValueTypesComparer(new ValueComparer( + (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), + (CompiledModelTestBase.Enum8 v) => v)), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( + new JsonConvertedValueReaderWriter( + JsonSByteReaderWriter.Instance, + new ValueConverter( + (CompiledModelTestBase.Enum8 value) => (sbyte)value, + (sbyte value) => (CompiledModelTestBase.Enum8)value)))), + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( + new JsonConvertedValueReaderWriter( + JsonSByteReaderWriter.Instance, + new ValueConverter( + (CompiledModelTestBase.Enum8 value) => (sbyte)value, + (sbyte value) => (CompiledModelTestBase.Enum8)value))), + elementMapping: SByteTypeMapping.Default.Clone( + comparer: new ValueComparer( + (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), + (CompiledModelTestBase.Enum8 v) => v), + keyComparer: new ValueComparer( + (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), + (CompiledModelTestBase.Enum8 v) => v), + providerValueComparer: new ValueComparer( + (sbyte v1, sbyte v2) => v1 == v2, + (sbyte v) => (int)v, + (sbyte v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "INTEGER"), + converter: new ValueConverter( + (CompiledModelTestBase.Enum8 value) => (sbyte)value, + (sbyte value) => (CompiledModelTestBase.Enum8)value), + jsonValueReaderWriter: new JsonConvertedValueReaderWriter( + JsonSByteReaderWriter.Instance, + new ValueConverter( + (CompiledModelTestBase.Enum8 value) => (sbyte)value, + (sbyte value) => (CompiledModelTestBase.Enum8)value))))); + enum8NestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum8NestedCollection", "TestNamespace") }); + var enumToNumberConverterProperty = runtimeEntityType.AddProperty( "EnumToNumberConverterProperty", typeof(CompiledModelTestBase.Enum32), @@ -3236,23 +3706,23 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumToNumberConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumToNumberConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumToNumberConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(enumToNumberConverterProperty, 56), + (InternalEntityEntry entry) => entry.ReadOriginalValue(enumToNumberConverterProperty, 61), (InternalEntityEntry entry) => entry.GetCurrentValue(enumToNumberConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[56]); + (ValueBuffer valueBuffer) => valueBuffer[61]); enumToNumberConverterProperty.SetPropertyIndexes( - index: 56, - originalValueIndex: 56, + index: 61, + originalValueIndex: 61, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enumToNumberConverterProperty.TypeMapping = IntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -3289,35 +3759,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumToStringConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumToStringConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumToStringConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(enumToStringConverterProperty, 57), + (InternalEntityEntry entry) => entry.ReadOriginalValue(enumToStringConverterProperty, 62), (InternalEntityEntry entry) => entry.GetCurrentValue(enumToStringConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[57]); + (ValueBuffer valueBuffer) => valueBuffer[62]); enumToStringConverterProperty.SetPropertyIndexes( - index: 57, - originalValueIndex: 57, + index: 62, + originalValueIndex: 62, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enumToStringConverterProperty.TypeMapping = SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), converter: new ValueConverter( - (CompiledModelTestBase.Enum32 v) => v.ToString(), + (CompiledModelTestBase.Enum32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum32 v) => v.ToString(), + (CompiledModelTestBase.Enum32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))); enumToStringConverterProperty.SetSentinelFromProviderValue("Default"); enumToStringConverterProperty.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumToStringConverterProperty", "TestNamespace") }); @@ -3339,23 +3809,23 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU16.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU16((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU16((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(enumU16, 58), + (InternalEntityEntry entry) => entry.ReadOriginalValue(enumU16, 63), (InternalEntityEntry entry) => entry.GetCurrentValue(enumU16), - (ValueBuffer valueBuffer) => valueBuffer[58]); + (ValueBuffer valueBuffer) => valueBuffer[63]); enumU16.SetPropertyIndexes( - index: 58, - originalValueIndex: 58, + index: 63, + originalValueIndex: 63, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enumU16.TypeMapping = UShortTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v), providerValueComparer: new ValueComparer( (ushort v1, ushort v2) => v1 == v2, @@ -3391,35 +3861,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU16Array.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU16Array((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU16Array((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(enumU16Array, 59), + (InternalEntityEntry entry) => entry.ReadOriginalValue(enumU16Array, 64), (InternalEntityEntry entry) => entry.GetCurrentValue(enumU16Array), - (ValueBuffer valueBuffer) => valueBuffer[59]); + (ValueBuffer valueBuffer) => valueBuffer[64]); enumU16Array.SetPropertyIndexes( - index: 59, - originalValueIndex: 59, + index: 64, + originalValueIndex: 64, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enumU16Array.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonUInt16ReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.EnumU16 value) => (ushort)value, (ushort value) => (CompiledModelTestBase.EnumU16)value)))), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonUInt16ReaderWriter.Instance, new ValueConverter( @@ -3428,11 +3898,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: UShortTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v), providerValueComparer: new ValueComparer( (ushort v1, ushort v2) => v1 == v2, @@ -3468,35 +3938,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU16AsString.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU16AsString((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU16AsString((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(enumU16AsString, 60), + (InternalEntityEntry entry) => entry.ReadOriginalValue(enumU16AsString, 65), (InternalEntityEntry entry) => entry.GetCurrentValue(enumU16AsString), - (ValueBuffer valueBuffer) => valueBuffer[60]); + (ValueBuffer valueBuffer) => valueBuffer[65]); enumU16AsString.SetPropertyIndexes( - index: 60, - originalValueIndex: 60, + index: 65, + originalValueIndex: 65, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enumU16AsString.TypeMapping = SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), converter: new ValueConverter( - (CompiledModelTestBase.EnumU16 v) => v.ToString(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU16 v) => v.ToString(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))); enumU16AsString.SetSentinelFromProviderValue("Min"); enumU16AsString.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU16AsString", "TestNamespace") }); @@ -3518,60 +3988,60 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU16AsStringArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU16AsStringArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU16AsStringArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(enumU16AsStringArray, 61), + (InternalEntityEntry entry) => entry.ReadOriginalValue(enumU16AsStringArray, 66), (InternalEntityEntry entry) => entry.GetCurrentValue(enumU16AsStringArray), - (ValueBuffer valueBuffer) => valueBuffer[61]); + (ValueBuffer valueBuffer) => valueBuffer[66]); enumU16AsStringArray.SetPropertyIndexes( - index: 61, - originalValueIndex: 61, + index: 66, + originalValueIndex: 66, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enumU16AsStringArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU16 v) => v.ToString(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU16 v) => v.ToString(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))), elementMapping: SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), converter: new ValueConverter( - (CompiledModelTestBase.EnumU16 v) => v.ToString(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU16 v) => v.ToString(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))); enumU16AsStringArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU16AsStringArray", "TestNamespace") }); @@ -3592,60 +4062,60 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU16AsStringCollection.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU16AsStringCollection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU16AsStringCollection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(enumU16AsStringCollection, 62), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(enumU16AsStringCollection, 67), (InternalEntityEntry entry) => entry.GetCurrentValue>(enumU16AsStringCollection), - (ValueBuffer valueBuffer) => valueBuffer[62]); + (ValueBuffer valueBuffer) => valueBuffer[67]); enumU16AsStringCollection.SetPropertyIndexes( - index: 62, - originalValueIndex: 62, + index: 67, + originalValueIndex: 67, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enumU16AsStringCollection.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer, CompiledModelTestBase.EnumU16>(new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer, CompiledModelTestBase.EnumU16>(new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, CompiledModelTestBase.EnumU16>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.EnumU16>( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU16 v) => v.ToString(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, CompiledModelTestBase.EnumU16>( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.EnumU16>( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU16 v) => v.ToString(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))), elementMapping: SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), converter: new ValueConverter( - (CompiledModelTestBase.EnumU16 v) => v.ToString(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU16 v) => v.ToString(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))); enumU16AsStringCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU16AsStringCollection", "TestNamespace") }); @@ -3666,35 +4136,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU16Collection.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU16Collection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU16Collection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(enumU16Collection, 63), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(enumU16Collection, 68), (InternalEntityEntry entry) => entry.GetCurrentValue>(enumU16Collection), - (ValueBuffer valueBuffer) => valueBuffer[63]); + (ValueBuffer valueBuffer) => valueBuffer[68]); enumU16Collection.SetPropertyIndexes( - index: 63, - originalValueIndex: 63, + index: 68, + originalValueIndex: 68, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enumU16Collection.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer, CompiledModelTestBase.EnumU16>(new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer, CompiledModelTestBase.EnumU16>(new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, CompiledModelTestBase.EnumU16>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.EnumU16>( new JsonConvertedValueReaderWriter( JsonUInt16ReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.EnumU16 value) => (ushort)value, (ushort value) => (CompiledModelTestBase.EnumU16)value)))), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, CompiledModelTestBase.EnumU16>( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.EnumU16>( new JsonConvertedValueReaderWriter( JsonUInt16ReaderWriter.Instance, new ValueConverter( @@ -3703,11 +4173,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: UShortTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v), providerValueComparer: new ValueComparer( (ushort v1, ushort v2) => v1 == v2, @@ -3742,23 +4212,23 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU32.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU32((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU32((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(enumU32, 64), + (InternalEntityEntry entry) => entry.ReadOriginalValue(enumU32, 69), (InternalEntityEntry entry) => entry.GetCurrentValue(enumU32), - (ValueBuffer valueBuffer) => valueBuffer[64]); + (ValueBuffer valueBuffer) => valueBuffer[69]); enumU32.SetPropertyIndexes( - index: 64, - originalValueIndex: 64, + index: 69, + originalValueIndex: 69, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enumU32.TypeMapping = UIntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v), providerValueComparer: new ValueComparer( (uint v1, uint v2) => v1 == v2, @@ -3794,35 +4264,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU32Array.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU32Array((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU32Array((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(enumU32Array, 65), + (InternalEntityEntry entry) => entry.ReadOriginalValue(enumU32Array, 70), (InternalEntityEntry entry) => entry.GetCurrentValue(enumU32Array), - (ValueBuffer valueBuffer) => valueBuffer[65]); + (ValueBuffer valueBuffer) => valueBuffer[70]); enumU32Array.SetPropertyIndexes( - index: 65, - originalValueIndex: 65, + index: 70, + originalValueIndex: 70, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enumU32Array.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonUInt32ReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.EnumU32 value) => (uint)value, (uint value) => (CompiledModelTestBase.EnumU32)value)))), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonUInt32ReaderWriter.Instance, new ValueConverter( @@ -3831,11 +4301,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: UIntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v), providerValueComparer: new ValueComparer( (uint v1, uint v2) => v1 == v2, @@ -3871,35 +4341,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU32AsString.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU32AsString((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU32AsString((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(enumU32AsString, 66), + (InternalEntityEntry entry) => entry.ReadOriginalValue(enumU32AsString, 71), (InternalEntityEntry entry) => entry.GetCurrentValue(enumU32AsString), - (ValueBuffer valueBuffer) => valueBuffer[66]); + (ValueBuffer valueBuffer) => valueBuffer[71]); enumU32AsString.SetPropertyIndexes( - index: 66, - originalValueIndex: 66, + index: 71, + originalValueIndex: 71, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enumU32AsString.TypeMapping = SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), converter: new ValueConverter( - (CompiledModelTestBase.EnumU32 v) => v.ToString(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU32 v) => v.ToString(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))); enumU32AsString.SetSentinelFromProviderValue("Min"); enumU32AsString.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU32AsString", "TestNamespace") }); @@ -3921,60 +4391,60 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU32AsStringArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU32AsStringArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU32AsStringArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(enumU32AsStringArray, 67), + (InternalEntityEntry entry) => entry.ReadOriginalValue(enumU32AsStringArray, 72), (InternalEntityEntry entry) => entry.GetCurrentValue(enumU32AsStringArray), - (ValueBuffer valueBuffer) => valueBuffer[67]); + (ValueBuffer valueBuffer) => valueBuffer[72]); enumU32AsStringArray.SetPropertyIndexes( - index: 67, - originalValueIndex: 67, + index: 72, + originalValueIndex: 72, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enumU32AsStringArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU32 v) => v.ToString(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU32 v) => v.ToString(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))), elementMapping: SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), converter: new ValueConverter( - (CompiledModelTestBase.EnumU32 v) => v.ToString(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU32 v) => v.ToString(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))); enumU32AsStringArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU32AsStringArray", "TestNamespace") }); @@ -3995,60 +4465,60 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU32AsStringCollection.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU32AsStringCollection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU32AsStringCollection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(enumU32AsStringCollection, 68), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(enumU32AsStringCollection, 73), (InternalEntityEntry entry) => entry.GetCurrentValue>(enumU32AsStringCollection), - (ValueBuffer valueBuffer) => valueBuffer[68]); + (ValueBuffer valueBuffer) => valueBuffer[73]); enumU32AsStringCollection.SetPropertyIndexes( - index: 68, - originalValueIndex: 68, + index: 73, + originalValueIndex: 73, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enumU32AsStringCollection.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer, CompiledModelTestBase.EnumU32>(new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer, CompiledModelTestBase.EnumU32>(new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, CompiledModelTestBase.EnumU32>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.EnumU32>( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU32 v) => v.ToString(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, CompiledModelTestBase.EnumU32>( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.EnumU32>( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU32 v) => v.ToString(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))), elementMapping: SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), converter: new ValueConverter( - (CompiledModelTestBase.EnumU32 v) => v.ToString(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU32 v) => v.ToString(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))); enumU32AsStringCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU32AsStringCollection", "TestNamespace") }); @@ -4069,35 +4539,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU32Collection.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU32Collection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU32Collection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(enumU32Collection, 69), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(enumU32Collection, 74), (InternalEntityEntry entry) => entry.GetCurrentValue>(enumU32Collection), - (ValueBuffer valueBuffer) => valueBuffer[69]); + (ValueBuffer valueBuffer) => valueBuffer[74]); enumU32Collection.SetPropertyIndexes( - index: 69, - originalValueIndex: 69, + index: 74, + originalValueIndex: 74, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enumU32Collection.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer, CompiledModelTestBase.EnumU32>(new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer, CompiledModelTestBase.EnumU32>(new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, CompiledModelTestBase.EnumU32>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.EnumU32>( new JsonConvertedValueReaderWriter( JsonUInt32ReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.EnumU32 value) => (uint)value, (uint value) => (CompiledModelTestBase.EnumU32)value)))), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, CompiledModelTestBase.EnumU32>( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.EnumU32>( new JsonConvertedValueReaderWriter( JsonUInt32ReaderWriter.Instance, new ValueConverter( @@ -4106,11 +4576,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: UIntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v), providerValueComparer: new ValueComparer( (uint v1, uint v2) => v1 == v2, @@ -4145,27 +4615,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU64.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU64((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU64((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(enumU64, 70), + (InternalEntityEntry entry) => entry.ReadOriginalValue(enumU64, 75), (InternalEntityEntry entry) => entry.GetCurrentValue(enumU64), - (ValueBuffer valueBuffer) => valueBuffer[70]); + (ValueBuffer valueBuffer) => valueBuffer[75]); enumU64.SetPropertyIndexes( - index: 70, - originalValueIndex: 70, + index: 75, + originalValueIndex: 75, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enumU64.TypeMapping = SqliteULongTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), providerValueComparer: new ValueComparer( (ulong v1, ulong v2) => v1 == v2, - (ulong v) => v.GetHashCode(), + (ulong v) => ((object)v).GetHashCode(), (ulong v) => v), converter: new ValueConverter( (CompiledModelTestBase.EnumU64 value) => (ulong)value, @@ -4195,35 +4665,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU64Array.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU64Array((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU64Array((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(enumU64Array, 71), + (InternalEntityEntry entry) => entry.ReadOriginalValue(enumU64Array, 76), (InternalEntityEntry entry) => entry.GetCurrentValue(enumU64Array), - (ValueBuffer valueBuffer) => valueBuffer[71]); + (ValueBuffer valueBuffer) => valueBuffer[76]); enumU64Array.SetPropertyIndexes( - index: 71, - originalValueIndex: 71, + index: 76, + originalValueIndex: 76, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enumU64Array.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonUInt64ReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.EnumU64 value) => (ulong)value, (ulong value) => (CompiledModelTestBase.EnumU64)value)))), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonUInt64ReaderWriter.Instance, new ValueConverter( @@ -4232,15 +4702,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqliteULongTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), providerValueComparer: new ValueComparer( (ulong v1, ulong v2) => v1 == v2, - (ulong v) => v.GetHashCode(), + (ulong v) => ((object)v).GetHashCode(), (ulong v) => v), converter: new ValueConverter( (CompiledModelTestBase.EnumU64 value) => (ulong)value, @@ -4270,35 +4740,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU64AsString.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU64AsString((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU64AsString((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(enumU64AsString, 72), + (InternalEntityEntry entry) => entry.ReadOriginalValue(enumU64AsString, 77), (InternalEntityEntry entry) => entry.GetCurrentValue(enumU64AsString), - (ValueBuffer valueBuffer) => valueBuffer[72]); + (ValueBuffer valueBuffer) => valueBuffer[77]); enumU64AsString.SetPropertyIndexes( - index: 72, - originalValueIndex: 72, + index: 77, + originalValueIndex: 77, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enumU64AsString.TypeMapping = SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), converter: new ValueConverter( - (CompiledModelTestBase.EnumU64 v) => v.ToString(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU64 v) => v.ToString(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))); enumU64AsString.SetSentinelFromProviderValue("Min"); enumU64AsString.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU64AsString", "TestNamespace") }); @@ -4320,60 +4790,60 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU64AsStringArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU64AsStringArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU64AsStringArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(enumU64AsStringArray, 73), + (InternalEntityEntry entry) => entry.ReadOriginalValue(enumU64AsStringArray, 78), (InternalEntityEntry entry) => entry.GetCurrentValue(enumU64AsStringArray), - (ValueBuffer valueBuffer) => valueBuffer[73]); + (ValueBuffer valueBuffer) => valueBuffer[78]); enumU64AsStringArray.SetPropertyIndexes( - index: 73, - originalValueIndex: 73, + index: 78, + originalValueIndex: 78, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enumU64AsStringArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU64 v) => v.ToString(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU64 v) => v.ToString(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))), elementMapping: SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), converter: new ValueConverter( - (CompiledModelTestBase.EnumU64 v) => v.ToString(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU64 v) => v.ToString(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))); enumU64AsStringArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU64AsStringArray", "TestNamespace") }); @@ -4394,60 +4864,60 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU64AsStringCollection.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU64AsStringCollection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU64AsStringCollection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(enumU64AsStringCollection, 74), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(enumU64AsStringCollection, 79), (InternalEntityEntry entry) => entry.GetCurrentValue>(enumU64AsStringCollection), - (ValueBuffer valueBuffer) => valueBuffer[74]); + (ValueBuffer valueBuffer) => valueBuffer[79]); enumU64AsStringCollection.SetPropertyIndexes( - index: 74, - originalValueIndex: 74, + index: 79, + originalValueIndex: 79, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enumU64AsStringCollection.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer, CompiledModelTestBase.EnumU64>(new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer, CompiledModelTestBase.EnumU64>(new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, CompiledModelTestBase.EnumU64>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.EnumU64>( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU64 v) => v.ToString(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, CompiledModelTestBase.EnumU64>( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.EnumU64>( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU64 v) => v.ToString(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))), elementMapping: SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), converter: new ValueConverter( - (CompiledModelTestBase.EnumU64 v) => v.ToString(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU64 v) => v.ToString(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))); enumU64AsStringCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU64AsStringCollection", "TestNamespace") }); @@ -4468,35 +4938,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU64Collection.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU64Collection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU64Collection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(enumU64Collection, 75), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(enumU64Collection, 80), (InternalEntityEntry entry) => entry.GetCurrentValue>(enumU64Collection), - (ValueBuffer valueBuffer) => valueBuffer[75]); + (ValueBuffer valueBuffer) => valueBuffer[80]); enumU64Collection.SetPropertyIndexes( - index: 75, - originalValueIndex: 75, + index: 80, + originalValueIndex: 80, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enumU64Collection.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer, CompiledModelTestBase.EnumU64>(new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer, CompiledModelTestBase.EnumU64>(new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, CompiledModelTestBase.EnumU64>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.EnumU64>( new JsonConvertedValueReaderWriter( JsonUInt64ReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.EnumU64 value) => (ulong)value, (ulong value) => (CompiledModelTestBase.EnumU64)value)))), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, CompiledModelTestBase.EnumU64>( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.EnumU64>( new JsonConvertedValueReaderWriter( JsonUInt64ReaderWriter.Instance, new ValueConverter( @@ -4505,15 +4975,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqliteULongTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), providerValueComparer: new ValueComparer( (ulong v1, ulong v2) => v1 == v2, - (ulong v) => v.GetHashCode(), + (ulong v) => ((object)v).GetHashCode(), (ulong v) => v), converter: new ValueConverter( (CompiledModelTestBase.EnumU64 value) => (ulong)value, @@ -4525,6 +4995,107 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (ulong value) => (CompiledModelTestBase.EnumU64)value)))); enumU64Collection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU64Collection", "TestNamespace") }); + var enumU64NestedCollection = runtimeEntityType.AddProperty( + "EnumU64NestedCollection", + typeof(CompiledModelTestBase.EnumU64[][]), + propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("EnumU64NestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + enumU64NestedCollection.SetGetter( + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU64NestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU64NestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU64NestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU64NestedCollection(instance) == null); + enumU64NestedCollection.SetSetter( + (CompiledModelTestBase.ManyTypes entity, CompiledModelTestBase.EnumU64[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU64NestedCollection(entity) = value); + enumU64NestedCollection.SetMaterializationSetter( + (CompiledModelTestBase.ManyTypes entity, CompiledModelTestBase.EnumU64[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU64NestedCollection(entity) = value); + enumU64NestedCollection.SetAccessors( + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU64NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU64NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => entry.ReadOriginalValue(enumU64NestedCollection, 81), + (InternalEntityEntry entry) => entry.GetCurrentValue(enumU64NestedCollection), + (ValueBuffer valueBuffer) => valueBuffer[81]); + enumU64NestedCollection.SetPropertyIndexes( + index: 81, + originalValueIndex: 81, + shadowIndex: -1, + relationshipIndex: -1, + storeGenerationIndex: -1); + enumU64NestedCollection.TypeMapping = SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfReferenceTypesComparer(new ListOfValueTypesComparer(new ValueComparer( + (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => v))), + keyComparer: new ListOfReferenceTypesComparer(new ListOfValueTypesComparer(new ValueComparer( + (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => v))), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfStructsReaderWriter( + new JsonConvertedValueReaderWriter( + JsonUInt64ReaderWriter.Instance, + new ValueConverter( + (CompiledModelTestBase.EnumU64 value) => (ulong)value, + (ulong value) => (CompiledModelTestBase.EnumU64)value))))), + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfStructsReaderWriter( + new JsonConvertedValueReaderWriter( + JsonUInt64ReaderWriter.Instance, + new ValueConverter( + (CompiledModelTestBase.EnumU64 value) => (ulong)value, + (ulong value) => (CompiledModelTestBase.EnumU64)value)))), + elementMapping: SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfValueTypesComparer(new ValueComparer( + (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => v)), + keyComparer: new ListOfValueTypesComparer(new ValueComparer( + (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => v)), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( + new JsonConvertedValueReaderWriter( + JsonUInt64ReaderWriter.Instance, + new ValueConverter( + (CompiledModelTestBase.EnumU64 value) => (ulong)value, + (ulong value) => (CompiledModelTestBase.EnumU64)value)))), + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( + new JsonConvertedValueReaderWriter( + JsonUInt64ReaderWriter.Instance, + new ValueConverter( + (CompiledModelTestBase.EnumU64 value) => (ulong)value, + (ulong value) => (CompiledModelTestBase.EnumU64)value))), + elementMapping: SqliteULongTypeMapping.Default.Clone( + comparer: new ValueComparer( + (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => v), + keyComparer: new ValueComparer( + (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => v), + providerValueComparer: new ValueComparer( + (ulong v1, ulong v2) => v1 == v2, + (ulong v) => ((object)v).GetHashCode(), + (ulong v) => v), + converter: new ValueConverter( + (CompiledModelTestBase.EnumU64 value) => (ulong)value, + (ulong value) => (CompiledModelTestBase.EnumU64)value), + jsonValueReaderWriter: new JsonConvertedValueReaderWriter( + JsonUInt64ReaderWriter.Instance, + new ValueConverter( + (CompiledModelTestBase.EnumU64 value) => (ulong)value, + (ulong value) => (CompiledModelTestBase.EnumU64)value))))); + enumU64NestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU64NestedCollection", "TestNamespace") }); + var enumU8 = runtimeEntityType.AddProperty( "EnumU8", typeof(CompiledModelTestBase.EnumU8), @@ -4542,23 +5113,23 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU8.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU8((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU8((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(enumU8, 76), + (InternalEntityEntry entry) => entry.ReadOriginalValue(enumU8, 82), (InternalEntityEntry entry) => entry.GetCurrentValue(enumU8), - (ValueBuffer valueBuffer) => valueBuffer[76]); + (ValueBuffer valueBuffer) => valueBuffer[82]); enumU8.SetPropertyIndexes( - index: 76, - originalValueIndex: 76, + index: 82, + originalValueIndex: 82, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enumU8.TypeMapping = ByteTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v), providerValueComparer: new ValueComparer( (byte v1, byte v2) => v1 == v2, @@ -4594,35 +5165,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU8Array.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU8Array((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU8Array((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(enumU8Array, 77), + (InternalEntityEntry entry) => entry.ReadOriginalValue(enumU8Array, 83), (InternalEntityEntry entry) => entry.GetCurrentValue(enumU8Array), - (ValueBuffer valueBuffer) => valueBuffer[77]); + (ValueBuffer valueBuffer) => valueBuffer[83]); enumU8Array.SetPropertyIndexes( - index: 77, - originalValueIndex: 77, + index: 83, + originalValueIndex: 83, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enumU8Array.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonByteReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.EnumU8 value) => (byte)value, (byte value) => (CompiledModelTestBase.EnumU8)value)))), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonByteReaderWriter.Instance, new ValueConverter( @@ -4631,11 +5202,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: ByteTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v), providerValueComparer: new ValueComparer( (byte v1, byte v2) => v1 == v2, @@ -4671,35 +5242,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU8AsString.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU8AsString((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU8AsString((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(enumU8AsString, 78), + (InternalEntityEntry entry) => entry.ReadOriginalValue(enumU8AsString, 84), (InternalEntityEntry entry) => entry.GetCurrentValue(enumU8AsString), - (ValueBuffer valueBuffer) => valueBuffer[78]); + (ValueBuffer valueBuffer) => valueBuffer[84]); enumU8AsString.SetPropertyIndexes( - index: 78, - originalValueIndex: 78, + index: 84, + originalValueIndex: 84, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enumU8AsString.TypeMapping = SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), converter: new ValueConverter( - (CompiledModelTestBase.EnumU8 v) => v.ToString(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU8 v) => v.ToString(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))); enumU8AsString.SetSentinelFromProviderValue("Min"); enumU8AsString.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU8AsString", "TestNamespace") }); @@ -4721,60 +5292,60 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU8AsStringArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU8AsStringArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU8AsStringArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(enumU8AsStringArray, 79), + (InternalEntityEntry entry) => entry.ReadOriginalValue(enumU8AsStringArray, 85), (InternalEntityEntry entry) => entry.GetCurrentValue(enumU8AsStringArray), - (ValueBuffer valueBuffer) => valueBuffer[79]); + (ValueBuffer valueBuffer) => valueBuffer[85]); enumU8AsStringArray.SetPropertyIndexes( - index: 79, - originalValueIndex: 79, + index: 85, + originalValueIndex: 85, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enumU8AsStringArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU8 v) => v.ToString(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU8 v) => v.ToString(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))), elementMapping: SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), converter: new ValueConverter( - (CompiledModelTestBase.EnumU8 v) => v.ToString(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU8 v) => v.ToString(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))); enumU8AsStringArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU8AsStringArray", "TestNamespace") }); @@ -4795,60 +5366,60 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU8AsStringCollection.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU8AsStringCollection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU8AsStringCollection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(enumU8AsStringCollection, 80), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(enumU8AsStringCollection, 86), (InternalEntityEntry entry) => entry.GetCurrentValue>(enumU8AsStringCollection), - (ValueBuffer valueBuffer) => valueBuffer[80]); + (ValueBuffer valueBuffer) => valueBuffer[86]); enumU8AsStringCollection.SetPropertyIndexes( - index: 80, - originalValueIndex: 80, + index: 86, + originalValueIndex: 86, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enumU8AsStringCollection.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer, CompiledModelTestBase.EnumU8>(new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer, CompiledModelTestBase.EnumU8>(new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, CompiledModelTestBase.EnumU8>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.EnumU8>( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU8 v) => v.ToString(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, CompiledModelTestBase.EnumU8>( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.EnumU8>( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU8 v) => v.ToString(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))), elementMapping: SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), converter: new ValueConverter( - (CompiledModelTestBase.EnumU8 v) => v.ToString(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU8 v) => v.ToString(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))); enumU8AsStringCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU8AsStringCollection", "TestNamespace") }); @@ -4869,35 +5440,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU8Collection.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU8Collection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU8Collection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(enumU8Collection, 81), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(enumU8Collection, 87), (InternalEntityEntry entry) => entry.GetCurrentValue>(enumU8Collection), - (ValueBuffer valueBuffer) => valueBuffer[81]); + (ValueBuffer valueBuffer) => valueBuffer[87]); enumU8Collection.SetPropertyIndexes( - index: 81, - originalValueIndex: 81, + index: 87, + originalValueIndex: 87, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enumU8Collection.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer, CompiledModelTestBase.EnumU8>(new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer, CompiledModelTestBase.EnumU8>(new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, CompiledModelTestBase.EnumU8>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.EnumU8>( new JsonConvertedValueReaderWriter( JsonByteReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.EnumU8 value) => (byte)value, (byte value) => (CompiledModelTestBase.EnumU8)value)))), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, CompiledModelTestBase.EnumU8>( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.EnumU8>( new JsonConvertedValueReaderWriter( JsonByteReaderWriter.Instance, new ValueConverter( @@ -4906,11 +5477,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: ByteTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v), providerValueComparer: new ValueComparer( (byte v1, byte v2) => v1 == v2, @@ -4946,27 +5517,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas @float.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Float((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Float((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(@float, 82), + (InternalEntityEntry entry) => entry.ReadOriginalValue(@float, 88), (InternalEntityEntry entry) => entry.GetCurrentValue(@float), - (ValueBuffer valueBuffer) => valueBuffer[82]); + (ValueBuffer valueBuffer) => valueBuffer[88]); @float.SetPropertyIndexes( - index: 82, - originalValueIndex: 82, + index: 88, + originalValueIndex: 88, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); @float.TypeMapping = FloatTypeMapping.Default.Clone( comparer: new ValueComparer( (float v1, float v2) => v1.Equals(v2), - (float v) => v.GetHashCode(), + (float v) => ((object)v).GetHashCode(), (float v) => v), keyComparer: new ValueComparer( (float v1, float v2) => v1.Equals(v2), - (float v) => v.GetHashCode(), + (float v) => ((object)v).GetHashCode(), (float v) => v), providerValueComparer: new ValueComparer( (float v1, float v2) => v1.Equals(v2), - (float v) => v.GetHashCode(), + (float v) => ((object)v).GetHashCode(), (float v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "REAL")); @@ -4989,44 +5560,44 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas floatArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_FloatArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_FloatArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(floatArray, 83), + (InternalEntityEntry entry) => entry.ReadOriginalValue(floatArray, 89), (InternalEntityEntry entry) => entry.GetCurrentValue(floatArray), - (ValueBuffer valueBuffer) => valueBuffer[83]); + (ValueBuffer valueBuffer) => valueBuffer[89]); floatArray.SetPropertyIndexes( - index: 83, - originalValueIndex: 83, + index: 89, + originalValueIndex: 89, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); floatArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer(new ValueComparer( (float v1, float v2) => v1.Equals(v2), - (float v) => v.GetHashCode(), + (float v) => ((object)v).GetHashCode(), (float v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer(new ValueComparer( (float v1, float v2) => v1.Equals(v2), - (float v) => v.GetHashCode(), + (float v) => ((object)v).GetHashCode(), (float v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( JsonFloatReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( JsonFloatReaderWriter.Instance), elementMapping: FloatTypeMapping.Default.Clone( comparer: new ValueComparer( (float v1, float v2) => v1.Equals(v2), - (float v) => v.GetHashCode(), + (float v) => ((object)v).GetHashCode(), (float v) => v), keyComparer: new ValueComparer( (float v1, float v2) => v1.Equals(v2), - (float v) => v.GetHashCode(), + (float v) => ((object)v).GetHashCode(), (float v) => v), providerValueComparer: new ValueComparer( (float v1, float v2) => v1.Equals(v2), - (float v) => v.GetHashCode(), + (float v) => ((object)v).GetHashCode(), (float v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "REAL"))); @@ -5050,12 +5621,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas guid.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Guid((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Guid((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(guid, 84), + (InternalEntityEntry entry) => entry.ReadOriginalValue(guid, 90), (InternalEntityEntry entry) => entry.GetCurrentValue(guid), - (ValueBuffer valueBuffer) => valueBuffer[84]); + (ValueBuffer valueBuffer) => valueBuffer[90]); guid.SetPropertyIndexes( - index: 84, - originalValueIndex: 84, + index: 90, + originalValueIndex: 90, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); @@ -5079,35 +5650,121 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas guidArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_GuidArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_GuidArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(guidArray, 85), + (InternalEntityEntry entry) => entry.ReadOriginalValue(guidArray, 91), (InternalEntityEntry entry) => entry.GetCurrentValue(guidArray), - (ValueBuffer valueBuffer) => valueBuffer[85]); + (ValueBuffer valueBuffer) => valueBuffer[91]); guidArray.SetPropertyIndexes( - index: 85, - originalValueIndex: 85, + index: 91, + originalValueIndex: 91, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); guidArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer(new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer(new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( SqliteJsonGuidReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( SqliteJsonGuidReaderWriter.Instance), elementMapping: SqliteGuidTypeMapping.Default); guidArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_GuidArray", "TestNamespace") }); + var guidNestedCollection = runtimeEntityType.AddProperty( + "GuidNestedCollection", + typeof(ICollection), + propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("GuidNestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + guidNestedCollection.SetGetter( + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_GuidNestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_GuidNestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_GuidNestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_GuidNestedCollection(instance) == null); + guidNestedCollection.SetSetter( + (CompiledModelTestBase.ManyTypes entity, ICollection value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_GuidNestedCollection(entity) = value); + guidNestedCollection.SetMaterializationSetter( + (CompiledModelTestBase.ManyTypes entity, ICollection value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_GuidNestedCollection(entity) = value); + guidNestedCollection.SetAccessors( + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_GuidNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_GuidNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(guidNestedCollection, 92), + (InternalEntityEntry entry) => entry.GetCurrentValue>(guidNestedCollection), + (ValueBuffer valueBuffer) => valueBuffer[92]); + guidNestedCollection.SetPropertyIndexes( + index: 92, + originalValueIndex: 92, + shadowIndex: -1, + relationshipIndex: -1, + storeGenerationIndex: -1); + guidNestedCollection.TypeMapping = SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfReferenceTypesComparer, Guid[][]>(new ListOfReferenceTypesComparer(new ListOfValueTypesComparer(new ValueComparer( + (Guid v1, Guid v2) => v1 == v2, + (Guid v) => ((object)v).GetHashCode(), + (Guid v) => v)))), + keyComparer: new ListOfReferenceTypesComparer, Guid[][]>(new ListOfReferenceTypesComparer(new ListOfValueTypesComparer(new ValueComparer( + (Guid v1, Guid v2) => v1 == v2, + (Guid v) => ((object)v).GetHashCode(), + (Guid v) => v)))), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter, Guid[][]>( + new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfStructsReaderWriter( + SqliteJsonGuidReaderWriter.Instance)))), + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter, Guid[][]>( + new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfStructsReaderWriter( + SqliteJsonGuidReaderWriter.Instance))), + elementMapping: SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfReferenceTypesComparer(new ListOfValueTypesComparer(new ValueComparer( + (Guid v1, Guid v2) => v1 == v2, + (Guid v) => ((object)v).GetHashCode(), + (Guid v) => v))), + keyComparer: new ListOfReferenceTypesComparer(new ListOfValueTypesComparer(new ValueComparer( + (Guid v1, Guid v2) => v1 == v2, + (Guid v) => ((object)v).GetHashCode(), + (Guid v) => v))), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfStructsReaderWriter( + SqliteJsonGuidReaderWriter.Instance))), + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfStructsReaderWriter( + SqliteJsonGuidReaderWriter.Instance)), + elementMapping: SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfValueTypesComparer(new ValueComparer( + (Guid v1, Guid v2) => v1 == v2, + (Guid v) => ((object)v).GetHashCode(), + (Guid v) => v)), + keyComparer: new ListOfValueTypesComparer(new ValueComparer( + (Guid v1, Guid v2) => v1 == v2, + (Guid v) => ((object)v).GetHashCode(), + (Guid v) => v)), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( + SqliteJsonGuidReaderWriter.Instance)), + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( + SqliteJsonGuidReaderWriter.Instance), + elementMapping: SqliteGuidTypeMapping.Default))); + guidNestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_GuidNestedCollection", "TestNamespace") }); + var guidToBytesConverterProperty = runtimeEntityType.AddProperty( "GuidToBytesConverterProperty", typeof(Guid), @@ -5126,23 +5783,23 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas guidToBytesConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_GuidToBytesConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_GuidToBytesConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(guidToBytesConverterProperty, 86), + (InternalEntityEntry entry) => entry.ReadOriginalValue(guidToBytesConverterProperty, 93), (InternalEntityEntry entry) => entry.GetCurrentValue(guidToBytesConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[86]); + (ValueBuffer valueBuffer) => valueBuffer[93]); guidToBytesConverterProperty.SetPropertyIndexes( - index: 86, - originalValueIndex: 86, + index: 93, + originalValueIndex: 93, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); guidToBytesConverterProperty.TypeMapping = SqliteByteArrayTypeMapping.Default.Clone( comparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), keyComparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), providerValueComparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), @@ -5179,27 +5836,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas guidToStringConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_GuidToStringConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_GuidToStringConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(guidToStringConverterProperty, 87), + (InternalEntityEntry entry) => entry.ReadOriginalValue(guidToStringConverterProperty, 94), (InternalEntityEntry entry) => entry.GetCurrentValue(guidToStringConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[87]); + (ValueBuffer valueBuffer) => valueBuffer[94]); guidToStringConverterProperty.SetPropertyIndexes( - index: 87, - originalValueIndex: 87, + index: 94, + originalValueIndex: 94, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); guidToStringConverterProperty.TypeMapping = SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), keyComparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( size: 36), @@ -5231,37 +5888,37 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas iPAddress.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_IPAddress((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_IPAddress((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(iPAddress, 88), + (InternalEntityEntry entry) => entry.ReadOriginalValue(iPAddress, 95), (InternalEntityEntry entry) => entry.GetCurrentValue(iPAddress), - (ValueBuffer valueBuffer) => valueBuffer[88]); + (ValueBuffer valueBuffer) => valueBuffer[95]); iPAddress.SetPropertyIndexes( - index: 88, - originalValueIndex: 88, + index: 95, + originalValueIndex: 95, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); iPAddress.TypeMapping = SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), keyComparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( size: 45), converter: new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)))); iPAddress.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_IPAddress", "TestNamespace") }); @@ -5282,62 +5939,62 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas iPAddressArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_IPAddressArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_IPAddressArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(iPAddressArray, 89), + (InternalEntityEntry entry) => entry.ReadOriginalValue(iPAddressArray, 96), (InternalEntityEntry entry) => entry.GetCurrentValue(iPAddressArray), - (ValueBuffer valueBuffer) => valueBuffer[89]); + (ValueBuffer valueBuffer) => valueBuffer[96]); iPAddressArray.SetPropertyIndexes( - index: 89, - originalValueIndex: 89, + index: 96, + originalValueIndex: 96, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); iPAddressArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfReferenceTypesComparer(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)))), elementMapping: SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), keyComparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( size: 45), converter: new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))); iPAddressArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_IPAddressArray", "TestNamespace") }); @@ -5359,23 +6016,23 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas iPAddressToBytesConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_IPAddressToBytesConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_IPAddressToBytesConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(iPAddressToBytesConverterProperty, 90), + (InternalEntityEntry entry) => entry.ReadOriginalValue(iPAddressToBytesConverterProperty, 97), (InternalEntityEntry entry) => entry.GetCurrentValue(iPAddressToBytesConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[90]); + (ValueBuffer valueBuffer) => valueBuffer[97]); iPAddressToBytesConverterProperty.SetPropertyIndexes( - index: 90, - originalValueIndex: 90, + index: 97, + originalValueIndex: 97, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); iPAddressToBytesConverterProperty.TypeMapping = SqliteByteArrayTypeMapping.Default.Clone( comparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), keyComparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), providerValueComparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), @@ -5411,37 +6068,37 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas iPAddressToStringConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_IPAddressToStringConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_IPAddressToStringConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(iPAddressToStringConverterProperty, 91), + (InternalEntityEntry entry) => entry.ReadOriginalValue(iPAddressToStringConverterProperty, 98), (InternalEntityEntry entry) => entry.GetCurrentValue(iPAddressToStringConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[91]); + (ValueBuffer valueBuffer) => valueBuffer[98]); iPAddressToStringConverterProperty.SetPropertyIndexes( - index: 91, - originalValueIndex: 91, + index: 98, + originalValueIndex: 98, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); iPAddressToStringConverterProperty.TypeMapping = SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), keyComparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( size: 45), converter: new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)))); iPAddressToStringConverterProperty.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_IPAddressToStringConverterProperty", "TestNamespace") }); @@ -5463,12 +6120,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas int16.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int16((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int16((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(int16, 92), + (InternalEntityEntry entry) => entry.ReadOriginalValue(int16, 99), (InternalEntityEntry entry) => entry.GetCurrentValue(int16), - (ValueBuffer valueBuffer) => valueBuffer[92]); + (ValueBuffer valueBuffer) => valueBuffer[99]); int16.SetPropertyIndexes( - index: 92, - originalValueIndex: 92, + index: 99, + originalValueIndex: 99, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); @@ -5506,31 +6163,31 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas int16Array.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int16Array((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int16Array((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(int16Array, 93), + (InternalEntityEntry entry) => entry.ReadOriginalValue(int16Array, 100), (InternalEntityEntry entry) => entry.GetCurrentValue(int16Array), - (ValueBuffer valueBuffer) => valueBuffer[93]); + (ValueBuffer valueBuffer) => valueBuffer[100]); int16Array.SetPropertyIndexes( - index: 93, - originalValueIndex: 93, + index: 100, + originalValueIndex: 100, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); int16Array.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer(new ValueComparer( (short v1, short v2) => v1 == v2, (short v) => (int)v, (short v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer(new ValueComparer( (short v1, short v2) => v1 == v2, (short v) => (int)v, (short v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( JsonInt16ReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( JsonInt16ReaderWriter.Instance), elementMapping: ShortTypeMapping.Default.Clone( comparer: new ValueComparer( @@ -5567,12 +6224,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas int32.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int32((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int32((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(int32, 94), + (InternalEntityEntry entry) => entry.ReadOriginalValue(int32, 101), (InternalEntityEntry entry) => entry.GetCurrentValue(int32), - (ValueBuffer valueBuffer) => valueBuffer[94]); + (ValueBuffer valueBuffer) => valueBuffer[101]); int32.SetPropertyIndexes( - index: 94, - originalValueIndex: 94, + index: 101, + originalValueIndex: 101, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); @@ -5610,31 +6267,31 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas int32Array.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int32Array((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int32Array((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(int32Array, 95), + (InternalEntityEntry entry) => entry.ReadOriginalValue(int32Array, 102), (InternalEntityEntry entry) => entry.GetCurrentValue(int32Array), - (ValueBuffer valueBuffer) => valueBuffer[95]); + (ValueBuffer valueBuffer) => valueBuffer[102]); int32Array.SetPropertyIndexes( - index: 95, - originalValueIndex: 95, + index: 102, + originalValueIndex: 102, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); int32Array.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer(new ValueComparer( (int v1, int v2) => v1 == v2, (int v) => v, (int v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer(new ValueComparer( (int v1, int v2) => v1 == v2, (int v) => v, (int v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( JsonInt32ReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( JsonInt32ReaderWriter.Instance), elementMapping: IntTypeMapping.Default.Clone( comparer: new ValueComparer( @@ -5653,6 +6310,85 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas storeTypeName: "INTEGER"))); int32Array.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int32Array", "TestNamespace") }); + var int32NestedCollection = runtimeEntityType.AddProperty( + "Int32NestedCollection", + typeof(int[][]), + propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("Int32NestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + int32NestedCollection.SetGetter( + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int32NestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int32NestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int32NestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int32NestedCollection(instance) == null); + int32NestedCollection.SetSetter( + (CompiledModelTestBase.ManyTypes entity, int[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int32NestedCollection(entity) = value); + int32NestedCollection.SetMaterializationSetter( + (CompiledModelTestBase.ManyTypes entity, int[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int32NestedCollection(entity) = value); + int32NestedCollection.SetAccessors( + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int32NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int32NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => entry.ReadOriginalValue(int32NestedCollection, 103), + (InternalEntityEntry entry) => entry.GetCurrentValue(int32NestedCollection), + (ValueBuffer valueBuffer) => valueBuffer[103]); + int32NestedCollection.SetPropertyIndexes( + index: 103, + originalValueIndex: 103, + shadowIndex: -1, + relationshipIndex: -1, + storeGenerationIndex: -1); + int32NestedCollection.TypeMapping = SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfReferenceTypesComparer(new ListOfValueTypesComparer(new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v))), + keyComparer: new ListOfReferenceTypesComparer(new ListOfValueTypesComparer(new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v))), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfStructsReaderWriter( + JsonInt32ReaderWriter.Instance))), + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfStructsReaderWriter( + JsonInt32ReaderWriter.Instance)), + elementMapping: SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfValueTypesComparer(new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)), + keyComparer: new ListOfValueTypesComparer(new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( + JsonInt32ReaderWriter.Instance)), + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( + JsonInt32ReaderWriter.Instance), + elementMapping: IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "INTEGER")))); + int32NestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int32NestedCollection", "TestNamespace") }); + var int64 = runtimeEntityType.AddProperty( "Int64", typeof(long), @@ -5671,27 +6407,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas int64.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int64((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int64((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(int64, 96), + (InternalEntityEntry entry) => entry.ReadOriginalValue(int64, 104), (InternalEntityEntry entry) => entry.GetCurrentValue(int64), - (ValueBuffer valueBuffer) => valueBuffer[96]); + (ValueBuffer valueBuffer) => valueBuffer[104]); int64.SetPropertyIndexes( - index: 96, - originalValueIndex: 96, + index: 104, + originalValueIndex: 104, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); int64.TypeMapping = LongTypeMapping.Default.Clone( comparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), keyComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "INTEGER")); @@ -5714,49 +6450,149 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas int64Array.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int64Array((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int64Array((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(int64Array, 97), + (InternalEntityEntry entry) => entry.ReadOriginalValue(int64Array, 105), (InternalEntityEntry entry) => entry.GetCurrentValue(int64Array), - (ValueBuffer valueBuffer) => valueBuffer[97]); + (ValueBuffer valueBuffer) => valueBuffer[105]); int64Array.SetPropertyIndexes( - index: 97, - originalValueIndex: 97, + index: 105, + originalValueIndex: 105, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); int64Array.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer(new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer(new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( JsonInt64ReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( JsonInt64ReaderWriter.Instance), elementMapping: LongTypeMapping.Default.Clone( comparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), keyComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "INTEGER"))); int64Array.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int64Array", "TestNamespace") }); + var int64NestedCollection = runtimeEntityType.AddProperty( + "Int64NestedCollection", + typeof(IList[]), + propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("Int64NestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + int64NestedCollection.SetGetter( + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int64NestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int64NestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int64NestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int64NestedCollection(instance) == null); + int64NestedCollection.SetSetter( + (CompiledModelTestBase.ManyTypes entity, IList[] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int64NestedCollection(entity) = value); + int64NestedCollection.SetMaterializationSetter( + (CompiledModelTestBase.ManyTypes entity, IList[] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int64NestedCollection(entity) = value); + int64NestedCollection.SetAccessors( + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int64NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int64NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(int64NestedCollection, 106), + (InternalEntityEntry entry) => entry.GetCurrentValue[]>(int64NestedCollection), + (ValueBuffer valueBuffer) => valueBuffer[106]); + int64NestedCollection.SetPropertyIndexes( + index: 106, + originalValueIndex: 106, + shadowIndex: -1, + relationshipIndex: -1, + storeGenerationIndex: -1); + int64NestedCollection.TypeMapping = SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfReferenceTypesComparer[], IList>(new ListOfReferenceTypesComparer, long[]>(new ListOfValueTypesComparer(new ValueComparer( + (long v1, long v2) => v1 == v2, + (long v) => ((object)v).GetHashCode(), + (long v) => v)))), + keyComparer: new ListOfReferenceTypesComparer[], IList>(new ListOfReferenceTypesComparer, long[]>(new ListOfValueTypesComparer(new ValueComparer( + (long v1, long v2) => v1 == v2, + (long v) => ((object)v).GetHashCode(), + (long v) => v)))), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter>(new JsonCollectionOfReferencesReaderWriter[], IList>( + new JsonCollectionOfReferencesReaderWriter, long[]>( + new JsonCollectionOfStructsReaderWriter( + JsonInt64ReaderWriter.Instance)))), + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter[], IList>( + new JsonCollectionOfReferencesReaderWriter, long[]>( + new JsonCollectionOfStructsReaderWriter( + JsonInt64ReaderWriter.Instance))), + elementMapping: SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfReferenceTypesComparer, long[]>(new ListOfValueTypesComparer(new ValueComparer( + (long v1, long v2) => v1 == v2, + (long v) => ((object)v).GetHashCode(), + (long v) => v))), + keyComparer: new ListOfReferenceTypesComparer, long[]>(new ListOfValueTypesComparer(new ValueComparer( + (long v1, long v2) => v1 == v2, + (long v) => ((object)v).GetHashCode(), + (long v) => v))), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter, long[]>( + new JsonCollectionOfStructsReaderWriter( + JsonInt64ReaderWriter.Instance))), + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter, long[]>( + new JsonCollectionOfStructsReaderWriter( + JsonInt64ReaderWriter.Instance)), + elementMapping: SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfValueTypesComparer(new ValueComparer( + (long v1, long v2) => v1 == v2, + (long v) => ((object)v).GetHashCode(), + (long v) => v)), + keyComparer: new ListOfValueTypesComparer(new ValueComparer( + (long v1, long v2) => v1 == v2, + (long v) => ((object)v).GetHashCode(), + (long v) => v)), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( + JsonInt64ReaderWriter.Instance)), + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( + JsonInt64ReaderWriter.Instance), + elementMapping: LongTypeMapping.Default.Clone( + comparer: new ValueComparer( + (long v1, long v2) => v1 == v2, + (long v) => ((object)v).GetHashCode(), + (long v) => v), + keyComparer: new ValueComparer( + (long v1, long v2) => v1 == v2, + (long v) => ((object)v).GetHashCode(), + (long v) => v), + providerValueComparer: new ValueComparer( + (long v1, long v2) => v1 == v2, + (long v) => ((object)v).GetHashCode(), + (long v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "INTEGER"))))); + int64NestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int64NestedCollection", "TestNamespace") }); + var int8 = runtimeEntityType.AddProperty( "Int8", typeof(sbyte), @@ -5775,12 +6611,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas int8.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int8((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int8((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(int8, 98), + (InternalEntityEntry entry) => entry.ReadOriginalValue(int8, 107), (InternalEntityEntry entry) => entry.GetCurrentValue(int8), - (ValueBuffer valueBuffer) => valueBuffer[98]); + (ValueBuffer valueBuffer) => valueBuffer[107]); int8.SetPropertyIndexes( - index: 98, - originalValueIndex: 98, + index: 107, + originalValueIndex: 107, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); @@ -5818,31 +6654,31 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas int8Array.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int8Array((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int8Array((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(int8Array, 99), + (InternalEntityEntry entry) => entry.ReadOriginalValue(int8Array, 108), (InternalEntityEntry entry) => entry.GetCurrentValue(int8Array), - (ValueBuffer valueBuffer) => valueBuffer[99]); + (ValueBuffer valueBuffer) => valueBuffer[108]); int8Array.SetPropertyIndexes( - index: 99, - originalValueIndex: 99, + index: 108, + originalValueIndex: 108, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); int8Array.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer(new ValueComparer( (sbyte v1, sbyte v2) => v1 == v2, (sbyte v) => (int)v, (sbyte v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer(new ValueComparer( (sbyte v1, sbyte v2) => v1 == v2, (sbyte v) => (int)v, (sbyte v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( JsonSByteReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( JsonSByteReaderWriter.Instance), elementMapping: SByteTypeMapping.Default.Clone( comparer: new ValueComparer( @@ -5861,30 +6697,130 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas storeTypeName: "INTEGER"))); int8Array.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int8Array", "TestNamespace") }); - var intNumberToBytesConverterProperty = runtimeEntityType.AddProperty( - "IntNumberToBytesConverterProperty", - typeof(int), - propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("IntNumberToBytesConverterProperty", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), - fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), - valueConverter: new NumberToBytesConverter()); - intNumberToBytesConverterProperty.SetGetter( - (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_IntNumberToBytesConverterProperty(entity), - (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_IntNumberToBytesConverterProperty(entity) == 0, - (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_IntNumberToBytesConverterProperty(instance), - (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_IntNumberToBytesConverterProperty(instance) == 0); - intNumberToBytesConverterProperty.SetSetter( - (CompiledModelTestBase.ManyTypes entity, int value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_IntNumberToBytesConverterProperty(entity) = value); - intNumberToBytesConverterProperty.SetMaterializationSetter( - (CompiledModelTestBase.ManyTypes entity, int value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_IntNumberToBytesConverterProperty(entity) = value); - intNumberToBytesConverterProperty.SetAccessors( + var int8NestedCollection = runtimeEntityType.AddProperty( + "Int8NestedCollection", + typeof(sbyte[][][]), + propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("Int8NestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + int8NestedCollection.SetGetter( + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int8NestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int8NestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int8NestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int8NestedCollection(instance) == null); + int8NestedCollection.SetSetter( + (CompiledModelTestBase.ManyTypes entity, sbyte[][][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int8NestedCollection(entity) = value); + int8NestedCollection.SetMaterializationSetter( + (CompiledModelTestBase.ManyTypes entity, sbyte[][][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int8NestedCollection(entity) = value); + int8NestedCollection.SetAccessors( + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int8NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int8NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => entry.ReadOriginalValue(int8NestedCollection, 109), + (InternalEntityEntry entry) => entry.GetCurrentValue(int8NestedCollection), + (ValueBuffer valueBuffer) => valueBuffer[109]); + int8NestedCollection.SetPropertyIndexes( + index: 109, + originalValueIndex: 109, + shadowIndex: -1, + relationshipIndex: -1, + storeGenerationIndex: -1); + int8NestedCollection.TypeMapping = SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfReferenceTypesComparer(new ListOfReferenceTypesComparer(new ListOfValueTypesComparer(new ValueComparer( + (sbyte v1, sbyte v2) => v1 == v2, + (sbyte v) => (int)v, + (sbyte v) => v)))), + keyComparer: new ListOfReferenceTypesComparer(new ListOfReferenceTypesComparer(new ListOfValueTypesComparer(new ValueComparer( + (sbyte v1, sbyte v2) => v1 == v2, + (sbyte v) => (int)v, + (sbyte v) => v)))), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfStructsReaderWriter( + JsonSByteReaderWriter.Instance)))), + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfStructsReaderWriter( + JsonSByteReaderWriter.Instance))), + elementMapping: SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfReferenceTypesComparer(new ListOfValueTypesComparer(new ValueComparer( + (sbyte v1, sbyte v2) => v1 == v2, + (sbyte v) => (int)v, + (sbyte v) => v))), + keyComparer: new ListOfReferenceTypesComparer(new ListOfValueTypesComparer(new ValueComparer( + (sbyte v1, sbyte v2) => v1 == v2, + (sbyte v) => (int)v, + (sbyte v) => v))), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfStructsReaderWriter( + JsonSByteReaderWriter.Instance))), + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfStructsReaderWriter( + JsonSByteReaderWriter.Instance)), + elementMapping: SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfValueTypesComparer(new ValueComparer( + (sbyte v1, sbyte v2) => v1 == v2, + (sbyte v) => (int)v, + (sbyte v) => v)), + keyComparer: new ListOfValueTypesComparer(new ValueComparer( + (sbyte v1, sbyte v2) => v1 == v2, + (sbyte v) => (int)v, + (sbyte v) => v)), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( + JsonSByteReaderWriter.Instance)), + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( + JsonSByteReaderWriter.Instance), + elementMapping: SByteTypeMapping.Default.Clone( + comparer: new ValueComparer( + (sbyte v1, sbyte v2) => v1 == v2, + (sbyte v) => (int)v, + (sbyte v) => v), + keyComparer: new ValueComparer( + (sbyte v1, sbyte v2) => v1 == v2, + (sbyte v) => (int)v, + (sbyte v) => v), + providerValueComparer: new ValueComparer( + (sbyte v1, sbyte v2) => v1 == v2, + (sbyte v) => (int)v, + (sbyte v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "INTEGER"))))); + int8NestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int8NestedCollection", "TestNamespace") }); + + var intNumberToBytesConverterProperty = runtimeEntityType.AddProperty( + "IntNumberToBytesConverterProperty", + typeof(int), + propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("IntNumberToBytesConverterProperty", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + valueConverter: new NumberToBytesConverter()); + intNumberToBytesConverterProperty.SetGetter( + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_IntNumberToBytesConverterProperty(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_IntNumberToBytesConverterProperty(entity) == 0, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_IntNumberToBytesConverterProperty(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_IntNumberToBytesConverterProperty(instance) == 0); + intNumberToBytesConverterProperty.SetSetter( + (CompiledModelTestBase.ManyTypes entity, int value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_IntNumberToBytesConverterProperty(entity) = value); + intNumberToBytesConverterProperty.SetMaterializationSetter( + (CompiledModelTestBase.ManyTypes entity, int value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_IntNumberToBytesConverterProperty(entity) = value); + intNumberToBytesConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_IntNumberToBytesConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_IntNumberToBytesConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(intNumberToBytesConverterProperty, 100), + (InternalEntityEntry entry) => entry.ReadOriginalValue(intNumberToBytesConverterProperty, 110), (InternalEntityEntry entry) => entry.GetCurrentValue(intNumberToBytesConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[100]); + (ValueBuffer valueBuffer) => valueBuffer[110]); intNumberToBytesConverterProperty.SetPropertyIndexes( - index: 100, - originalValueIndex: 100, + index: 110, + originalValueIndex: 110, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); @@ -5932,12 +6868,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas intNumberToStringConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_IntNumberToStringConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_IntNumberToStringConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(intNumberToStringConverterProperty, 101), + (InternalEntityEntry entry) => entry.ReadOriginalValue(intNumberToStringConverterProperty, 111), (InternalEntityEntry entry) => entry.GetCurrentValue(intNumberToStringConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[101]); + (ValueBuffer valueBuffer) => valueBuffer[111]); intNumberToStringConverterProperty.SetPropertyIndexes( - index: 101, - originalValueIndex: 101, + index: 111, + originalValueIndex: 111, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); @@ -5952,7 +6888,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (int v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( size: 64), @@ -5986,12 +6922,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullIntToNullStringConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullIntToNullStringConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullIntToNullStringConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullIntToNullStringConverterProperty, 102), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullIntToNullStringConverterProperty, 112), (InternalEntityEntry entry) => entry.GetCurrentValue>(nullIntToNullStringConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[102]); + (ValueBuffer valueBuffer) => valueBuffer[112]); nullIntToNullStringConverterProperty.SetPropertyIndexes( - index: 102, - originalValueIndex: 102, + index: 112, + originalValueIndex: 112, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); @@ -6006,16 +6942,16 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (Nullable v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), converter: new ValueConverter( - (Nullable v) => v == null ? null : v.ToString(), + (Nullable v) => v == null ? null : ((object)v).ToString(), (string v) => v == null || v == "" ? null : (Nullable)int.Parse(v), convertsNulls: true), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (Nullable v) => v == null ? null : v.ToString(), + (Nullable v) => v == null ? null : ((object)v).ToString(), (string v) => v == null || v == "" ? null : (Nullable)int.Parse(v), convertsNulls: true))); nullIntToNullStringConverterProperty.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullIntToNullStringConverterProperty", "TestNamespace") }); @@ -6038,27 +6974,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableBool.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableBool((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableBool((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableBool, 103), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableBool, 113), (InternalEntityEntry entry) => entry.GetCurrentValue>(nullableBool), - (ValueBuffer valueBuffer) => valueBuffer[103]); + (ValueBuffer valueBuffer) => valueBuffer[113]); nullableBool.SetPropertyIndexes( - index: 103, - originalValueIndex: 103, + index: 113, + originalValueIndex: 113, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableBool.TypeMapping = BoolTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (bool)v1 == (bool)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((bool)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(bool)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(bool)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (bool)v1 == (bool)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((bool)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(bool)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(bool)v : default(Nullable)), providerValueComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (bool)v1 == (bool)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((bool)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(bool)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(bool)v : default(Nullable)), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "INTEGER")); @@ -6081,44 +7017,44 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableBoolArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableBoolArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableBoolArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableBoolArray, 104), + (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableBoolArray, 114), (InternalEntityEntry entry) => entry.GetCurrentValue[]>(nullableBoolArray), - (ValueBuffer valueBuffer) => valueBuffer[104]); + (ValueBuffer valueBuffer) => valueBuffer[114]); nullableBoolArray.SetPropertyIndexes( - index: 104, - originalValueIndex: 104, + index: 114, + originalValueIndex: 114, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableBoolArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (bool)v1 == (bool)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((bool)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(bool)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(bool)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (bool)v1 == (bool)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((bool)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(bool)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(bool)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter( JsonBoolReaderWriter.Instance)), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter( JsonBoolReaderWriter.Instance), elementMapping: BoolTypeMapping.Default.Clone( comparer: new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v), keyComparer: new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v), providerValueComparer: new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "INTEGER"))); @@ -6142,19 +7078,19 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableBytes.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableBytes((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableBytes((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(nullableBytes, 105), + (InternalEntityEntry entry) => entry.ReadOriginalValue(nullableBytes, 115), (InternalEntityEntry entry) => entry.GetCurrentValue(nullableBytes), - (ValueBuffer valueBuffer) => valueBuffer[105]); + (ValueBuffer valueBuffer) => valueBuffer[115]); nullableBytes.SetPropertyIndexes( - index: 105, - originalValueIndex: 105, + index: 115, + originalValueIndex: 115, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableBytes.TypeMapping = SqliteByteArrayTypeMapping.Default.Clone( comparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), - (byte[] v) => v.GetHashCode(), + (byte[] v) => ((object)v).GetHashCode(), (byte[] v) => v), keyComparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), @@ -6183,36 +7119,36 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableBytesArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableBytesArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableBytesArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(nullableBytesArray, 106), + (InternalEntityEntry entry) => entry.ReadOriginalValue(nullableBytesArray, 116), (InternalEntityEntry entry) => entry.GetCurrentValue(nullableBytesArray), - (ValueBuffer valueBuffer) => valueBuffer[106]); + (ValueBuffer valueBuffer) => valueBuffer[116]); nullableBytesArray.SetPropertyIndexes( - index: 106, - originalValueIndex: 106, + index: 116, + originalValueIndex: 116, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableBytesArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfReferenceTypesComparer(new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), - (byte[] v) => v.GetHashCode(), + (byte[] v) => ((object)v).GetHashCode(), (byte[] v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), - (byte[] v) => v.GetHashCode(), + (byte[] v) => ((object)v).GetHashCode(), (byte[] v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter( SqliteJsonByteArrayReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( SqliteJsonByteArrayReaderWriter.Instance), elementMapping: SqliteByteArrayTypeMapping.Default.Clone( comparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), - (byte[] v) => v.GetHashCode(), + (byte[] v) => ((object)v).GetHashCode(), (byte[] v) => v), keyComparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), @@ -6224,6 +7160,83 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (byte[] source) => source.ToArray()))); nullableBytesArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableBytesArray", "TestNamespace") }); + var nullableBytesNestedCollection = runtimeEntityType.AddProperty( + "NullableBytesNestedCollection", + typeof(byte[][][]), + propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("NullableBytesNestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + nullableBytesNestedCollection.SetGetter( + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableBytesNestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableBytesNestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableBytesNestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableBytesNestedCollection(instance) == null); + nullableBytesNestedCollection.SetSetter( + (CompiledModelTestBase.ManyTypes entity, byte[][][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableBytesNestedCollection(entity) = value); + nullableBytesNestedCollection.SetMaterializationSetter( + (CompiledModelTestBase.ManyTypes entity, byte[][][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableBytesNestedCollection(entity) = value); + nullableBytesNestedCollection.SetAccessors( + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableBytesNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableBytesNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => entry.ReadOriginalValue(nullableBytesNestedCollection, 117), + (InternalEntityEntry entry) => entry.GetCurrentValue(nullableBytesNestedCollection), + (ValueBuffer valueBuffer) => valueBuffer[117]); + nullableBytesNestedCollection.SetPropertyIndexes( + index: 117, + originalValueIndex: 117, + shadowIndex: -1, + relationshipIndex: -1, + storeGenerationIndex: -1); + nullableBytesNestedCollection.TypeMapping = SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfReferenceTypesComparer(new ListOfReferenceTypesComparer(new ValueComparer( + (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), + (byte[] v) => ((object)v).GetHashCode(), + (byte[] v) => v))), + keyComparer: new ListOfReferenceTypesComparer(new ListOfReferenceTypesComparer(new ValueComparer( + (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), + (byte[] v) => ((object)v).GetHashCode(), + (byte[] v) => v))), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfReferencesReaderWriter( + SqliteJsonByteArrayReaderWriter.Instance))), + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfReferencesReaderWriter( + SqliteJsonByteArrayReaderWriter.Instance)), + elementMapping: SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfReferenceTypesComparer(new ValueComparer( + (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), + (byte[] v) => ((object)v).GetHashCode(), + (byte[] v) => v)), + keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( + (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), + (byte[] v) => ((object)v).GetHashCode(), + (byte[] v) => v)), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter( + SqliteJsonByteArrayReaderWriter.Instance)), + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( + SqliteJsonByteArrayReaderWriter.Instance), + elementMapping: SqliteByteArrayTypeMapping.Default.Clone( + comparer: new ValueComparer( + (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), + (byte[] v) => ((object)v).GetHashCode(), + (byte[] v) => v), + keyComparer: new ValueComparer( + (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), + (byte[] v) => StructuralComparisons.StructuralEqualityComparer.GetHashCode((object)v), + (byte[] source) => source.ToArray()), + providerValueComparer: new ValueComparer( + (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), + (byte[] v) => StructuralComparisons.StructuralEqualityComparer.GetHashCode((object)v), + (byte[] source) => source.ToArray())))); + nullableBytesNestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableBytesNestedCollection", "TestNamespace") }); + var nullableChar = runtimeEntityType.AddProperty( "NullableChar", typeof(char?), @@ -6242,12 +7255,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableChar.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableChar((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableChar((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableChar, 107), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableChar, 118), (InternalEntityEntry entry) => entry.GetCurrentValue>(nullableChar), - (ValueBuffer valueBuffer) => valueBuffer[107]); + (ValueBuffer valueBuffer) => valueBuffer[118]); nullableChar.SetPropertyIndexes( - index: 107, - originalValueIndex: 107, + index: 118, + originalValueIndex: 118, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); @@ -6285,31 +7298,31 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableCharArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableCharArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableCharArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableCharArray, 108), + (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableCharArray, 119), (InternalEntityEntry entry) => entry.GetCurrentValue[]>(nullableCharArray), - (ValueBuffer valueBuffer) => valueBuffer[108]); + (ValueBuffer valueBuffer) => valueBuffer[119]); nullableCharArray.SetPropertyIndexes( - index: 108, - originalValueIndex: 108, + index: 119, + originalValueIndex: 119, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableCharArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (char)v1 == (char)v2 || !v1.HasValue && !v2.HasValue, (Nullable v) => v.HasValue ? (int)(char)v : 0, (Nullable v) => v.HasValue ? (Nullable)(char)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (char)v1 == (char)v2 || !v1.HasValue && !v2.HasValue, (Nullable v) => v.HasValue ? (int)(char)v : 0, (Nullable v) => v.HasValue ? (Nullable)(char)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter( JsonCharReaderWriter.Instance)), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter( JsonCharReaderWriter.Instance), elementMapping: CharTypeMapping.Default.Clone( comparer: new ValueComparer( @@ -6346,12 +7359,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableDateOnly.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableDateOnly((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableDateOnly((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableDateOnly, 109), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableDateOnly, 120), (InternalEntityEntry entry) => entry.GetCurrentValue>(nullableDateOnly), - (ValueBuffer valueBuffer) => valueBuffer[109]); + (ValueBuffer valueBuffer) => valueBuffer[120]); nullableDateOnly.SetPropertyIndexes( - index: 109, - originalValueIndex: 109, + index: 120, + originalValueIndex: 120, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); @@ -6375,31 +7388,31 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableDateOnlyArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableDateOnlyArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableDateOnlyArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableDateOnlyArray, 110), + (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableDateOnlyArray, 121), (InternalEntityEntry entry) => entry.GetCurrentValue[]>(nullableDateOnlyArray), - (ValueBuffer valueBuffer) => valueBuffer[110]); + (ValueBuffer valueBuffer) => valueBuffer[121]); nullableDateOnlyArray.SetPropertyIndexes( - index: 110, - originalValueIndex: 110, + index: 121, + originalValueIndex: 121, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableDateOnlyArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateOnly)v1 == (DateOnly)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((DateOnly)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(DateOnly)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(DateOnly)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateOnly)v1 == (DateOnly)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((DateOnly)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(DateOnly)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(DateOnly)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter( JsonDateOnlyReaderWriter.Instance)), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter( JsonDateOnlyReaderWriter.Instance), elementMapping: SqliteDateOnlyTypeMapping.Default); nullableDateOnlyArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableDateOnlyArray", "TestNamespace") }); @@ -6422,12 +7435,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableDateTime.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableDateTime((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableDateTime((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableDateTime, 111), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableDateTime, 122), (InternalEntityEntry entry) => entry.GetCurrentValue>(nullableDateTime), - (ValueBuffer valueBuffer) => valueBuffer[111]); + (ValueBuffer valueBuffer) => valueBuffer[122]); nullableDateTime.SetPropertyIndexes( - index: 111, - originalValueIndex: 111, + index: 122, + originalValueIndex: 122, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); @@ -6451,31 +7464,31 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableDateTimeArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableDateTimeArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableDateTimeArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableDateTimeArray, 112), + (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableDateTimeArray, 123), (InternalEntityEntry entry) => entry.GetCurrentValue[]>(nullableDateTimeArray), - (ValueBuffer valueBuffer) => valueBuffer[112]); + (ValueBuffer valueBuffer) => valueBuffer[123]); nullableDateTimeArray.SetPropertyIndexes( - index: 112, - originalValueIndex: 112, + index: 123, + originalValueIndex: 123, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableDateTimeArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(DateTime)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(DateTime)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter( SqliteJsonDateTimeReaderWriter.Instance)), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter( SqliteJsonDateTimeReaderWriter.Instance), elementMapping: SqliteDateTimeTypeMapping.Default); nullableDateTimeArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableDateTimeArray", "TestNamespace") }); @@ -6498,12 +7511,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableDecimal.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableDecimal((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableDecimal((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableDecimal, 113), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableDecimal, 124), (InternalEntityEntry entry) => entry.GetCurrentValue>(nullableDecimal), - (ValueBuffer valueBuffer) => valueBuffer[113]); + (ValueBuffer valueBuffer) => valueBuffer[124]); nullableDecimal.SetPropertyIndexes( - index: 113, - originalValueIndex: 113, + index: 124, + originalValueIndex: 124, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); @@ -6527,31 +7540,31 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableDecimalArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableDecimalArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableDecimalArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableDecimalArray, 114), + (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableDecimalArray, 125), (InternalEntityEntry entry) => entry.GetCurrentValue[]>(nullableDecimalArray), - (ValueBuffer valueBuffer) => valueBuffer[114]); + (ValueBuffer valueBuffer) => valueBuffer[125]); nullableDecimalArray.SetPropertyIndexes( - index: 114, - originalValueIndex: 114, + index: 125, + originalValueIndex: 125, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableDecimalArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(decimal)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(decimal)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter( SqliteJsonDecimalReaderWriter.Instance)), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter( SqliteJsonDecimalReaderWriter.Instance), elementMapping: SqliteDecimalTypeMapping.Default); nullableDecimalArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableDecimalArray", "TestNamespace") }); @@ -6574,27 +7587,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableDouble.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableDouble((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableDouble((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableDouble, 115), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableDouble, 126), (InternalEntityEntry entry) => entry.GetCurrentValue>(nullableDouble), - (ValueBuffer valueBuffer) => valueBuffer[115]); + (ValueBuffer valueBuffer) => valueBuffer[126]); nullableDouble.SetPropertyIndexes( - index: 115, - originalValueIndex: 115, + index: 126, + originalValueIndex: 126, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableDouble.TypeMapping = DoubleTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && ((double)v1).Equals((double)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((double)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(double)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(double)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && ((double)v1).Equals((double)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((double)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(double)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(double)v : default(Nullable)), providerValueComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && ((double)v1).Equals((double)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((double)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(double)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(double)v : default(Nullable)), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "REAL")); @@ -6617,44 +7630,44 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableDoubleArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableDoubleArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableDoubleArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableDoubleArray, 116), + (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableDoubleArray, 127), (InternalEntityEntry entry) => entry.GetCurrentValue[]>(nullableDoubleArray), - (ValueBuffer valueBuffer) => valueBuffer[116]); + (ValueBuffer valueBuffer) => valueBuffer[127]); nullableDoubleArray.SetPropertyIndexes( - index: 116, - originalValueIndex: 116, + index: 127, + originalValueIndex: 127, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableDoubleArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && ((double)v1).Equals((double)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((double)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(double)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(double)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && ((double)v1).Equals((double)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((double)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(double)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(double)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter( JsonDoubleReaderWriter.Instance)), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter( JsonDoubleReaderWriter.Instance), elementMapping: DoubleTypeMapping.Default.Clone( comparer: new ValueComparer( (double v1, double v2) => v1.Equals(v2), - (double v) => v.GetHashCode(), + (double v) => ((object)v).GetHashCode(), (double v) => v), keyComparer: new ValueComparer( (double v1, double v2) => v1.Equals(v2), - (double v) => v.GetHashCode(), + (double v) => ((object)v).GetHashCode(), (double v) => v), providerValueComparer: new ValueComparer( (double v1, double v2) => v1.Equals(v2), - (double v) => v.GetHashCode(), + (double v) => ((object)v).GetHashCode(), (double v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "REAL"))); @@ -6678,23 +7691,23 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum16.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum16((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum16((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableEnum16, 117), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableEnum16, 128), (InternalEntityEntry entry) => entry.GetCurrentValue>(nullableEnum16), - (ValueBuffer valueBuffer) => valueBuffer[117]); + (ValueBuffer valueBuffer) => valueBuffer[128]); nullableEnum16.SetPropertyIndexes( - index: 117, - originalValueIndex: 117, + index: 128, + originalValueIndex: 128, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnum16.TypeMapping = ShortTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum16)v1, (object)(CompiledModelTestBase.Enum16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum16)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum16)v1, (object)(CompiledModelTestBase.Enum16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum16)v : default(Nullable)), providerValueComparer: new ValueComparer( (short v1, short v2) => v1 == v2, @@ -6729,35 +7742,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum16Array.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum16Array((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum16Array((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableEnum16Array, 118), + (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableEnum16Array, 129), (InternalEntityEntry entry) => entry.GetCurrentValue[]>(nullableEnum16Array), - (ValueBuffer valueBuffer) => valueBuffer[118]); + (ValueBuffer valueBuffer) => valueBuffer[129]); nullableEnum16Array.SetPropertyIndexes( - index: 118, - originalValueIndex: 118, + index: 129, + originalValueIndex: 129, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnum16Array.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum16)v1, (object)(CompiledModelTestBase.Enum16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum16)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum16)v1, (object)(CompiledModelTestBase.Enum16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum16)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonInt16ReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.Enum16 value) => (short)value, (short value) => (CompiledModelTestBase.Enum16)value)))), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonInt16ReaderWriter.Instance, new ValueConverter( @@ -6766,11 +7779,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: ShortTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v), providerValueComparer: new ValueComparer( (short v1, short v2) => v1 == v2, @@ -6806,23 +7819,23 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum16AsString.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum16AsString((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum16AsString((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableEnum16AsString, 119), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableEnum16AsString, 130), (InternalEntityEntry entry) => entry.GetCurrentValue>(nullableEnum16AsString), - (ValueBuffer valueBuffer) => valueBuffer[119]); + (ValueBuffer valueBuffer) => valueBuffer[130]); nullableEnum16AsString.SetPropertyIndexes( - index: 119, - originalValueIndex: 119, + index: 130, + originalValueIndex: 130, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnum16AsString.TypeMapping = ShortTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum16)v1, (object)(CompiledModelTestBase.Enum16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum16)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum16)v1, (object)(CompiledModelTestBase.Enum16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum16)v : default(Nullable)), providerValueComparer: new ValueComparer( (short v1, short v2) => v1 == v2, @@ -6857,35 +7870,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum16AsStringArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum16AsStringArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum16AsStringArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableEnum16AsStringArray, 120), + (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableEnum16AsStringArray, 131), (InternalEntityEntry entry) => entry.GetCurrentValue[]>(nullableEnum16AsStringArray), - (ValueBuffer valueBuffer) => valueBuffer[120]); + (ValueBuffer valueBuffer) => valueBuffer[131]); nullableEnum16AsStringArray.SetPropertyIndexes( - index: 120, - originalValueIndex: 120, + index: 131, + originalValueIndex: 131, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnum16AsStringArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum16)v1, (object)(CompiledModelTestBase.Enum16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum16)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum16)v1, (object)(CompiledModelTestBase.Enum16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum16)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonInt16ReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.Enum16 value) => (short)value, (short value) => (CompiledModelTestBase.Enum16)value)))), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonInt16ReaderWriter.Instance, new ValueConverter( @@ -6894,11 +7907,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: ShortTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v), providerValueComparer: new ValueComparer( (short v1, short v2) => v1 == v2, @@ -6933,35 +7946,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum16AsStringCollection.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum16AsStringCollection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum16AsStringCollection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>>(nullableEnum16AsStringCollection, 121), + (InternalEntityEntry entry) => entry.ReadOriginalValue>>(nullableEnum16AsStringCollection, 132), (InternalEntityEntry entry) => entry.GetCurrentValue>>(nullableEnum16AsStringCollection), - (ValueBuffer valueBuffer) => valueBuffer[121]); + (ValueBuffer valueBuffer) => valueBuffer[132]); nullableEnum16AsStringCollection.SetPropertyIndexes( - index: 121, - originalValueIndex: 121, + index: 132, + originalValueIndex: 132, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnum16AsStringCollection.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.Enum16>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum16)v1, (object)(CompiledModelTestBase.Enum16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum16)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.Enum16>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum16)v1, (object)(CompiledModelTestBase.Enum16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum16)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter, List, CompiledModelTestBase.Enum16>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter, CompiledModelTestBase.Enum16>( new JsonConvertedValueReaderWriter( JsonInt16ReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.Enum16 value) => (short)value, (short value) => (CompiledModelTestBase.Enum16)value)))), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter, List, CompiledModelTestBase.Enum16>( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter, CompiledModelTestBase.Enum16>( new JsonConvertedValueReaderWriter( JsonInt16ReaderWriter.Instance, new ValueConverter( @@ -6970,11 +7983,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: ShortTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v), providerValueComparer: new ValueComparer( (short v1, short v2) => v1 == v2, @@ -7009,35 +8022,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum16Collection.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum16Collection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum16Collection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>>(nullableEnum16Collection, 122), + (InternalEntityEntry entry) => entry.ReadOriginalValue>>(nullableEnum16Collection, 133), (InternalEntityEntry entry) => entry.GetCurrentValue>>(nullableEnum16Collection), - (ValueBuffer valueBuffer) => valueBuffer[122]); + (ValueBuffer valueBuffer) => valueBuffer[133]); nullableEnum16Collection.SetPropertyIndexes( - index: 122, - originalValueIndex: 122, + index: 133, + originalValueIndex: 133, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnum16Collection.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.Enum16>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum16)v1, (object)(CompiledModelTestBase.Enum16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum16)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.Enum16>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum16)v1, (object)(CompiledModelTestBase.Enum16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum16)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter, List, CompiledModelTestBase.Enum16>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter, CompiledModelTestBase.Enum16>( new JsonConvertedValueReaderWriter( JsonInt16ReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.Enum16 value) => (short)value, (short value) => (CompiledModelTestBase.Enum16)value)))), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter, List, CompiledModelTestBase.Enum16>( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter, CompiledModelTestBase.Enum16>( new JsonConvertedValueReaderWriter( JsonInt16ReaderWriter.Instance, new ValueConverter( @@ -7046,11 +8059,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: ShortTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v), providerValueComparer: new ValueComparer( (short v1, short v2) => v1 == v2, @@ -7086,23 +8099,23 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum32.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum32((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum32((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableEnum32, 123), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableEnum32, 134), (InternalEntityEntry entry) => entry.GetCurrentValue>(nullableEnum32), - (ValueBuffer valueBuffer) => valueBuffer[123]); + (ValueBuffer valueBuffer) => valueBuffer[134]); nullableEnum32.SetPropertyIndexes( - index: 123, - originalValueIndex: 123, + index: 134, + originalValueIndex: 134, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnum32.TypeMapping = IntTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum32)v1, (object)(CompiledModelTestBase.Enum32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum32)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum32)v1, (object)(CompiledModelTestBase.Enum32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum32)v : default(Nullable)), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -7137,35 +8150,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum32Array.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum32Array((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum32Array((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableEnum32Array, 124), + (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableEnum32Array, 135), (InternalEntityEntry entry) => entry.GetCurrentValue[]>(nullableEnum32Array), - (ValueBuffer valueBuffer) => valueBuffer[124]); + (ValueBuffer valueBuffer) => valueBuffer[135]); nullableEnum32Array.SetPropertyIndexes( - index: 124, - originalValueIndex: 124, + index: 135, + originalValueIndex: 135, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnum32Array.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum32)v1, (object)(CompiledModelTestBase.Enum32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum32)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum32)v1, (object)(CompiledModelTestBase.Enum32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum32)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonInt32ReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.Enum32 value) => (int)value, (int value) => (CompiledModelTestBase.Enum32)value)))), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonInt32ReaderWriter.Instance, new ValueConverter( @@ -7174,11 +8187,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: IntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -7214,23 +8227,23 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum32AsString.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum32AsString((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum32AsString((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableEnum32AsString, 125), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableEnum32AsString, 136), (InternalEntityEntry entry) => entry.GetCurrentValue>(nullableEnum32AsString), - (ValueBuffer valueBuffer) => valueBuffer[125]); + (ValueBuffer valueBuffer) => valueBuffer[136]); nullableEnum32AsString.SetPropertyIndexes( - index: 125, - originalValueIndex: 125, + index: 136, + originalValueIndex: 136, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnum32AsString.TypeMapping = IntTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum32)v1, (object)(CompiledModelTestBase.Enum32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum32)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum32)v1, (object)(CompiledModelTestBase.Enum32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum32)v : default(Nullable)), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -7265,35 +8278,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum32AsStringArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum32AsStringArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum32AsStringArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableEnum32AsStringArray, 126), + (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableEnum32AsStringArray, 137), (InternalEntityEntry entry) => entry.GetCurrentValue[]>(nullableEnum32AsStringArray), - (ValueBuffer valueBuffer) => valueBuffer[126]); + (ValueBuffer valueBuffer) => valueBuffer[137]); nullableEnum32AsStringArray.SetPropertyIndexes( - index: 126, - originalValueIndex: 126, + index: 137, + originalValueIndex: 137, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnum32AsStringArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum32)v1, (object)(CompiledModelTestBase.Enum32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum32)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum32)v1, (object)(CompiledModelTestBase.Enum32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum32)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonInt32ReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.Enum32 value) => (int)value, (int value) => (CompiledModelTestBase.Enum32)value)))), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonInt32ReaderWriter.Instance, new ValueConverter( @@ -7302,11 +8315,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: IntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -7341,35 +8354,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum32AsStringCollection.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum32AsStringCollection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum32AsStringCollection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>>(nullableEnum32AsStringCollection, 127), + (InternalEntityEntry entry) => entry.ReadOriginalValue>>(nullableEnum32AsStringCollection, 138), (InternalEntityEntry entry) => entry.GetCurrentValue>>(nullableEnum32AsStringCollection), - (ValueBuffer valueBuffer) => valueBuffer[127]); + (ValueBuffer valueBuffer) => valueBuffer[138]); nullableEnum32AsStringCollection.SetPropertyIndexes( - index: 127, - originalValueIndex: 127, + index: 138, + originalValueIndex: 138, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnum32AsStringCollection.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.Enum32>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum32)v1, (object)(CompiledModelTestBase.Enum32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum32)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.Enum32>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum32)v1, (object)(CompiledModelTestBase.Enum32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum32)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter, List, CompiledModelTestBase.Enum32>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter, CompiledModelTestBase.Enum32>( new JsonConvertedValueReaderWriter( JsonInt32ReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.Enum32 value) => (int)value, (int value) => (CompiledModelTestBase.Enum32)value)))), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter, List, CompiledModelTestBase.Enum32>( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter, CompiledModelTestBase.Enum32>( new JsonConvertedValueReaderWriter( JsonInt32ReaderWriter.Instance, new ValueConverter( @@ -7378,11 +8391,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: IntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -7417,35 +8430,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum32Collection.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum32Collection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum32Collection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>>(nullableEnum32Collection, 128), + (InternalEntityEntry entry) => entry.ReadOriginalValue>>(nullableEnum32Collection, 139), (InternalEntityEntry entry) => entry.GetCurrentValue>>(nullableEnum32Collection), - (ValueBuffer valueBuffer) => valueBuffer[128]); + (ValueBuffer valueBuffer) => valueBuffer[139]); nullableEnum32Collection.SetPropertyIndexes( - index: 128, - originalValueIndex: 128, + index: 139, + originalValueIndex: 139, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnum32Collection.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.Enum32>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum32)v1, (object)(CompiledModelTestBase.Enum32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum32)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.Enum32>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum32)v1, (object)(CompiledModelTestBase.Enum32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum32)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter, List, CompiledModelTestBase.Enum32>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter, CompiledModelTestBase.Enum32>( new JsonConvertedValueReaderWriter( JsonInt32ReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.Enum32 value) => (int)value, (int value) => (CompiledModelTestBase.Enum32)value)))), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter, List, CompiledModelTestBase.Enum32>( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter, CompiledModelTestBase.Enum32>( new JsonConvertedValueReaderWriter( JsonInt32ReaderWriter.Instance, new ValueConverter( @@ -7454,11 +8467,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: IntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -7476,6 +8489,138 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (int value) => (CompiledModelTestBase.Enum32)value)))); nullableEnum32Collection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum32Collection", "TestNamespace") }); + var nullableEnum32NestedCollection = runtimeEntityType.AddProperty( + "NullableEnum32NestedCollection", + typeof(CompiledModelTestBase.Enum32?[][][]), + propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("NullableEnum32NestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + nullableEnum32NestedCollection.SetGetter( + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum32NestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum32NestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum32NestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum32NestedCollection(instance) == null); + nullableEnum32NestedCollection.SetSetter( + (CompiledModelTestBase.ManyTypes entity, Nullable[][][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum32NestedCollection(entity) = value); + nullableEnum32NestedCollection.SetMaterializationSetter( + (CompiledModelTestBase.ManyTypes entity, Nullable[][][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum32NestedCollection(entity) = value); + nullableEnum32NestedCollection.SetAccessors( + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum32NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum32NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => entry.ReadOriginalValue[][][]>(nullableEnum32NestedCollection, 140), + (InternalEntityEntry entry) => entry.GetCurrentValue[][][]>(nullableEnum32NestedCollection), + (ValueBuffer valueBuffer) => valueBuffer[140]); + nullableEnum32NestedCollection.SetPropertyIndexes( + index: 140, + originalValueIndex: 140, + shadowIndex: -1, + relationshipIndex: -1, + storeGenerationIndex: -1); + nullableEnum32NestedCollection.TypeMapping = SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfReferenceTypesComparer(new ListOfReferenceTypesComparer(new ListOfNullableValueTypesComparer(new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum32)v1, (object)(CompiledModelTestBase.Enum32)v2) || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum32)v : default(Nullable))))), + keyComparer: new ListOfReferenceTypesComparer(new ListOfReferenceTypesComparer(new ListOfNullableValueTypesComparer(new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum32)v1, (object)(CompiledModelTestBase.Enum32)v2) || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum32)v : default(Nullable))))), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfNullableStructsReaderWriter( + new JsonConvertedValueReaderWriter( + JsonInt32ReaderWriter.Instance, + new ValueConverter( + (CompiledModelTestBase.Enum32 value) => (int)value, + (int value) => (CompiledModelTestBase.Enum32)value)))))), + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfNullableStructsReaderWriter( + new JsonConvertedValueReaderWriter( + JsonInt32ReaderWriter.Instance, + new ValueConverter( + (CompiledModelTestBase.Enum32 value) => (int)value, + (int value) => (CompiledModelTestBase.Enum32)value))))), + elementMapping: SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfReferenceTypesComparer(new ListOfNullableValueTypesComparer(new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum32)v1, (object)(CompiledModelTestBase.Enum32)v2) || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum32)v : default(Nullable)))), + keyComparer: new ListOfReferenceTypesComparer(new ListOfNullableValueTypesComparer(new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum32)v1, (object)(CompiledModelTestBase.Enum32)v2) || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum32)v : default(Nullable)))), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfNullableStructsReaderWriter( + new JsonConvertedValueReaderWriter( + JsonInt32ReaderWriter.Instance, + new ValueConverter( + (CompiledModelTestBase.Enum32 value) => (int)value, + (int value) => (CompiledModelTestBase.Enum32)value))))), + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfNullableStructsReaderWriter( + new JsonConvertedValueReaderWriter( + JsonInt32ReaderWriter.Instance, + new ValueConverter( + (CompiledModelTestBase.Enum32 value) => (int)value, + (int value) => (CompiledModelTestBase.Enum32)value)))), + elementMapping: SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfNullableValueTypesComparer(new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum32)v1, (object)(CompiledModelTestBase.Enum32)v2) || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum32)v : default(Nullable))), + keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum32)v1, (object)(CompiledModelTestBase.Enum32)v2) || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum32)v : default(Nullable))), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter( + new JsonConvertedValueReaderWriter( + JsonInt32ReaderWriter.Instance, + new ValueConverter( + (CompiledModelTestBase.Enum32 value) => (int)value, + (int value) => (CompiledModelTestBase.Enum32)value)))), + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter( + new JsonConvertedValueReaderWriter( + JsonInt32ReaderWriter.Instance, + new ValueConverter( + (CompiledModelTestBase.Enum32 value) => (int)value, + (int value) => (CompiledModelTestBase.Enum32)value))), + elementMapping: IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), + (CompiledModelTestBase.Enum32 v) => v), + keyComparer: new ValueComparer( + (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), + (CompiledModelTestBase.Enum32 v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "INTEGER"), + converter: new ValueConverter( + (CompiledModelTestBase.Enum32 value) => (int)value, + (int value) => (CompiledModelTestBase.Enum32)value), + jsonValueReaderWriter: new JsonConvertedValueReaderWriter( + JsonInt32ReaderWriter.Instance, + new ValueConverter( + (CompiledModelTestBase.Enum32 value) => (int)value, + (int value) => (CompiledModelTestBase.Enum32)value)))))); + nullableEnum32NestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum32NestedCollection", "TestNamespace") }); + var nullableEnum64 = runtimeEntityType.AddProperty( "NullableEnum64", typeof(CompiledModelTestBase.Enum64?), @@ -7494,27 +8639,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum64.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum64((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum64((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableEnum64, 129), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableEnum64, 141), (InternalEntityEntry entry) => entry.GetCurrentValue>(nullableEnum64), - (ValueBuffer valueBuffer) => valueBuffer[129]); + (ValueBuffer valueBuffer) => valueBuffer[141]); nullableEnum64.SetPropertyIndexes( - index: 129, - originalValueIndex: 129, + index: 141, + originalValueIndex: 141, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnum64.TypeMapping = LongTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum64)v1, (object)(CompiledModelTestBase.Enum64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum64)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum64)v1, (object)(CompiledModelTestBase.Enum64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum64)v : default(Nullable)), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "INTEGER"), @@ -7545,35 +8690,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum64Array.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum64Array((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum64Array((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableEnum64Array, 130), + (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableEnum64Array, 142), (InternalEntityEntry entry) => entry.GetCurrentValue[]>(nullableEnum64Array), - (ValueBuffer valueBuffer) => valueBuffer[130]); + (ValueBuffer valueBuffer) => valueBuffer[142]); nullableEnum64Array.SetPropertyIndexes( - index: 130, - originalValueIndex: 130, + index: 142, + originalValueIndex: 142, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnum64Array.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum64)v1, (object)(CompiledModelTestBase.Enum64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum64)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum64)v1, (object)(CompiledModelTestBase.Enum64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum64)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonInt64ReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.Enum64 value) => (long)value, (long value) => (CompiledModelTestBase.Enum64)value)))), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonInt64ReaderWriter.Instance, new ValueConverter( @@ -7582,15 +8727,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: LongTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "INTEGER"), @@ -7622,27 +8767,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum64AsString.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum64AsString((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum64AsString((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableEnum64AsString, 131), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableEnum64AsString, 143), (InternalEntityEntry entry) => entry.GetCurrentValue>(nullableEnum64AsString), - (ValueBuffer valueBuffer) => valueBuffer[131]); + (ValueBuffer valueBuffer) => valueBuffer[143]); nullableEnum64AsString.SetPropertyIndexes( - index: 131, - originalValueIndex: 131, + index: 143, + originalValueIndex: 143, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnum64AsString.TypeMapping = LongTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum64)v1, (object)(CompiledModelTestBase.Enum64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum64)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum64)v1, (object)(CompiledModelTestBase.Enum64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum64)v : default(Nullable)), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "INTEGER"), @@ -7673,35 +8818,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum64AsStringArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum64AsStringArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum64AsStringArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableEnum64AsStringArray, 132), + (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableEnum64AsStringArray, 144), (InternalEntityEntry entry) => entry.GetCurrentValue[]>(nullableEnum64AsStringArray), - (ValueBuffer valueBuffer) => valueBuffer[132]); + (ValueBuffer valueBuffer) => valueBuffer[144]); nullableEnum64AsStringArray.SetPropertyIndexes( - index: 132, - originalValueIndex: 132, + index: 144, + originalValueIndex: 144, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnum64AsStringArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum64)v1, (object)(CompiledModelTestBase.Enum64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum64)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum64)v1, (object)(CompiledModelTestBase.Enum64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum64)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonInt64ReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.Enum64 value) => (long)value, (long value) => (CompiledModelTestBase.Enum64)value)))), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonInt64ReaderWriter.Instance, new ValueConverter( @@ -7710,15 +8855,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: LongTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "INTEGER"), @@ -7749,35 +8894,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum64AsStringCollection.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum64AsStringCollection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum64AsStringCollection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>>(nullableEnum64AsStringCollection, 133), + (InternalEntityEntry entry) => entry.ReadOriginalValue>>(nullableEnum64AsStringCollection, 145), (InternalEntityEntry entry) => entry.GetCurrentValue>>(nullableEnum64AsStringCollection), - (ValueBuffer valueBuffer) => valueBuffer[133]); + (ValueBuffer valueBuffer) => valueBuffer[145]); nullableEnum64AsStringCollection.SetPropertyIndexes( - index: 133, - originalValueIndex: 133, + index: 145, + originalValueIndex: 145, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnum64AsStringCollection.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.Enum64>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum64)v1, (object)(CompiledModelTestBase.Enum64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum64)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.Enum64>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum64)v1, (object)(CompiledModelTestBase.Enum64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum64)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter, List, CompiledModelTestBase.Enum64>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter, CompiledModelTestBase.Enum64>( new JsonConvertedValueReaderWriter( JsonInt64ReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.Enum64 value) => (long)value, (long value) => (CompiledModelTestBase.Enum64)value)))), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter, List, CompiledModelTestBase.Enum64>( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter, CompiledModelTestBase.Enum64>( new JsonConvertedValueReaderWriter( JsonInt64ReaderWriter.Instance, new ValueConverter( @@ -7786,15 +8931,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: LongTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "INTEGER"), @@ -7825,35 +8970,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum64Collection.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum64Collection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum64Collection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>>(nullableEnum64Collection, 134), + (InternalEntityEntry entry) => entry.ReadOriginalValue>>(nullableEnum64Collection, 146), (InternalEntityEntry entry) => entry.GetCurrentValue>>(nullableEnum64Collection), - (ValueBuffer valueBuffer) => valueBuffer[134]); + (ValueBuffer valueBuffer) => valueBuffer[146]); nullableEnum64Collection.SetPropertyIndexes( - index: 134, - originalValueIndex: 134, + index: 146, + originalValueIndex: 146, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnum64Collection.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.Enum64>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum64)v1, (object)(CompiledModelTestBase.Enum64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum64)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.Enum64>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum64)v1, (object)(CompiledModelTestBase.Enum64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum64)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter, List, CompiledModelTestBase.Enum64>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter, CompiledModelTestBase.Enum64>( new JsonConvertedValueReaderWriter( JsonInt64ReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.Enum64 value) => (long)value, (long value) => (CompiledModelTestBase.Enum64)value)))), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter, List, CompiledModelTestBase.Enum64>( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter, CompiledModelTestBase.Enum64>( new JsonConvertedValueReaderWriter( JsonInt64ReaderWriter.Instance, new ValueConverter( @@ -7862,15 +9007,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: LongTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "INTEGER"), @@ -7902,23 +9047,23 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum8.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum8((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum8((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableEnum8, 135), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableEnum8, 147), (InternalEntityEntry entry) => entry.GetCurrentValue>(nullableEnum8), - (ValueBuffer valueBuffer) => valueBuffer[135]); + (ValueBuffer valueBuffer) => valueBuffer[147]); nullableEnum8.SetPropertyIndexes( - index: 135, - originalValueIndex: 135, + index: 147, + originalValueIndex: 147, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnum8.TypeMapping = SByteTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum8)v1, (object)(CompiledModelTestBase.Enum8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum8)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum8)v1, (object)(CompiledModelTestBase.Enum8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum8)v : default(Nullable)), providerValueComparer: new ValueComparer( (sbyte v1, sbyte v2) => v1 == v2, @@ -7953,35 +9098,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum8Array.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum8Array((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum8Array((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableEnum8Array, 136), + (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableEnum8Array, 148), (InternalEntityEntry entry) => entry.GetCurrentValue[]>(nullableEnum8Array), - (ValueBuffer valueBuffer) => valueBuffer[136]); + (ValueBuffer valueBuffer) => valueBuffer[148]); nullableEnum8Array.SetPropertyIndexes( - index: 136, - originalValueIndex: 136, + index: 148, + originalValueIndex: 148, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnum8Array.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum8)v1, (object)(CompiledModelTestBase.Enum8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum8)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum8)v1, (object)(CompiledModelTestBase.Enum8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum8)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonSByteReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.Enum8 value) => (sbyte)value, (sbyte value) => (CompiledModelTestBase.Enum8)value)))), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonSByteReaderWriter.Instance, new ValueConverter( @@ -7990,11 +9135,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SByteTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), providerValueComparer: new ValueComparer( (sbyte v1, sbyte v2) => v1 == v2, @@ -8030,23 +9175,23 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum8AsString.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum8AsString((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum8AsString((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableEnum8AsString, 137), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableEnum8AsString, 149), (InternalEntityEntry entry) => entry.GetCurrentValue>(nullableEnum8AsString), - (ValueBuffer valueBuffer) => valueBuffer[137]); + (ValueBuffer valueBuffer) => valueBuffer[149]); nullableEnum8AsString.SetPropertyIndexes( - index: 137, - originalValueIndex: 137, + index: 149, + originalValueIndex: 149, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnum8AsString.TypeMapping = SByteTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum8)v1, (object)(CompiledModelTestBase.Enum8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum8)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum8)v1, (object)(CompiledModelTestBase.Enum8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum8)v : default(Nullable)), providerValueComparer: new ValueComparer( (sbyte v1, sbyte v2) => v1 == v2, @@ -8081,35 +9226,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum8AsStringArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum8AsStringArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum8AsStringArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableEnum8AsStringArray, 138), + (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableEnum8AsStringArray, 150), (InternalEntityEntry entry) => entry.GetCurrentValue[]>(nullableEnum8AsStringArray), - (ValueBuffer valueBuffer) => valueBuffer[138]); + (ValueBuffer valueBuffer) => valueBuffer[150]); nullableEnum8AsStringArray.SetPropertyIndexes( - index: 138, - originalValueIndex: 138, + index: 150, + originalValueIndex: 150, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnum8AsStringArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum8)v1, (object)(CompiledModelTestBase.Enum8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum8)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum8)v1, (object)(CompiledModelTestBase.Enum8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum8)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonSByteReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.Enum8 value) => (sbyte)value, (sbyte value) => (CompiledModelTestBase.Enum8)value)))), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonSByteReaderWriter.Instance, new ValueConverter( @@ -8118,11 +9263,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SByteTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), providerValueComparer: new ValueComparer( (sbyte v1, sbyte v2) => v1 == v2, @@ -8157,35 +9302,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum8AsStringCollection.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum8AsStringCollection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum8AsStringCollection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>>(nullableEnum8AsStringCollection, 139), + (InternalEntityEntry entry) => entry.ReadOriginalValue>>(nullableEnum8AsStringCollection, 151), (InternalEntityEntry entry) => entry.GetCurrentValue>>(nullableEnum8AsStringCollection), - (ValueBuffer valueBuffer) => valueBuffer[139]); + (ValueBuffer valueBuffer) => valueBuffer[151]); nullableEnum8AsStringCollection.SetPropertyIndexes( - index: 139, - originalValueIndex: 139, + index: 151, + originalValueIndex: 151, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnum8AsStringCollection.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.Enum8>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum8)v1, (object)(CompiledModelTestBase.Enum8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum8)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.Enum8>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum8)v1, (object)(CompiledModelTestBase.Enum8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum8)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter, List, CompiledModelTestBase.Enum8>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter, CompiledModelTestBase.Enum8>( new JsonConvertedValueReaderWriter( JsonSByteReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.Enum8 value) => (sbyte)value, (sbyte value) => (CompiledModelTestBase.Enum8)value)))), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter, List, CompiledModelTestBase.Enum8>( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter, CompiledModelTestBase.Enum8>( new JsonConvertedValueReaderWriter( JsonSByteReaderWriter.Instance, new ValueConverter( @@ -8194,11 +9339,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SByteTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), providerValueComparer: new ValueComparer( (sbyte v1, sbyte v2) => v1 == v2, @@ -8233,35 +9378,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum8Collection.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum8Collection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum8Collection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>>(nullableEnum8Collection, 140), + (InternalEntityEntry entry) => entry.ReadOriginalValue>>(nullableEnum8Collection, 152), (InternalEntityEntry entry) => entry.GetCurrentValue>>(nullableEnum8Collection), - (ValueBuffer valueBuffer) => valueBuffer[140]); + (ValueBuffer valueBuffer) => valueBuffer[152]); nullableEnum8Collection.SetPropertyIndexes( - index: 140, - originalValueIndex: 140, + index: 152, + originalValueIndex: 152, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnum8Collection.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.Enum8>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum8)v1, (object)(CompiledModelTestBase.Enum8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum8)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.Enum8>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum8)v1, (object)(CompiledModelTestBase.Enum8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum8)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter, List, CompiledModelTestBase.Enum8>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter, CompiledModelTestBase.Enum8>( new JsonConvertedValueReaderWriter( JsonSByteReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.Enum8 value) => (sbyte)value, (sbyte value) => (CompiledModelTestBase.Enum8)value)))), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter, List, CompiledModelTestBase.Enum8>( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter, CompiledModelTestBase.Enum8>( new JsonConvertedValueReaderWriter( JsonSByteReaderWriter.Instance, new ValueConverter( @@ -8270,11 +9415,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SByteTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), providerValueComparer: new ValueComparer( (sbyte v1, sbyte v2) => v1 == v2, @@ -8292,6 +9437,109 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (sbyte value) => (CompiledModelTestBase.Enum8)value)))); nullableEnum8Collection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum8Collection", "TestNamespace") }); + var nullableEnum8NestedCollection = runtimeEntityType.AddProperty( + "NullableEnum8NestedCollection", + typeof(CompiledModelTestBase.Enum8?[][]), + propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("NullableEnum8NestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + nullableEnum8NestedCollection.SetGetter( + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum8NestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum8NestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum8NestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum8NestedCollection(instance) == null); + nullableEnum8NestedCollection.SetSetter( + (CompiledModelTestBase.ManyTypes entity, Nullable[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum8NestedCollection(entity) = value); + nullableEnum8NestedCollection.SetMaterializationSetter( + (CompiledModelTestBase.ManyTypes entity, Nullable[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum8NestedCollection(entity) = value); + nullableEnum8NestedCollection.SetAccessors( + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum8NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum8NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => entry.ReadOriginalValue[][]>(nullableEnum8NestedCollection, 153), + (InternalEntityEntry entry) => entry.GetCurrentValue[][]>(nullableEnum8NestedCollection), + (ValueBuffer valueBuffer) => valueBuffer[153]); + nullableEnum8NestedCollection.SetPropertyIndexes( + index: 153, + originalValueIndex: 153, + shadowIndex: -1, + relationshipIndex: -1, + storeGenerationIndex: -1); + nullableEnum8NestedCollection.TypeMapping = SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfReferenceTypesComparer(new ListOfNullableValueTypesComparer(new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum8)v1, (object)(CompiledModelTestBase.Enum8)v2) || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum8)v : default(Nullable)))), + keyComparer: new ListOfReferenceTypesComparer(new ListOfNullableValueTypesComparer(new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum8)v1, (object)(CompiledModelTestBase.Enum8)v2) || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum8)v : default(Nullable)))), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfNullableStructsReaderWriter( + new JsonConvertedValueReaderWriter( + JsonSByteReaderWriter.Instance, + new ValueConverter( + (CompiledModelTestBase.Enum8 value) => (sbyte)value, + (sbyte value) => (CompiledModelTestBase.Enum8)value))))), + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfNullableStructsReaderWriter( + new JsonConvertedValueReaderWriter( + JsonSByteReaderWriter.Instance, + new ValueConverter( + (CompiledModelTestBase.Enum8 value) => (sbyte)value, + (sbyte value) => (CompiledModelTestBase.Enum8)value)))), + elementMapping: SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfNullableValueTypesComparer(new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum8)v1, (object)(CompiledModelTestBase.Enum8)v2) || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum8)v : default(Nullable))), + keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum8)v1, (object)(CompiledModelTestBase.Enum8)v2) || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum8)v : default(Nullable))), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter( + new JsonConvertedValueReaderWriter( + JsonSByteReaderWriter.Instance, + new ValueConverter( + (CompiledModelTestBase.Enum8 value) => (sbyte)value, + (sbyte value) => (CompiledModelTestBase.Enum8)value)))), + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter( + new JsonConvertedValueReaderWriter( + JsonSByteReaderWriter.Instance, + new ValueConverter( + (CompiledModelTestBase.Enum8 value) => (sbyte)value, + (sbyte value) => (CompiledModelTestBase.Enum8)value))), + elementMapping: SByteTypeMapping.Default.Clone( + comparer: new ValueComparer( + (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), + (CompiledModelTestBase.Enum8 v) => v), + keyComparer: new ValueComparer( + (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), + (CompiledModelTestBase.Enum8 v) => v), + providerValueComparer: new ValueComparer( + (sbyte v1, sbyte v2) => v1 == v2, + (sbyte v) => (int)v, + (sbyte v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "INTEGER"), + converter: new ValueConverter( + (CompiledModelTestBase.Enum8 value) => (sbyte)value, + (sbyte value) => (CompiledModelTestBase.Enum8)value), + jsonValueReaderWriter: new JsonConvertedValueReaderWriter( + JsonSByteReaderWriter.Instance, + new ValueConverter( + (CompiledModelTestBase.Enum8 value) => (sbyte)value, + (sbyte value) => (CompiledModelTestBase.Enum8)value))))); + nullableEnum8NestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum8NestedCollection", "TestNamespace") }); + var nullableEnumU16 = runtimeEntityType.AddProperty( "NullableEnumU16", typeof(CompiledModelTestBase.EnumU16?), @@ -8310,23 +9558,23 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU16.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU16((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU16((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableEnumU16, 141), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableEnumU16, 154), (InternalEntityEntry entry) => entry.GetCurrentValue>(nullableEnumU16), - (ValueBuffer valueBuffer) => valueBuffer[141]); + (ValueBuffer valueBuffer) => valueBuffer[154]); nullableEnumU16.SetPropertyIndexes( - index: 141, - originalValueIndex: 141, + index: 154, + originalValueIndex: 154, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnumU16.TypeMapping = UShortTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU16)v1, (object)(CompiledModelTestBase.EnumU16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU16)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU16)v1, (object)(CompiledModelTestBase.EnumU16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU16)v : default(Nullable)), providerValueComparer: new ValueComparer( (ushort v1, ushort v2) => v1 == v2, @@ -8361,35 +9609,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU16Array.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU16Array((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU16Array((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableEnumU16Array, 142), + (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableEnumU16Array, 155), (InternalEntityEntry entry) => entry.GetCurrentValue[]>(nullableEnumU16Array), - (ValueBuffer valueBuffer) => valueBuffer[142]); + (ValueBuffer valueBuffer) => valueBuffer[155]); nullableEnumU16Array.SetPropertyIndexes( - index: 142, - originalValueIndex: 142, + index: 155, + originalValueIndex: 155, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnumU16Array.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU16)v1, (object)(CompiledModelTestBase.EnumU16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU16)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU16)v1, (object)(CompiledModelTestBase.EnumU16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU16)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonUInt16ReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.EnumU16 value) => (ushort)value, (ushort value) => (CompiledModelTestBase.EnumU16)value)))), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonUInt16ReaderWriter.Instance, new ValueConverter( @@ -8398,11 +9646,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: UShortTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v), providerValueComparer: new ValueComparer( (ushort v1, ushort v2) => v1 == v2, @@ -8438,23 +9686,23 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU16AsString.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU16AsString((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU16AsString((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableEnumU16AsString, 143), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableEnumU16AsString, 156), (InternalEntityEntry entry) => entry.GetCurrentValue>(nullableEnumU16AsString), - (ValueBuffer valueBuffer) => valueBuffer[143]); + (ValueBuffer valueBuffer) => valueBuffer[156]); nullableEnumU16AsString.SetPropertyIndexes( - index: 143, - originalValueIndex: 143, + index: 156, + originalValueIndex: 156, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnumU16AsString.TypeMapping = UShortTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU16)v1, (object)(CompiledModelTestBase.EnumU16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU16)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU16)v1, (object)(CompiledModelTestBase.EnumU16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU16)v : default(Nullable)), providerValueComparer: new ValueComparer( (ushort v1, ushort v2) => v1 == v2, @@ -8489,35 +9737,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU16AsStringArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU16AsStringArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU16AsStringArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableEnumU16AsStringArray, 144), + (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableEnumU16AsStringArray, 157), (InternalEntityEntry entry) => entry.GetCurrentValue[]>(nullableEnumU16AsStringArray), - (ValueBuffer valueBuffer) => valueBuffer[144]); + (ValueBuffer valueBuffer) => valueBuffer[157]); nullableEnumU16AsStringArray.SetPropertyIndexes( - index: 144, - originalValueIndex: 144, + index: 157, + originalValueIndex: 157, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnumU16AsStringArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU16)v1, (object)(CompiledModelTestBase.EnumU16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU16)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU16)v1, (object)(CompiledModelTestBase.EnumU16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU16)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonUInt16ReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.EnumU16 value) => (ushort)value, (ushort value) => (CompiledModelTestBase.EnumU16)value)))), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonUInt16ReaderWriter.Instance, new ValueConverter( @@ -8526,11 +9774,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: UShortTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v), providerValueComparer: new ValueComparer( (ushort v1, ushort v2) => v1 == v2, @@ -8565,35 +9813,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU16AsStringCollection.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU16AsStringCollection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU16AsStringCollection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>>(nullableEnumU16AsStringCollection, 145), + (InternalEntityEntry entry) => entry.ReadOriginalValue>>(nullableEnumU16AsStringCollection, 158), (InternalEntityEntry entry) => entry.GetCurrentValue>>(nullableEnumU16AsStringCollection), - (ValueBuffer valueBuffer) => valueBuffer[145]); + (ValueBuffer valueBuffer) => valueBuffer[158]); nullableEnumU16AsStringCollection.SetPropertyIndexes( - index: 145, - originalValueIndex: 145, + index: 158, + originalValueIndex: 158, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnumU16AsStringCollection.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.EnumU16>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU16)v1, (object)(CompiledModelTestBase.EnumU16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU16)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.EnumU16>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU16)v1, (object)(CompiledModelTestBase.EnumU16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU16)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter, List, CompiledModelTestBase.EnumU16>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter, CompiledModelTestBase.EnumU16>( new JsonConvertedValueReaderWriter( JsonUInt16ReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.EnumU16 value) => (ushort)value, (ushort value) => (CompiledModelTestBase.EnumU16)value)))), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter, List, CompiledModelTestBase.EnumU16>( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter, CompiledModelTestBase.EnumU16>( new JsonConvertedValueReaderWriter( JsonUInt16ReaderWriter.Instance, new ValueConverter( @@ -8602,11 +9850,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: UShortTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v), providerValueComparer: new ValueComparer( (ushort v1, ushort v2) => v1 == v2, @@ -8641,35 +9889,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU16Collection.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU16Collection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU16Collection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>>(nullableEnumU16Collection, 146), + (InternalEntityEntry entry) => entry.ReadOriginalValue>>(nullableEnumU16Collection, 159), (InternalEntityEntry entry) => entry.GetCurrentValue>>(nullableEnumU16Collection), - (ValueBuffer valueBuffer) => valueBuffer[146]); + (ValueBuffer valueBuffer) => valueBuffer[159]); nullableEnumU16Collection.SetPropertyIndexes( - index: 146, - originalValueIndex: 146, + index: 159, + originalValueIndex: 159, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnumU16Collection.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.EnumU16>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU16)v1, (object)(CompiledModelTestBase.EnumU16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU16)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.EnumU16>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU16)v1, (object)(CompiledModelTestBase.EnumU16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU16)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter, List, CompiledModelTestBase.EnumU16>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter, CompiledModelTestBase.EnumU16>( new JsonConvertedValueReaderWriter( JsonUInt16ReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.EnumU16 value) => (ushort)value, (ushort value) => (CompiledModelTestBase.EnumU16)value)))), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter, List, CompiledModelTestBase.EnumU16>( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter, CompiledModelTestBase.EnumU16>( new JsonConvertedValueReaderWriter( JsonUInt16ReaderWriter.Instance, new ValueConverter( @@ -8678,11 +9926,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: UShortTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v), providerValueComparer: new ValueComparer( (ushort v1, ushort v2) => v1 == v2, @@ -8718,23 +9966,23 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU32.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU32((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU32((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableEnumU32, 147), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableEnumU32, 160), (InternalEntityEntry entry) => entry.GetCurrentValue>(nullableEnumU32), - (ValueBuffer valueBuffer) => valueBuffer[147]); + (ValueBuffer valueBuffer) => valueBuffer[160]); nullableEnumU32.SetPropertyIndexes( - index: 147, - originalValueIndex: 147, + index: 160, + originalValueIndex: 160, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnumU32.TypeMapping = UIntTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU32)v1, (object)(CompiledModelTestBase.EnumU32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU32)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU32)v1, (object)(CompiledModelTestBase.EnumU32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU32)v : default(Nullable)), providerValueComparer: new ValueComparer( (uint v1, uint v2) => v1 == v2, @@ -8769,35 +10017,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU32Array.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU32Array((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU32Array((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableEnumU32Array, 148), + (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableEnumU32Array, 161), (InternalEntityEntry entry) => entry.GetCurrentValue[]>(nullableEnumU32Array), - (ValueBuffer valueBuffer) => valueBuffer[148]); + (ValueBuffer valueBuffer) => valueBuffer[161]); nullableEnumU32Array.SetPropertyIndexes( - index: 148, - originalValueIndex: 148, + index: 161, + originalValueIndex: 161, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnumU32Array.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU32)v1, (object)(CompiledModelTestBase.EnumU32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU32)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU32)v1, (object)(CompiledModelTestBase.EnumU32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU32)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonUInt32ReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.EnumU32 value) => (uint)value, (uint value) => (CompiledModelTestBase.EnumU32)value)))), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonUInt32ReaderWriter.Instance, new ValueConverter( @@ -8806,11 +10054,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: UIntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v), providerValueComparer: new ValueComparer( (uint v1, uint v2) => v1 == v2, @@ -8846,23 +10094,23 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU32AsString.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU32AsString((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU32AsString((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableEnumU32AsString, 149), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableEnumU32AsString, 162), (InternalEntityEntry entry) => entry.GetCurrentValue>(nullableEnumU32AsString), - (ValueBuffer valueBuffer) => valueBuffer[149]); + (ValueBuffer valueBuffer) => valueBuffer[162]); nullableEnumU32AsString.SetPropertyIndexes( - index: 149, - originalValueIndex: 149, + index: 162, + originalValueIndex: 162, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnumU32AsString.TypeMapping = UIntTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU32)v1, (object)(CompiledModelTestBase.EnumU32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU32)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU32)v1, (object)(CompiledModelTestBase.EnumU32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU32)v : default(Nullable)), providerValueComparer: new ValueComparer( (uint v1, uint v2) => v1 == v2, @@ -8897,35 +10145,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU32AsStringArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU32AsStringArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU32AsStringArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableEnumU32AsStringArray, 150), + (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableEnumU32AsStringArray, 163), (InternalEntityEntry entry) => entry.GetCurrentValue[]>(nullableEnumU32AsStringArray), - (ValueBuffer valueBuffer) => valueBuffer[150]); + (ValueBuffer valueBuffer) => valueBuffer[163]); nullableEnumU32AsStringArray.SetPropertyIndexes( - index: 150, - originalValueIndex: 150, + index: 163, + originalValueIndex: 163, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnumU32AsStringArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU32)v1, (object)(CompiledModelTestBase.EnumU32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU32)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU32)v1, (object)(CompiledModelTestBase.EnumU32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU32)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonUInt32ReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.EnumU32 value) => (uint)value, (uint value) => (CompiledModelTestBase.EnumU32)value)))), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonUInt32ReaderWriter.Instance, new ValueConverter( @@ -8934,11 +10182,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: UIntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v), providerValueComparer: new ValueComparer( (uint v1, uint v2) => v1 == v2, @@ -8973,35 +10221,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU32AsStringCollection.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU32AsStringCollection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU32AsStringCollection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>>(nullableEnumU32AsStringCollection, 151), + (InternalEntityEntry entry) => entry.ReadOriginalValue>>(nullableEnumU32AsStringCollection, 164), (InternalEntityEntry entry) => entry.GetCurrentValue>>(nullableEnumU32AsStringCollection), - (ValueBuffer valueBuffer) => valueBuffer[151]); + (ValueBuffer valueBuffer) => valueBuffer[164]); nullableEnumU32AsStringCollection.SetPropertyIndexes( - index: 151, - originalValueIndex: 151, + index: 164, + originalValueIndex: 164, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnumU32AsStringCollection.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.EnumU32>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU32)v1, (object)(CompiledModelTestBase.EnumU32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU32)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.EnumU32>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU32)v1, (object)(CompiledModelTestBase.EnumU32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU32)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter, List, CompiledModelTestBase.EnumU32>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter, CompiledModelTestBase.EnumU32>( new JsonConvertedValueReaderWriter( JsonUInt32ReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.EnumU32 value) => (uint)value, (uint value) => (CompiledModelTestBase.EnumU32)value)))), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter, List, CompiledModelTestBase.EnumU32>( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter, CompiledModelTestBase.EnumU32>( new JsonConvertedValueReaderWriter( JsonUInt32ReaderWriter.Instance, new ValueConverter( @@ -9010,11 +10258,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: UIntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v), providerValueComparer: new ValueComparer( (uint v1, uint v2) => v1 == v2, @@ -9049,35 +10297,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU32Collection.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU32Collection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU32Collection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>>(nullableEnumU32Collection, 152), + (InternalEntityEntry entry) => entry.ReadOriginalValue>>(nullableEnumU32Collection, 165), (InternalEntityEntry entry) => entry.GetCurrentValue>>(nullableEnumU32Collection), - (ValueBuffer valueBuffer) => valueBuffer[152]); + (ValueBuffer valueBuffer) => valueBuffer[165]); nullableEnumU32Collection.SetPropertyIndexes( - index: 152, - originalValueIndex: 152, + index: 165, + originalValueIndex: 165, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnumU32Collection.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.EnumU32>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU32)v1, (object)(CompiledModelTestBase.EnumU32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU32)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.EnumU32>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU32)v1, (object)(CompiledModelTestBase.EnumU32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU32)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter, List, CompiledModelTestBase.EnumU32>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter, CompiledModelTestBase.EnumU32>( new JsonConvertedValueReaderWriter( JsonUInt32ReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.EnumU32 value) => (uint)value, (uint value) => (CompiledModelTestBase.EnumU32)value)))), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter, List, CompiledModelTestBase.EnumU32>( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter, CompiledModelTestBase.EnumU32>( new JsonConvertedValueReaderWriter( JsonUInt32ReaderWriter.Instance, new ValueConverter( @@ -9086,11 +10334,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: UIntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v), providerValueComparer: new ValueComparer( (uint v1, uint v2) => v1 == v2, @@ -9126,27 +10374,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU64.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU64((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU64((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableEnumU64, 153), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableEnumU64, 166), (InternalEntityEntry entry) => entry.GetCurrentValue>(nullableEnumU64), - (ValueBuffer valueBuffer) => valueBuffer[153]); + (ValueBuffer valueBuffer) => valueBuffer[166]); nullableEnumU64.SetPropertyIndexes( - index: 153, - originalValueIndex: 153, + index: 166, + originalValueIndex: 166, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnumU64.TypeMapping = SqliteULongTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU64)v1, (object)(CompiledModelTestBase.EnumU64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU64)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU64)v1, (object)(CompiledModelTestBase.EnumU64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU64)v : default(Nullable)), providerValueComparer: new ValueComparer( (ulong v1, ulong v2) => v1 == v2, - (ulong v) => v.GetHashCode(), + (ulong v) => ((object)v).GetHashCode(), (ulong v) => v), converter: new ValueConverter( (CompiledModelTestBase.EnumU64 value) => (ulong)value, @@ -9175,35 +10423,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU64Array.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU64Array((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU64Array((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableEnumU64Array, 154), + (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableEnumU64Array, 167), (InternalEntityEntry entry) => entry.GetCurrentValue[]>(nullableEnumU64Array), - (ValueBuffer valueBuffer) => valueBuffer[154]); + (ValueBuffer valueBuffer) => valueBuffer[167]); nullableEnumU64Array.SetPropertyIndexes( - index: 154, - originalValueIndex: 154, + index: 167, + originalValueIndex: 167, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnumU64Array.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU64)v1, (object)(CompiledModelTestBase.EnumU64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU64)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU64)v1, (object)(CompiledModelTestBase.EnumU64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU64)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonUInt64ReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.EnumU64 value) => (ulong)value, (ulong value) => (CompiledModelTestBase.EnumU64)value)))), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonUInt64ReaderWriter.Instance, new ValueConverter( @@ -9212,15 +10460,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqliteULongTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), providerValueComparer: new ValueComparer( (ulong v1, ulong v2) => v1 == v2, - (ulong v) => v.GetHashCode(), + (ulong v) => ((object)v).GetHashCode(), (ulong v) => v), converter: new ValueConverter( (CompiledModelTestBase.EnumU64 value) => (ulong)value, @@ -9250,27 +10498,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU64AsString.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU64AsString((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU64AsString((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableEnumU64AsString, 155), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableEnumU64AsString, 168), (InternalEntityEntry entry) => entry.GetCurrentValue>(nullableEnumU64AsString), - (ValueBuffer valueBuffer) => valueBuffer[155]); + (ValueBuffer valueBuffer) => valueBuffer[168]); nullableEnumU64AsString.SetPropertyIndexes( - index: 155, - originalValueIndex: 155, + index: 168, + originalValueIndex: 168, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnumU64AsString.TypeMapping = SqliteULongTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU64)v1, (object)(CompiledModelTestBase.EnumU64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU64)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU64)v1, (object)(CompiledModelTestBase.EnumU64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU64)v : default(Nullable)), providerValueComparer: new ValueComparer( (ulong v1, ulong v2) => v1 == v2, - (ulong v) => v.GetHashCode(), + (ulong v) => ((object)v).GetHashCode(), (ulong v) => v), converter: new ValueConverter( (CompiledModelTestBase.EnumU64 value) => (ulong)value, @@ -9299,35 +10547,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU64AsStringArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU64AsStringArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU64AsStringArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableEnumU64AsStringArray, 156), + (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableEnumU64AsStringArray, 169), (InternalEntityEntry entry) => entry.GetCurrentValue[]>(nullableEnumU64AsStringArray), - (ValueBuffer valueBuffer) => valueBuffer[156]); + (ValueBuffer valueBuffer) => valueBuffer[169]); nullableEnumU64AsStringArray.SetPropertyIndexes( - index: 156, - originalValueIndex: 156, + index: 169, + originalValueIndex: 169, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnumU64AsStringArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU64)v1, (object)(CompiledModelTestBase.EnumU64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU64)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU64)v1, (object)(CompiledModelTestBase.EnumU64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU64)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonUInt64ReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.EnumU64 value) => (ulong)value, (ulong value) => (CompiledModelTestBase.EnumU64)value)))), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonUInt64ReaderWriter.Instance, new ValueConverter( @@ -9336,15 +10584,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqliteULongTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), providerValueComparer: new ValueComparer( (ulong v1, ulong v2) => v1 == v2, - (ulong v) => v.GetHashCode(), + (ulong v) => ((object)v).GetHashCode(), (ulong v) => v), converter: new ValueConverter( (CompiledModelTestBase.EnumU64 value) => (ulong)value, @@ -9373,35 +10621,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU64AsStringCollection.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU64AsStringCollection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU64AsStringCollection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>>(nullableEnumU64AsStringCollection, 157), + (InternalEntityEntry entry) => entry.ReadOriginalValue>>(nullableEnumU64AsStringCollection, 170), (InternalEntityEntry entry) => entry.GetCurrentValue>>(nullableEnumU64AsStringCollection), - (ValueBuffer valueBuffer) => valueBuffer[157]); + (ValueBuffer valueBuffer) => valueBuffer[170]); nullableEnumU64AsStringCollection.SetPropertyIndexes( - index: 157, - originalValueIndex: 157, + index: 170, + originalValueIndex: 170, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnumU64AsStringCollection.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.EnumU64>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU64)v1, (object)(CompiledModelTestBase.EnumU64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU64)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.EnumU64>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU64)v1, (object)(CompiledModelTestBase.EnumU64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU64)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter, List, CompiledModelTestBase.EnumU64>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter, CompiledModelTestBase.EnumU64>( new JsonConvertedValueReaderWriter( JsonUInt64ReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.EnumU64 value) => (ulong)value, (ulong value) => (CompiledModelTestBase.EnumU64)value)))), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter, List, CompiledModelTestBase.EnumU64>( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter, CompiledModelTestBase.EnumU64>( new JsonConvertedValueReaderWriter( JsonUInt64ReaderWriter.Instance, new ValueConverter( @@ -9410,15 +10658,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqliteULongTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), providerValueComparer: new ValueComparer( (ulong v1, ulong v2) => v1 == v2, - (ulong v) => v.GetHashCode(), + (ulong v) => ((object)v).GetHashCode(), (ulong v) => v), converter: new ValueConverter( (CompiledModelTestBase.EnumU64 value) => (ulong)value, @@ -9447,35 +10695,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU64Collection.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU64Collection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU64Collection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>>(nullableEnumU64Collection, 158), + (InternalEntityEntry entry) => entry.ReadOriginalValue>>(nullableEnumU64Collection, 171), (InternalEntityEntry entry) => entry.GetCurrentValue>>(nullableEnumU64Collection), - (ValueBuffer valueBuffer) => valueBuffer[158]); + (ValueBuffer valueBuffer) => valueBuffer[171]); nullableEnumU64Collection.SetPropertyIndexes( - index: 158, - originalValueIndex: 158, + index: 171, + originalValueIndex: 171, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnumU64Collection.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.EnumU64>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU64)v1, (object)(CompiledModelTestBase.EnumU64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU64)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.EnumU64>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU64)v1, (object)(CompiledModelTestBase.EnumU64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU64)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter, List, CompiledModelTestBase.EnumU64>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter, CompiledModelTestBase.EnumU64>( new JsonConvertedValueReaderWriter( JsonUInt64ReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.EnumU64 value) => (ulong)value, (ulong value) => (CompiledModelTestBase.EnumU64)value)))), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter, List, CompiledModelTestBase.EnumU64>( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter, CompiledModelTestBase.EnumU64>( new JsonConvertedValueReaderWriter( JsonUInt64ReaderWriter.Instance, new ValueConverter( @@ -9484,15 +10732,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqliteULongTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), providerValueComparer: new ValueComparer( (ulong v1, ulong v2) => v1 == v2, - (ulong v) => v.GetHashCode(), + (ulong v) => ((object)v).GetHashCode(), (ulong v) => v), converter: new ValueConverter( (CompiledModelTestBase.EnumU64 value) => (ulong)value, @@ -9504,6 +10752,107 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (ulong value) => (CompiledModelTestBase.EnumU64)value)))); nullableEnumU64Collection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU64Collection", "TestNamespace") }); + var nullableEnumU64NestedCollection = runtimeEntityType.AddProperty( + "NullableEnumU64NestedCollection", + typeof(CompiledModelTestBase.EnumU64?[][]), + propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("NullableEnumU64NestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + nullableEnumU64NestedCollection.SetGetter( + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU64NestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU64NestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU64NestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU64NestedCollection(instance) == null); + nullableEnumU64NestedCollection.SetSetter( + (CompiledModelTestBase.ManyTypes entity, Nullable[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU64NestedCollection(entity) = value); + nullableEnumU64NestedCollection.SetMaterializationSetter( + (CompiledModelTestBase.ManyTypes entity, Nullable[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU64NestedCollection(entity) = value); + nullableEnumU64NestedCollection.SetAccessors( + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU64NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU64NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => entry.ReadOriginalValue[][]>(nullableEnumU64NestedCollection, 172), + (InternalEntityEntry entry) => entry.GetCurrentValue[][]>(nullableEnumU64NestedCollection), + (ValueBuffer valueBuffer) => valueBuffer[172]); + nullableEnumU64NestedCollection.SetPropertyIndexes( + index: 172, + originalValueIndex: 172, + shadowIndex: -1, + relationshipIndex: -1, + storeGenerationIndex: -1); + nullableEnumU64NestedCollection.TypeMapping = SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfReferenceTypesComparer(new ListOfNullableValueTypesComparer(new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU64)v1, (object)(CompiledModelTestBase.EnumU64)v2) || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU64)v : default(Nullable)))), + keyComparer: new ListOfReferenceTypesComparer(new ListOfNullableValueTypesComparer(new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU64)v1, (object)(CompiledModelTestBase.EnumU64)v2) || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU64)v : default(Nullable)))), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfNullableStructsReaderWriter( + new JsonConvertedValueReaderWriter( + JsonUInt64ReaderWriter.Instance, + new ValueConverter( + (CompiledModelTestBase.EnumU64 value) => (ulong)value, + (ulong value) => (CompiledModelTestBase.EnumU64)value))))), + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfNullableStructsReaderWriter( + new JsonConvertedValueReaderWriter( + JsonUInt64ReaderWriter.Instance, + new ValueConverter( + (CompiledModelTestBase.EnumU64 value) => (ulong)value, + (ulong value) => (CompiledModelTestBase.EnumU64)value)))), + elementMapping: SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfNullableValueTypesComparer(new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU64)v1, (object)(CompiledModelTestBase.EnumU64)v2) || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU64)v : default(Nullable))), + keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU64)v1, (object)(CompiledModelTestBase.EnumU64)v2) || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU64)v : default(Nullable))), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter( + new JsonConvertedValueReaderWriter( + JsonUInt64ReaderWriter.Instance, + new ValueConverter( + (CompiledModelTestBase.EnumU64 value) => (ulong)value, + (ulong value) => (CompiledModelTestBase.EnumU64)value)))), + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter( + new JsonConvertedValueReaderWriter( + JsonUInt64ReaderWriter.Instance, + new ValueConverter( + (CompiledModelTestBase.EnumU64 value) => (ulong)value, + (ulong value) => (CompiledModelTestBase.EnumU64)value))), + elementMapping: SqliteULongTypeMapping.Default.Clone( + comparer: new ValueComparer( + (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => v), + keyComparer: new ValueComparer( + (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => v), + providerValueComparer: new ValueComparer( + (ulong v1, ulong v2) => v1 == v2, + (ulong v) => ((object)v).GetHashCode(), + (ulong v) => v), + converter: new ValueConverter( + (CompiledModelTestBase.EnumU64 value) => (ulong)value, + (ulong value) => (CompiledModelTestBase.EnumU64)value), + jsonValueReaderWriter: new JsonConvertedValueReaderWriter( + JsonUInt64ReaderWriter.Instance, + new ValueConverter( + (CompiledModelTestBase.EnumU64 value) => (ulong)value, + (ulong value) => (CompiledModelTestBase.EnumU64)value))))); + nullableEnumU64NestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU64NestedCollection", "TestNamespace") }); + var nullableEnumU8 = runtimeEntityType.AddProperty( "NullableEnumU8", typeof(CompiledModelTestBase.EnumU8?), @@ -9522,23 +10871,23 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU8.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU8((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU8((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableEnumU8, 159), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableEnumU8, 173), (InternalEntityEntry entry) => entry.GetCurrentValue>(nullableEnumU8), - (ValueBuffer valueBuffer) => valueBuffer[159]); + (ValueBuffer valueBuffer) => valueBuffer[173]); nullableEnumU8.SetPropertyIndexes( - index: 159, - originalValueIndex: 159, + index: 173, + originalValueIndex: 173, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnumU8.TypeMapping = ByteTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU8)v1, (object)(CompiledModelTestBase.EnumU8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU8)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU8)v1, (object)(CompiledModelTestBase.EnumU8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU8)v : default(Nullable)), providerValueComparer: new ValueComparer( (byte v1, byte v2) => v1 == v2, @@ -9573,35 +10922,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU8Array.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU8Array((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU8Array((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableEnumU8Array, 160), + (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableEnumU8Array, 174), (InternalEntityEntry entry) => entry.GetCurrentValue[]>(nullableEnumU8Array), - (ValueBuffer valueBuffer) => valueBuffer[160]); + (ValueBuffer valueBuffer) => valueBuffer[174]); nullableEnumU8Array.SetPropertyIndexes( - index: 160, - originalValueIndex: 160, + index: 174, + originalValueIndex: 174, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnumU8Array.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU8)v1, (object)(CompiledModelTestBase.EnumU8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU8)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU8)v1, (object)(CompiledModelTestBase.EnumU8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU8)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonByteReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.EnumU8 value) => (byte)value, (byte value) => (CompiledModelTestBase.EnumU8)value)))), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonByteReaderWriter.Instance, new ValueConverter( @@ -9610,11 +10959,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: ByteTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v), providerValueComparer: new ValueComparer( (byte v1, byte v2) => v1 == v2, @@ -9650,23 +10999,23 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU8AsString.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU8AsString((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU8AsString((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableEnumU8AsString, 161), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableEnumU8AsString, 175), (InternalEntityEntry entry) => entry.GetCurrentValue>(nullableEnumU8AsString), - (ValueBuffer valueBuffer) => valueBuffer[161]); + (ValueBuffer valueBuffer) => valueBuffer[175]); nullableEnumU8AsString.SetPropertyIndexes( - index: 161, - originalValueIndex: 161, + index: 175, + originalValueIndex: 175, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnumU8AsString.TypeMapping = ByteTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU8)v1, (object)(CompiledModelTestBase.EnumU8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU8)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU8)v1, (object)(CompiledModelTestBase.EnumU8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU8)v : default(Nullable)), providerValueComparer: new ValueComparer( (byte v1, byte v2) => v1 == v2, @@ -9701,35 +11050,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU8AsStringArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU8AsStringArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU8AsStringArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableEnumU8AsStringArray, 162), + (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableEnumU8AsStringArray, 176), (InternalEntityEntry entry) => entry.GetCurrentValue[]>(nullableEnumU8AsStringArray), - (ValueBuffer valueBuffer) => valueBuffer[162]); + (ValueBuffer valueBuffer) => valueBuffer[176]); nullableEnumU8AsStringArray.SetPropertyIndexes( - index: 162, - originalValueIndex: 162, + index: 176, + originalValueIndex: 176, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnumU8AsStringArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU8)v1, (object)(CompiledModelTestBase.EnumU8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU8)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU8)v1, (object)(CompiledModelTestBase.EnumU8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU8)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonByteReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.EnumU8 value) => (byte)value, (byte value) => (CompiledModelTestBase.EnumU8)value)))), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonByteReaderWriter.Instance, new ValueConverter( @@ -9738,11 +11087,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: ByteTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v), providerValueComparer: new ValueComparer( (byte v1, byte v2) => v1 == v2, @@ -9777,35 +11126,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU8AsStringCollection.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU8AsStringCollection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU8AsStringCollection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>>(nullableEnumU8AsStringCollection, 163), + (InternalEntityEntry entry) => entry.ReadOriginalValue>>(nullableEnumU8AsStringCollection, 177), (InternalEntityEntry entry) => entry.GetCurrentValue>>(nullableEnumU8AsStringCollection), - (ValueBuffer valueBuffer) => valueBuffer[163]); + (ValueBuffer valueBuffer) => valueBuffer[177]); nullableEnumU8AsStringCollection.SetPropertyIndexes( - index: 163, - originalValueIndex: 163, + index: 177, + originalValueIndex: 177, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnumU8AsStringCollection.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.EnumU8>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU8)v1, (object)(CompiledModelTestBase.EnumU8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU8)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.EnumU8>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU8)v1, (object)(CompiledModelTestBase.EnumU8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU8)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter, List, CompiledModelTestBase.EnumU8>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter, CompiledModelTestBase.EnumU8>( new JsonConvertedValueReaderWriter( JsonByteReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.EnumU8 value) => (byte)value, (byte value) => (CompiledModelTestBase.EnumU8)value)))), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter, List, CompiledModelTestBase.EnumU8>( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter, CompiledModelTestBase.EnumU8>( new JsonConvertedValueReaderWriter( JsonByteReaderWriter.Instance, new ValueConverter( @@ -9814,11 +11163,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: ByteTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v), providerValueComparer: new ValueComparer( (byte v1, byte v2) => v1 == v2, @@ -9853,35 +11202,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU8Collection.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU8Collection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU8Collection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>>(nullableEnumU8Collection, 164), + (InternalEntityEntry entry) => entry.ReadOriginalValue>>(nullableEnumU8Collection, 178), (InternalEntityEntry entry) => entry.GetCurrentValue>>(nullableEnumU8Collection), - (ValueBuffer valueBuffer) => valueBuffer[164]); + (ValueBuffer valueBuffer) => valueBuffer[178]); nullableEnumU8Collection.SetPropertyIndexes( - index: 164, - originalValueIndex: 164, + index: 178, + originalValueIndex: 178, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnumU8Collection.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.EnumU8>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU8)v1, (object)(CompiledModelTestBase.EnumU8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU8)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.EnumU8>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU8)v1, (object)(CompiledModelTestBase.EnumU8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU8)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter, List, CompiledModelTestBase.EnumU8>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter, CompiledModelTestBase.EnumU8>( new JsonConvertedValueReaderWriter( JsonByteReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.EnumU8 value) => (byte)value, (byte value) => (CompiledModelTestBase.EnumU8)value)))), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter, List, CompiledModelTestBase.EnumU8>( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter, CompiledModelTestBase.EnumU8>( new JsonConvertedValueReaderWriter( JsonByteReaderWriter.Instance, new ValueConverter( @@ -9890,11 +11239,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: ByteTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v), providerValueComparer: new ValueComparer( (byte v1, byte v2) => v1 == v2, @@ -9930,27 +11279,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableFloat.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableFloat((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableFloat((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableFloat, 165), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableFloat, 179), (InternalEntityEntry entry) => entry.GetCurrentValue>(nullableFloat), - (ValueBuffer valueBuffer) => valueBuffer[165]); + (ValueBuffer valueBuffer) => valueBuffer[179]); nullableFloat.SetPropertyIndexes( - index: 165, - originalValueIndex: 165, + index: 179, + originalValueIndex: 179, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableFloat.TypeMapping = FloatTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && ((float)v1).Equals((float)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((float)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(float)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(float)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && ((float)v1).Equals((float)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((float)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(float)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(float)v : default(Nullable)), providerValueComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && ((float)v1).Equals((float)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((float)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(float)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(float)v : default(Nullable)), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "REAL")); @@ -9973,44 +11322,44 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableFloatArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableFloatArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableFloatArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableFloatArray, 166), + (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableFloatArray, 180), (InternalEntityEntry entry) => entry.GetCurrentValue[]>(nullableFloatArray), - (ValueBuffer valueBuffer) => valueBuffer[166]); + (ValueBuffer valueBuffer) => valueBuffer[180]); nullableFloatArray.SetPropertyIndexes( - index: 166, - originalValueIndex: 166, + index: 180, + originalValueIndex: 180, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableFloatArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && ((float)v1).Equals((float)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((float)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(float)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(float)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && ((float)v1).Equals((float)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((float)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(float)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(float)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter( JsonFloatReaderWriter.Instance)), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter( JsonFloatReaderWriter.Instance), elementMapping: FloatTypeMapping.Default.Clone( comparer: new ValueComparer( (float v1, float v2) => v1.Equals(v2), - (float v) => v.GetHashCode(), + (float v) => ((object)v).GetHashCode(), (float v) => v), keyComparer: new ValueComparer( (float v1, float v2) => v1.Equals(v2), - (float v) => v.GetHashCode(), + (float v) => ((object)v).GetHashCode(), (float v) => v), providerValueComparer: new ValueComparer( (float v1, float v2) => v1.Equals(v2), - (float v) => v.GetHashCode(), + (float v) => ((object)v).GetHashCode(), (float v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "REAL"))); @@ -10034,12 +11383,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableGuid.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableGuid((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableGuid((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableGuid, 167), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableGuid, 181), (InternalEntityEntry entry) => entry.GetCurrentValue>(nullableGuid), - (ValueBuffer valueBuffer) => valueBuffer[167]); + (ValueBuffer valueBuffer) => valueBuffer[181]); nullableGuid.SetPropertyIndexes( - index: 167, - originalValueIndex: 167, + index: 181, + originalValueIndex: 181, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); @@ -10063,35 +11412,100 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableGuidArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableGuidArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableGuidArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableGuidArray, 168), + (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableGuidArray, 182), (InternalEntityEntry entry) => entry.GetCurrentValue[]>(nullableGuidArray), - (ValueBuffer valueBuffer) => valueBuffer[168]); + (ValueBuffer valueBuffer) => valueBuffer[182]); nullableGuidArray.SetPropertyIndexes( - index: 168, - originalValueIndex: 168, + index: 182, + originalValueIndex: 182, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableGuidArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (Guid)v1 == (Guid)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((Guid)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(Guid)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(Guid)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (Guid)v1 == (Guid)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((Guid)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(Guid)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(Guid)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter( SqliteJsonGuidReaderWriter.Instance)), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter( SqliteJsonGuidReaderWriter.Instance), elementMapping: SqliteGuidTypeMapping.Default); nullableGuidArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableGuidArray", "TestNamespace") }); + var nullableGuidNestedCollection = runtimeEntityType.AddProperty( + "NullableGuidNestedCollection", + typeof(Guid?[][]), + propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("NullableGuidNestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + nullableGuidNestedCollection.SetGetter( + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableGuidNestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableGuidNestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableGuidNestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableGuidNestedCollection(instance) == null); + nullableGuidNestedCollection.SetSetter( + (CompiledModelTestBase.ManyTypes entity, Nullable[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableGuidNestedCollection(entity) = value); + nullableGuidNestedCollection.SetMaterializationSetter( + (CompiledModelTestBase.ManyTypes entity, Nullable[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableGuidNestedCollection(entity) = value); + nullableGuidNestedCollection.SetAccessors( + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableGuidNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableGuidNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => entry.ReadOriginalValue[][]>(nullableGuidNestedCollection, 183), + (InternalEntityEntry entry) => entry.GetCurrentValue[][]>(nullableGuidNestedCollection), + (ValueBuffer valueBuffer) => valueBuffer[183]); + nullableGuidNestedCollection.SetPropertyIndexes( + index: 183, + originalValueIndex: 183, + shadowIndex: -1, + relationshipIndex: -1, + storeGenerationIndex: -1); + nullableGuidNestedCollection.TypeMapping = SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfReferenceTypesComparer(new ListOfNullableValueTypesComparer(new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (Guid)v1 == (Guid)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((object)(Guid)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(Guid)v : default(Nullable)))), + keyComparer: new ListOfReferenceTypesComparer(new ListOfNullableValueTypesComparer(new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (Guid)v1 == (Guid)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((object)(Guid)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(Guid)v : default(Nullable)))), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfNullableStructsReaderWriter( + SqliteJsonGuidReaderWriter.Instance))), + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfNullableStructsReaderWriter( + SqliteJsonGuidReaderWriter.Instance)), + elementMapping: SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfNullableValueTypesComparer(new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (Guid)v1 == (Guid)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((object)(Guid)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(Guid)v : default(Nullable))), + keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (Guid)v1 == (Guid)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((object)(Guid)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(Guid)v : default(Nullable))), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter( + SqliteJsonGuidReaderWriter.Instance)), + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter( + SqliteJsonGuidReaderWriter.Instance), + elementMapping: SqliteGuidTypeMapping.Default)); + nullableGuidNestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableGuidNestedCollection", "TestNamespace") }); + var nullableIPAddress = runtimeEntityType.AddProperty( "NullableIPAddress", typeof(IPAddress), @@ -10110,37 +11524,37 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableIPAddress.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableIPAddress((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableIPAddress((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(nullableIPAddress, 169), + (InternalEntityEntry entry) => entry.ReadOriginalValue(nullableIPAddress, 184), (InternalEntityEntry entry) => entry.GetCurrentValue(nullableIPAddress), - (ValueBuffer valueBuffer) => valueBuffer[169]); + (ValueBuffer valueBuffer) => valueBuffer[184]); nullableIPAddress.SetPropertyIndexes( - index: 169, - originalValueIndex: 169, + index: 184, + originalValueIndex: 184, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableIPAddress.TypeMapping = SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), keyComparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( size: 45), converter: new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)))); nullableIPAddress.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableIPAddress", "TestNamespace") }); @@ -10161,62 +11575,62 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableIPAddressArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableIPAddressArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableIPAddressArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(nullableIPAddressArray, 170), + (InternalEntityEntry entry) => entry.ReadOriginalValue(nullableIPAddressArray, 185), (InternalEntityEntry entry) => entry.GetCurrentValue(nullableIPAddressArray), - (ValueBuffer valueBuffer) => valueBuffer[170]); + (ValueBuffer valueBuffer) => valueBuffer[185]); nullableIPAddressArray.SetPropertyIndexes( - index: 170, - originalValueIndex: 170, + index: 185, + originalValueIndex: 185, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableIPAddressArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfReferenceTypesComparer(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)))), elementMapping: SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), keyComparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( size: 45), converter: new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))); nullableIPAddressArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableIPAddressArray", "TestNamespace") }); @@ -10238,12 +11652,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableInt16.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt16((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt16((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableInt16, 171), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableInt16, 186), (InternalEntityEntry entry) => entry.GetCurrentValue>(nullableInt16), - (ValueBuffer valueBuffer) => valueBuffer[171]); + (ValueBuffer valueBuffer) => valueBuffer[186]); nullableInt16.SetPropertyIndexes( - index: 171, - originalValueIndex: 171, + index: 186, + originalValueIndex: 186, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); @@ -10281,31 +11695,31 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableInt16Array.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt16Array((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt16Array((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableInt16Array, 172), + (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableInt16Array, 187), (InternalEntityEntry entry) => entry.GetCurrentValue[]>(nullableInt16Array), - (ValueBuffer valueBuffer) => valueBuffer[172]); + (ValueBuffer valueBuffer) => valueBuffer[187]); nullableInt16Array.SetPropertyIndexes( - index: 172, - originalValueIndex: 172, + index: 187, + originalValueIndex: 187, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableInt16Array.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, (Nullable v) => v.HasValue ? (int)(short)v : 0, (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, (Nullable v) => v.HasValue ? (int)(short)v : 0, (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter( JsonInt16ReaderWriter.Instance)), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter( JsonInt16ReaderWriter.Instance), elementMapping: ShortTypeMapping.Default.Clone( comparer: new ValueComparer( @@ -10342,12 +11756,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableInt32.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt32((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt32((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableInt32, 173), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableInt32, 188), (InternalEntityEntry entry) => entry.GetCurrentValue>(nullableInt32), - (ValueBuffer valueBuffer) => valueBuffer[173]); + (ValueBuffer valueBuffer) => valueBuffer[188]); nullableInt32.SetPropertyIndexes( - index: 173, - originalValueIndex: 173, + index: 188, + originalValueIndex: 188, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); @@ -10385,31 +11799,31 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableInt32Array.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt32Array((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt32Array((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableInt32Array, 174), + (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableInt32Array, 189), (InternalEntityEntry entry) => entry.GetCurrentValue[]>(nullableInt32Array), - (ValueBuffer valueBuffer) => valueBuffer[174]); + (ValueBuffer valueBuffer) => valueBuffer[189]); nullableInt32Array.SetPropertyIndexes( - index: 174, - originalValueIndex: 174, + index: 189, + originalValueIndex: 189, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableInt32Array.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, (Nullable v) => v.HasValue ? (int)v : 0, (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, (Nullable v) => v.HasValue ? (int)v : 0, (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter( JsonInt32ReaderWriter.Instance)), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter( JsonInt32ReaderWriter.Instance), elementMapping: IntTypeMapping.Default.Clone( comparer: new ValueComparer( @@ -10428,6 +11842,85 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas storeTypeName: "INTEGER"))); nullableInt32Array.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt32Array", "TestNamespace") }); + var nullableInt32NestedCollection = runtimeEntityType.AddProperty( + "NullableInt32NestedCollection", + typeof(int?[][]), + propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("NullableInt32NestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + nullableInt32NestedCollection.SetGetter( + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt32NestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt32NestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt32NestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt32NestedCollection(instance) == null); + nullableInt32NestedCollection.SetSetter( + (CompiledModelTestBase.ManyTypes entity, Nullable[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt32NestedCollection(entity) = value); + nullableInt32NestedCollection.SetMaterializationSetter( + (CompiledModelTestBase.ManyTypes entity, Nullable[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt32NestedCollection(entity) = value); + nullableInt32NestedCollection.SetAccessors( + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt32NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt32NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => entry.ReadOriginalValue[][]>(nullableInt32NestedCollection, 190), + (InternalEntityEntry entry) => entry.GetCurrentValue[][]>(nullableInt32NestedCollection), + (ValueBuffer valueBuffer) => valueBuffer[190]); + nullableInt32NestedCollection.SetPropertyIndexes( + index: 190, + originalValueIndex: 190, + shadowIndex: -1, + relationshipIndex: -1, + storeGenerationIndex: -1); + nullableInt32NestedCollection.TypeMapping = SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfReferenceTypesComparer(new ListOfNullableValueTypesComparer(new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable)))), + keyComparer: new ListOfReferenceTypesComparer(new ListOfNullableValueTypesComparer(new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable)))), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfNullableStructsReaderWriter( + JsonInt32ReaderWriter.Instance))), + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfNullableStructsReaderWriter( + JsonInt32ReaderWriter.Instance)), + elementMapping: SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfNullableValueTypesComparer(new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable))), + keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable))), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter( + JsonInt32ReaderWriter.Instance)), + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter( + JsonInt32ReaderWriter.Instance), + elementMapping: IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "INTEGER")))); + nullableInt32NestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt32NestedCollection", "TestNamespace") }); + var nullableInt64 = runtimeEntityType.AddProperty( "NullableInt64", typeof(long?), @@ -10446,27 +11939,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableInt64.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt64((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt64((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableInt64, 175), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableInt64, 191), (InternalEntityEntry entry) => entry.GetCurrentValue>(nullableInt64), - (ValueBuffer valueBuffer) => valueBuffer[175]); + (ValueBuffer valueBuffer) => valueBuffer[191]); nullableInt64.SetPropertyIndexes( - index: 175, - originalValueIndex: 175, + index: 191, + originalValueIndex: 191, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableInt64.TypeMapping = LongTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable)), providerValueComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable)), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "INTEGER")); @@ -10489,49 +11982,149 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableInt64Array.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt64Array((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt64Array((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableInt64Array, 176), + (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableInt64Array, 192), (InternalEntityEntry entry) => entry.GetCurrentValue[]>(nullableInt64Array), - (ValueBuffer valueBuffer) => valueBuffer[176]); + (ValueBuffer valueBuffer) => valueBuffer[192]); nullableInt64Array.SetPropertyIndexes( - index: 176, - originalValueIndex: 176, + index: 192, + originalValueIndex: 192, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableInt64Array.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter( JsonInt64ReaderWriter.Instance)), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter( JsonInt64ReaderWriter.Instance), elementMapping: LongTypeMapping.Default.Clone( comparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), keyComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "INTEGER"))); nullableInt64Array.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt64Array", "TestNamespace") }); + var nullableInt64NestedCollection = runtimeEntityType.AddProperty( + "NullableInt64NestedCollection", + typeof(List), + propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("NullableInt64NestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + nullableInt64NestedCollection.SetGetter( + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt64NestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt64NestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt64NestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt64NestedCollection(instance) == null); + nullableInt64NestedCollection.SetSetter( + (CompiledModelTestBase.ManyTypes entity, List[][]> value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt64NestedCollection(entity) = value); + nullableInt64NestedCollection.SetMaterializationSetter( + (CompiledModelTestBase.ManyTypes entity, List[][]> value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt64NestedCollection(entity) = value); + nullableInt64NestedCollection.SetAccessors( + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt64NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt64NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => entry.ReadOriginalValue[][]>>(nullableInt64NestedCollection, 193), + (InternalEntityEntry entry) => entry.GetCurrentValue[][]>>(nullableInt64NestedCollection), + (ValueBuffer valueBuffer) => valueBuffer[193]); + nullableInt64NestedCollection.SetPropertyIndexes( + index: 193, + originalValueIndex: 193, + shadowIndex: -1, + relationshipIndex: -1, + storeGenerationIndex: -1); + nullableInt64NestedCollection.TypeMapping = SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfReferenceTypesComparer, long?[][]>(new ListOfReferenceTypesComparer(new ListOfNullableValueTypesComparer(new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable))))), + keyComparer: new ListOfReferenceTypesComparer, long?[][]>(new ListOfReferenceTypesComparer(new ListOfNullableValueTypesComparer(new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable))))), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter, long?[][]>( + new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfNullableStructsReaderWriter( + JsonInt64ReaderWriter.Instance)))), + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter, long?[][]>( + new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfNullableStructsReaderWriter( + JsonInt64ReaderWriter.Instance))), + elementMapping: SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfReferenceTypesComparer(new ListOfNullableValueTypesComparer(new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable)))), + keyComparer: new ListOfReferenceTypesComparer(new ListOfNullableValueTypesComparer(new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable)))), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfNullableStructsReaderWriter( + JsonInt64ReaderWriter.Instance))), + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfNullableStructsReaderWriter( + JsonInt64ReaderWriter.Instance)), + elementMapping: SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfNullableValueTypesComparer(new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable))), + keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable))), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter( + JsonInt64ReaderWriter.Instance)), + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter( + JsonInt64ReaderWriter.Instance), + elementMapping: LongTypeMapping.Default.Clone( + comparer: new ValueComparer( + (long v1, long v2) => v1 == v2, + (long v) => ((object)v).GetHashCode(), + (long v) => v), + keyComparer: new ValueComparer( + (long v1, long v2) => v1 == v2, + (long v) => ((object)v).GetHashCode(), + (long v) => v), + providerValueComparer: new ValueComparer( + (long v1, long v2) => v1 == v2, + (long v) => ((object)v).GetHashCode(), + (long v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "INTEGER"))))); + nullableInt64NestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt64NestedCollection", "TestNamespace") }); + var nullableInt8 = runtimeEntityType.AddProperty( "NullableInt8", typeof(sbyte?), @@ -10550,12 +12143,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableInt8.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt8((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt8((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableInt8, 177), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableInt8, 194), (InternalEntityEntry entry) => entry.GetCurrentValue>(nullableInt8), - (ValueBuffer valueBuffer) => valueBuffer[177]); + (ValueBuffer valueBuffer) => valueBuffer[194]); nullableInt8.SetPropertyIndexes( - index: 177, - originalValueIndex: 177, + index: 194, + originalValueIndex: 194, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); @@ -10593,31 +12186,31 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableInt8Array.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt8Array((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt8Array((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableInt8Array, 178), + (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableInt8Array, 195), (InternalEntityEntry entry) => entry.GetCurrentValue[]>(nullableInt8Array), - (ValueBuffer valueBuffer) => valueBuffer[178]); + (ValueBuffer valueBuffer) => valueBuffer[195]); nullableInt8Array.SetPropertyIndexes( - index: 178, - originalValueIndex: 178, + index: 195, + originalValueIndex: 195, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableInt8Array.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (sbyte)v1 == (sbyte)v2 || !v1.HasValue && !v2.HasValue, (Nullable v) => v.HasValue ? (int)(sbyte)v : 0, (Nullable v) => v.HasValue ? (Nullable)(sbyte)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (sbyte)v1 == (sbyte)v2 || !v1.HasValue && !v2.HasValue, (Nullable v) => v.HasValue ? (int)(sbyte)v : 0, (Nullable v) => v.HasValue ? (Nullable)(sbyte)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter( JsonSByteReaderWriter.Instance)), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter( JsonSByteReaderWriter.Instance), elementMapping: SByteTypeMapping.Default.Clone( comparer: new ValueComparer( @@ -10654,37 +12247,37 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullablePhysicalAddress.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullablePhysicalAddress((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullablePhysicalAddress((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(nullablePhysicalAddress, 179), + (InternalEntityEntry entry) => entry.ReadOriginalValue(nullablePhysicalAddress, 196), (InternalEntityEntry entry) => entry.GetCurrentValue(nullablePhysicalAddress), - (ValueBuffer valueBuffer) => valueBuffer[179]); + (ValueBuffer valueBuffer) => valueBuffer[196]); nullablePhysicalAddress.SetPropertyIndexes( - index: 179, - originalValueIndex: 179, + index: 196, + originalValueIndex: 196, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullablePhysicalAddress.TypeMapping = SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), - (PhysicalAddress v) => v.GetHashCode(), + (PhysicalAddress v) => ((object)v).GetHashCode(), (PhysicalAddress v) => v), keyComparer: new ValueComparer( (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), - (PhysicalAddress v) => v.GetHashCode(), + (PhysicalAddress v) => ((object)v).GetHashCode(), (PhysicalAddress v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( size: 20), converter: new ValueConverter( - (PhysicalAddress v) => v.ToString(), + (PhysicalAddress v) => ((object)v).ToString(), (string v) => PhysicalAddress.Parse(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (PhysicalAddress v) => v.ToString(), + (PhysicalAddress v) => ((object)v).ToString(), (string v) => PhysicalAddress.Parse(v)))); nullablePhysicalAddress.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullablePhysicalAddress", "TestNamespace") }); @@ -10705,65 +12298,197 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullablePhysicalAddressArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullablePhysicalAddressArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullablePhysicalAddressArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(nullablePhysicalAddressArray, 180), + (InternalEntityEntry entry) => entry.ReadOriginalValue(nullablePhysicalAddressArray, 197), (InternalEntityEntry entry) => entry.GetCurrentValue(nullablePhysicalAddressArray), - (ValueBuffer valueBuffer) => valueBuffer[180]); + (ValueBuffer valueBuffer) => valueBuffer[197]); nullablePhysicalAddressArray.SetPropertyIndexes( - index: 180, - originalValueIndex: 180, + index: 197, + originalValueIndex: 197, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullablePhysicalAddressArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfReferenceTypesComparer(new ValueComparer( (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), - (PhysicalAddress v) => v.GetHashCode(), + (PhysicalAddress v) => ((object)v).GetHashCode(), (PhysicalAddress v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), - (PhysicalAddress v) => v.GetHashCode(), + (PhysicalAddress v) => ((object)v).GetHashCode(), (PhysicalAddress v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (PhysicalAddress v) => v.ToString(), + (PhysicalAddress v) => ((object)v).ToString(), (string v) => PhysicalAddress.Parse(v))))), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (PhysicalAddress v) => v.ToString(), + (PhysicalAddress v) => ((object)v).ToString(), (string v) => PhysicalAddress.Parse(v)))), elementMapping: SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), - (PhysicalAddress v) => v.GetHashCode(), + (PhysicalAddress v) => ((object)v).GetHashCode(), (PhysicalAddress v) => v), keyComparer: new ValueComparer( (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), - (PhysicalAddress v) => v.GetHashCode(), + (PhysicalAddress v) => ((object)v).GetHashCode(), (PhysicalAddress v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( size: 20), converter: new ValueConverter( - (PhysicalAddress v) => v.ToString(), + (PhysicalAddress v) => ((object)v).ToString(), (string v) => PhysicalAddress.Parse(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (PhysicalAddress v) => v.ToString(), + (PhysicalAddress v) => ((object)v).ToString(), (string v) => PhysicalAddress.Parse(v))))); nullablePhysicalAddressArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullablePhysicalAddressArray", "TestNamespace") }); + var nullablePhysicalAddressNestedCollection = runtimeEntityType.AddProperty( + "NullablePhysicalAddressNestedCollection", + typeof(IEnumerable), + propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("NullablePhysicalAddressNestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + nullablePhysicalAddressNestedCollection.SetGetter( + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullablePhysicalAddressNestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullablePhysicalAddressNestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullablePhysicalAddressNestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullablePhysicalAddressNestedCollection(instance) == null); + nullablePhysicalAddressNestedCollection.SetSetter( + (CompiledModelTestBase.ManyTypes entity, IEnumerable value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullablePhysicalAddressNestedCollection(entity) = value); + nullablePhysicalAddressNestedCollection.SetMaterializationSetter( + (CompiledModelTestBase.ManyTypes entity, IEnumerable value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullablePhysicalAddressNestedCollection(entity) = value); + nullablePhysicalAddressNestedCollection.SetAccessors( + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullablePhysicalAddressNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullablePhysicalAddressNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullablePhysicalAddressNestedCollection, 198), + (InternalEntityEntry entry) => entry.GetCurrentValue>(nullablePhysicalAddressNestedCollection), + (ValueBuffer valueBuffer) => valueBuffer[198]); + nullablePhysicalAddressNestedCollection.SetPropertyIndexes( + index: 198, + originalValueIndex: 198, + shadowIndex: -1, + relationshipIndex: -1, + storeGenerationIndex: -1); + nullablePhysicalAddressNestedCollection.TypeMapping = SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfReferenceTypesComparer, PhysicalAddress[][]>(new ListOfReferenceTypesComparer(new ListOfReferenceTypesComparer(new ValueComparer( + (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), + (PhysicalAddress v) => ((object)v).GetHashCode(), + (PhysicalAddress v) => v)))), + keyComparer: new ListOfReferenceTypesComparer, PhysicalAddress[][]>(new ListOfReferenceTypesComparer(new ListOfReferenceTypesComparer(new ValueComparer( + (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), + (PhysicalAddress v) => ((object)v).GetHashCode(), + (PhysicalAddress v) => v)))), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter, PhysicalAddress[][]>( + new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfReferencesReaderWriter( + new JsonConvertedValueReaderWriter( + JsonStringReaderWriter.Instance, + new ValueConverter( + (PhysicalAddress v) => ((object)v).ToString(), + (string v) => PhysicalAddress.Parse(v))))))), + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter, PhysicalAddress[][]>( + new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfReferencesReaderWriter( + new JsonConvertedValueReaderWriter( + JsonStringReaderWriter.Instance, + new ValueConverter( + (PhysicalAddress v) => ((object)v).ToString(), + (string v) => PhysicalAddress.Parse(v)))))), + elementMapping: SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfReferenceTypesComparer(new ListOfReferenceTypesComparer(new ValueComparer( + (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), + (PhysicalAddress v) => ((object)v).GetHashCode(), + (PhysicalAddress v) => v))), + keyComparer: new ListOfReferenceTypesComparer(new ListOfReferenceTypesComparer(new ValueComparer( + (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), + (PhysicalAddress v) => ((object)v).GetHashCode(), + (PhysicalAddress v) => v))), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfReferencesReaderWriter( + new JsonConvertedValueReaderWriter( + JsonStringReaderWriter.Instance, + new ValueConverter( + (PhysicalAddress v) => ((object)v).ToString(), + (string v) => PhysicalAddress.Parse(v)))))), + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfReferencesReaderWriter( + new JsonConvertedValueReaderWriter( + JsonStringReaderWriter.Instance, + new ValueConverter( + (PhysicalAddress v) => ((object)v).ToString(), + (string v) => PhysicalAddress.Parse(v))))), + elementMapping: SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfReferenceTypesComparer(new ValueComparer( + (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), + (PhysicalAddress v) => ((object)v).GetHashCode(), + (PhysicalAddress v) => v)), + keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( + (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), + (PhysicalAddress v) => ((object)v).GetHashCode(), + (PhysicalAddress v) => v)), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter( + new JsonConvertedValueReaderWriter( + JsonStringReaderWriter.Instance, + new ValueConverter( + (PhysicalAddress v) => ((object)v).ToString(), + (string v) => PhysicalAddress.Parse(v))))), + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( + new JsonConvertedValueReaderWriter( + JsonStringReaderWriter.Instance, + new ValueConverter( + (PhysicalAddress v) => ((object)v).ToString(), + (string v) => PhysicalAddress.Parse(v)))), + elementMapping: SqliteStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), + (PhysicalAddress v) => ((object)v).GetHashCode(), + (PhysicalAddress v) => v), + keyComparer: new ValueComparer( + (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), + (PhysicalAddress v) => ((object)v).GetHashCode(), + (PhysicalAddress v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + size: 20), + converter: new ValueConverter( + (PhysicalAddress v) => ((object)v).ToString(), + (string v) => PhysicalAddress.Parse(v)), + jsonValueReaderWriter: new JsonConvertedValueReaderWriter( + JsonStringReaderWriter.Instance, + new ValueConverter( + (PhysicalAddress v) => ((object)v).ToString(), + (string v) => PhysicalAddress.Parse(v))))))); + nullablePhysicalAddressNestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullablePhysicalAddressNestedCollection", "TestNamespace") }); + var nullableString = runtimeEntityType.AddProperty( "NullableString", typeof(string), @@ -10782,12 +12507,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableString.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableString((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableString((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(nullableString, 181), + (InternalEntityEntry entry) => entry.ReadOriginalValue(nullableString, 199), (InternalEntityEntry entry) => entry.GetCurrentValue(nullableString), - (ValueBuffer valueBuffer) => valueBuffer[181]); + (ValueBuffer valueBuffer) => valueBuffer[199]); nullableString.SetPropertyIndexes( - index: 181, - originalValueIndex: 181, + index: 199, + originalValueIndex: 199, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); @@ -10811,35 +12536,100 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableStringArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableStringArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableStringArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(nullableStringArray, 182), + (InternalEntityEntry entry) => entry.ReadOriginalValue(nullableStringArray, 200), (InternalEntityEntry entry) => entry.GetCurrentValue(nullableStringArray), - (ValueBuffer valueBuffer) => valueBuffer[182]); + (ValueBuffer valueBuffer) => valueBuffer[200]); nullableStringArray.SetPropertyIndexes( - index: 182, - originalValueIndex: 182, + index: 200, + originalValueIndex: 200, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableStringArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfReferenceTypesComparer(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter( JsonStringReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( JsonStringReaderWriter.Instance), elementMapping: SqliteStringTypeMapping.Default); nullableStringArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableStringArray", "TestNamespace") }); + var nullableStringNestedCollection = runtimeEntityType.AddProperty( + "NullableStringNestedCollection", + typeof(string[][]), + propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("NullableStringNestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + nullableStringNestedCollection.SetGetter( + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableStringNestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableStringNestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableStringNestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableStringNestedCollection(instance) == null); + nullableStringNestedCollection.SetSetter( + (CompiledModelTestBase.ManyTypes entity, string[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableStringNestedCollection(entity) = value); + nullableStringNestedCollection.SetMaterializationSetter( + (CompiledModelTestBase.ManyTypes entity, string[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableStringNestedCollection(entity) = value); + nullableStringNestedCollection.SetAccessors( + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableStringNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableStringNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => entry.ReadOriginalValue(nullableStringNestedCollection, 201), + (InternalEntityEntry entry) => entry.GetCurrentValue(nullableStringNestedCollection), + (ValueBuffer valueBuffer) => valueBuffer[201]); + nullableStringNestedCollection.SetPropertyIndexes( + index: 201, + originalValueIndex: 201, + shadowIndex: -1, + relationshipIndex: -1, + storeGenerationIndex: -1); + nullableStringNestedCollection.TypeMapping = SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfReferenceTypesComparer(new ListOfReferenceTypesComparer(new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v))), + keyComparer: new ListOfReferenceTypesComparer(new ListOfReferenceTypesComparer(new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v))), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfReferencesReaderWriter( + JsonStringReaderWriter.Instance))), + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfReferencesReaderWriter( + JsonStringReaderWriter.Instance)), + elementMapping: SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfReferenceTypesComparer(new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v)), + keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v)), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter( + JsonStringReaderWriter.Instance)), + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( + JsonStringReaderWriter.Instance), + elementMapping: SqliteStringTypeMapping.Default)); + nullableStringNestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableStringNestedCollection", "TestNamespace") }); + var nullableTimeOnly = runtimeEntityType.AddProperty( "NullableTimeOnly", typeof(TimeOnly?), @@ -10858,12 +12648,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableTimeOnly.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableTimeOnly((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableTimeOnly((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableTimeOnly, 183), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableTimeOnly, 202), (InternalEntityEntry entry) => entry.GetCurrentValue>(nullableTimeOnly), - (ValueBuffer valueBuffer) => valueBuffer[183]); + (ValueBuffer valueBuffer) => valueBuffer[202]); nullableTimeOnly.SetPropertyIndexes( - index: 183, - originalValueIndex: 183, + index: 202, + originalValueIndex: 202, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); @@ -10887,31 +12677,31 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableTimeOnlyArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableTimeOnlyArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableTimeOnlyArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableTimeOnlyArray, 184), + (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableTimeOnlyArray, 203), (InternalEntityEntry entry) => entry.GetCurrentValue[]>(nullableTimeOnlyArray), - (ValueBuffer valueBuffer) => valueBuffer[184]); + (ValueBuffer valueBuffer) => valueBuffer[203]); nullableTimeOnlyArray.SetPropertyIndexes( - index: 184, - originalValueIndex: 184, + index: 203, + originalValueIndex: 203, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableTimeOnlyArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (TimeOnly)v1 == (TimeOnly)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((TimeOnly)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(TimeOnly)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(TimeOnly)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (TimeOnly)v1 == (TimeOnly)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((TimeOnly)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(TimeOnly)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(TimeOnly)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter( JsonTimeOnlyReaderWriter.Instance)), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter( JsonTimeOnlyReaderWriter.Instance), elementMapping: SqliteTimeOnlyTypeMapping.Default); nullableTimeOnlyArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableTimeOnlyArray", "TestNamespace") }); @@ -10934,27 +12724,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableTimeSpan.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableTimeSpan((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableTimeSpan((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableTimeSpan, 185), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableTimeSpan, 204), (InternalEntityEntry entry) => entry.GetCurrentValue>(nullableTimeSpan), - (ValueBuffer valueBuffer) => valueBuffer[185]); + (ValueBuffer valueBuffer) => valueBuffer[204]); nullableTimeSpan.SetPropertyIndexes( - index: 185, - originalValueIndex: 185, + index: 204, + originalValueIndex: 204, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableTimeSpan.TypeMapping = TimeSpanTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (TimeSpan)v1 == (TimeSpan)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((TimeSpan)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(TimeSpan)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(TimeSpan)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (TimeSpan)v1 == (TimeSpan)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((TimeSpan)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(TimeSpan)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(TimeSpan)v : default(Nullable)), providerValueComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (TimeSpan)v1 == (TimeSpan)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((TimeSpan)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(TimeSpan)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(TimeSpan)v : default(Nullable)), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "TEXT")); @@ -10977,44 +12767,44 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableTimeSpanArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableTimeSpanArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableTimeSpanArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableTimeSpanArray, 186), + (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableTimeSpanArray, 205), (InternalEntityEntry entry) => entry.GetCurrentValue[]>(nullableTimeSpanArray), - (ValueBuffer valueBuffer) => valueBuffer[186]); + (ValueBuffer valueBuffer) => valueBuffer[205]); nullableTimeSpanArray.SetPropertyIndexes( - index: 186, - originalValueIndex: 186, + index: 205, + originalValueIndex: 205, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableTimeSpanArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (TimeSpan)v1 == (TimeSpan)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((TimeSpan)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(TimeSpan)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(TimeSpan)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (TimeSpan)v1 == (TimeSpan)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((TimeSpan)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(TimeSpan)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(TimeSpan)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter( JsonTimeSpanReaderWriter.Instance)), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter( JsonTimeSpanReaderWriter.Instance), elementMapping: TimeSpanTypeMapping.Default.Clone( comparer: new ValueComparer( (TimeSpan v1, TimeSpan v2) => v1.Equals(v2), - (TimeSpan v) => v.GetHashCode(), + (TimeSpan v) => ((object)v).GetHashCode(), (TimeSpan v) => v), keyComparer: new ValueComparer( (TimeSpan v1, TimeSpan v2) => v1.Equals(v2), - (TimeSpan v) => v.GetHashCode(), + (TimeSpan v) => ((object)v).GetHashCode(), (TimeSpan v) => v), providerValueComparer: new ValueComparer( (TimeSpan v1, TimeSpan v2) => v1.Equals(v2), - (TimeSpan v) => v.GetHashCode(), + (TimeSpan v) => ((object)v).GetHashCode(), (TimeSpan v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "TEXT"))); @@ -11038,12 +12828,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableUInt16.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUInt16((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUInt16((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableUInt16, 187), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableUInt16, 206), (InternalEntityEntry entry) => entry.GetCurrentValue>(nullableUInt16), - (ValueBuffer valueBuffer) => valueBuffer[187]); + (ValueBuffer valueBuffer) => valueBuffer[206]); nullableUInt16.SetPropertyIndexes( - index: 187, - originalValueIndex: 187, + index: 206, + originalValueIndex: 206, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); @@ -11081,31 +12871,31 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableUInt16Array.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUInt16Array((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUInt16Array((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableUInt16Array, 188), + (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableUInt16Array, 207), (InternalEntityEntry entry) => entry.GetCurrentValue[]>(nullableUInt16Array), - (ValueBuffer valueBuffer) => valueBuffer[188]); + (ValueBuffer valueBuffer) => valueBuffer[207]); nullableUInt16Array.SetPropertyIndexes( - index: 188, - originalValueIndex: 188, + index: 207, + originalValueIndex: 207, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableUInt16Array.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (ushort)v1 == (ushort)v2 || !v1.HasValue && !v2.HasValue, (Nullable v) => v.HasValue ? (int)(ushort)v : 0, (Nullable v) => v.HasValue ? (Nullable)(ushort)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (ushort)v1 == (ushort)v2 || !v1.HasValue && !v2.HasValue, (Nullable v) => v.HasValue ? (int)(ushort)v : 0, (Nullable v) => v.HasValue ? (Nullable)(ushort)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter( JsonUInt16ReaderWriter.Instance)), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter( JsonUInt16ReaderWriter.Instance), elementMapping: UShortTypeMapping.Default.Clone( comparer: new ValueComparer( @@ -11142,12 +12932,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableUInt32.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUInt32((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUInt32((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableUInt32, 189), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableUInt32, 208), (InternalEntityEntry entry) => entry.GetCurrentValue>(nullableUInt32), - (ValueBuffer valueBuffer) => valueBuffer[189]); + (ValueBuffer valueBuffer) => valueBuffer[208]); nullableUInt32.SetPropertyIndexes( - index: 189, - originalValueIndex: 189, + index: 208, + originalValueIndex: 208, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); @@ -11185,31 +12975,31 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableUInt32Array.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUInt32Array((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUInt32Array((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableUInt32Array, 190), + (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableUInt32Array, 209), (InternalEntityEntry entry) => entry.GetCurrentValue[]>(nullableUInt32Array), - (ValueBuffer valueBuffer) => valueBuffer[190]); + (ValueBuffer valueBuffer) => valueBuffer[209]); nullableUInt32Array.SetPropertyIndexes( - index: 190, - originalValueIndex: 190, + index: 209, + originalValueIndex: 209, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableUInt32Array.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (uint)v1 == (uint)v2 || !v1.HasValue && !v2.HasValue, (Nullable v) => v.HasValue ? (int)(uint)v : 0, (Nullable v) => v.HasValue ? (Nullable)(uint)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (uint)v1 == (uint)v2 || !v1.HasValue && !v2.HasValue, (Nullable v) => v.HasValue ? (int)(uint)v : 0, (Nullable v) => v.HasValue ? (Nullable)(uint)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter( JsonUInt32ReaderWriter.Instance)), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter( JsonUInt32ReaderWriter.Instance), elementMapping: UIntTypeMapping.Default.Clone( comparer: new ValueComparer( @@ -11246,12 +13036,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableUInt64.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUInt64((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUInt64((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableUInt64, 191), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableUInt64, 210), (InternalEntityEntry entry) => entry.GetCurrentValue>(nullableUInt64), - (ValueBuffer valueBuffer) => valueBuffer[191]); + (ValueBuffer valueBuffer) => valueBuffer[210]); nullableUInt64.SetPropertyIndexes( - index: 191, - originalValueIndex: 191, + index: 210, + originalValueIndex: 210, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); @@ -11275,31 +13065,31 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableUInt64Array.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUInt64Array((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUInt64Array((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableUInt64Array, 192), + (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableUInt64Array, 211), (InternalEntityEntry entry) => entry.GetCurrentValue[]>(nullableUInt64Array), - (ValueBuffer valueBuffer) => valueBuffer[192]); + (ValueBuffer valueBuffer) => valueBuffer[211]); nullableUInt64Array.SetPropertyIndexes( - index: 192, - originalValueIndex: 192, + index: 211, + originalValueIndex: 211, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableUInt64Array.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (ulong)v1 == (ulong)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((ulong)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(ulong)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(ulong)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (ulong)v1 == (ulong)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((ulong)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(ulong)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(ulong)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter( JsonUInt64ReaderWriter.Instance)), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter( JsonUInt64ReaderWriter.Instance), elementMapping: SqliteULongTypeMapping.Default); nullableUInt64Array.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUInt64Array", "TestNamespace") }); @@ -11322,12 +13112,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableUInt8.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUInt8((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUInt8((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableUInt8, 193), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableUInt8, 212), (InternalEntityEntry entry) => entry.GetCurrentValue>(nullableUInt8), - (ValueBuffer valueBuffer) => valueBuffer[193]); + (ValueBuffer valueBuffer) => valueBuffer[212]); nullableUInt8.SetPropertyIndexes( - index: 193, - originalValueIndex: 193, + index: 212, + originalValueIndex: 212, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); @@ -11365,31 +13155,31 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableUInt8Array.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUInt8Array((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUInt8Array((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableUInt8Array, 194), + (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableUInt8Array, 213), (InternalEntityEntry entry) => entry.GetCurrentValue[]>(nullableUInt8Array), - (ValueBuffer valueBuffer) => valueBuffer[194]); + (ValueBuffer valueBuffer) => valueBuffer[213]); nullableUInt8Array.SetPropertyIndexes( - index: 194, - originalValueIndex: 194, + index: 213, + originalValueIndex: 213, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableUInt8Array.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (byte)v1 == (byte)v2 || !v1.HasValue && !v2.HasValue, (Nullable v) => v.HasValue ? (int)(byte)v : 0, (Nullable v) => v.HasValue ? (Nullable)(byte)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (byte)v1 == (byte)v2 || !v1.HasValue && !v2.HasValue, (Nullable v) => v.HasValue ? (int)(byte)v : 0, (Nullable v) => v.HasValue ? (Nullable)(byte)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter( JsonByteReaderWriter.Instance)), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter( JsonByteReaderWriter.Instance), elementMapping: ByteTypeMapping.Default.Clone( comparer: new ValueComparer( @@ -11408,6 +13198,85 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas storeTypeName: "INTEGER"))); nullableUInt8Array.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUInt8Array", "TestNamespace") }); + var nullableUInt8NestedCollection = runtimeEntityType.AddProperty( + "NullableUInt8NestedCollection", + typeof(byte?[][]), + propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("NullableUInt8NestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + nullableUInt8NestedCollection.SetGetter( + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUInt8NestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUInt8NestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUInt8NestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUInt8NestedCollection(instance) == null); + nullableUInt8NestedCollection.SetSetter( + (CompiledModelTestBase.ManyTypes entity, Nullable[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUInt8NestedCollection(entity) = value); + nullableUInt8NestedCollection.SetMaterializationSetter( + (CompiledModelTestBase.ManyTypes entity, Nullable[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUInt8NestedCollection(entity) = value); + nullableUInt8NestedCollection.SetAccessors( + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUInt8NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUInt8NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => entry.ReadOriginalValue[][]>(nullableUInt8NestedCollection, 214), + (InternalEntityEntry entry) => entry.GetCurrentValue[][]>(nullableUInt8NestedCollection), + (ValueBuffer valueBuffer) => valueBuffer[214]); + nullableUInt8NestedCollection.SetPropertyIndexes( + index: 214, + originalValueIndex: 214, + shadowIndex: -1, + relationshipIndex: -1, + storeGenerationIndex: -1); + nullableUInt8NestedCollection.TypeMapping = SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfReferenceTypesComparer(new ListOfNullableValueTypesComparer(new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (byte)v1 == (byte)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(byte)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(byte)v : default(Nullable)))), + keyComparer: new ListOfReferenceTypesComparer(new ListOfNullableValueTypesComparer(new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (byte)v1 == (byte)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(byte)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(byte)v : default(Nullable)))), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfNullableStructsReaderWriter( + JsonByteReaderWriter.Instance))), + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfNullableStructsReaderWriter( + JsonByteReaderWriter.Instance)), + elementMapping: SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfNullableValueTypesComparer(new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (byte)v1 == (byte)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(byte)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(byte)v : default(Nullable))), + keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (byte)v1 == (byte)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(byte)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(byte)v : default(Nullable))), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter( + JsonByteReaderWriter.Instance)), + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter( + JsonByteReaderWriter.Instance), + elementMapping: ByteTypeMapping.Default.Clone( + comparer: new ValueComparer( + (byte v1, byte v2) => v1 == v2, + (byte v) => (int)v, + (byte v) => v), + keyComparer: new ValueComparer( + (byte v1, byte v2) => v1 == v2, + (byte v) => (int)v, + (byte v) => v), + providerValueComparer: new ValueComparer( + (byte v1, byte v2) => v1 == v2, + (byte v) => (int)v, + (byte v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "INTEGER")))); + nullableUInt8NestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUInt8NestedCollection", "TestNamespace") }); + var nullableUri = runtimeEntityType.AddProperty( "NullableUri", typeof(Uri), @@ -11426,35 +13295,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableUri.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUri((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUri((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(nullableUri, 195), + (InternalEntityEntry entry) => entry.ReadOriginalValue(nullableUri, 215), (InternalEntityEntry entry) => entry.GetCurrentValue(nullableUri), - (ValueBuffer valueBuffer) => valueBuffer[195]); + (ValueBuffer valueBuffer) => valueBuffer[215]); nullableUri.SetPropertyIndexes( - index: 195, - originalValueIndex: 195, + index: 215, + originalValueIndex: 215, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableUri.TypeMapping = SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (Uri v1, Uri v2) => v1 == v2, - (Uri v) => v.GetHashCode(), + (Uri v) => ((object)v).GetHashCode(), (Uri v) => v), keyComparer: new ValueComparer( (Uri v1, Uri v2) => v1 == v2, - (Uri v) => v.GetHashCode(), + (Uri v) => ((object)v).GetHashCode(), (Uri v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), converter: new ValueConverter( - (Uri v) => v.ToString(), + (Uri v) => ((object)v).ToString(), (string v) => new Uri(v, UriKind.RelativeOrAbsolute)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (Uri v) => v.ToString(), + (Uri v) => ((object)v).ToString(), (string v) => new Uri(v, UriKind.RelativeOrAbsolute)))); nullableUri.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUri", "TestNamespace") }); @@ -11475,60 +13344,60 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableUriArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUriArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUriArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(nullableUriArray, 196), + (InternalEntityEntry entry) => entry.ReadOriginalValue(nullableUriArray, 216), (InternalEntityEntry entry) => entry.GetCurrentValue(nullableUriArray), - (ValueBuffer valueBuffer) => valueBuffer[196]); + (ValueBuffer valueBuffer) => valueBuffer[216]); nullableUriArray.SetPropertyIndexes( - index: 196, - originalValueIndex: 196, + index: 216, + originalValueIndex: 216, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableUriArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfReferenceTypesComparer(new ValueComparer( (Uri v1, Uri v2) => v1 == v2, - (Uri v) => v.GetHashCode(), + (Uri v) => ((object)v).GetHashCode(), (Uri v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( (Uri v1, Uri v2) => v1 == v2, - (Uri v) => v.GetHashCode(), + (Uri v) => ((object)v).GetHashCode(), (Uri v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (Uri v) => v.ToString(), + (Uri v) => ((object)v).ToString(), (string v) => new Uri(v, UriKind.RelativeOrAbsolute))))), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (Uri v) => v.ToString(), + (Uri v) => ((object)v).ToString(), (string v) => new Uri(v, UriKind.RelativeOrAbsolute)))), elementMapping: SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (Uri v1, Uri v2) => v1 == v2, - (Uri v) => v.GetHashCode(), + (Uri v) => ((object)v).GetHashCode(), (Uri v) => v), keyComparer: new ValueComparer( (Uri v1, Uri v2) => v1 == v2, - (Uri v) => v.GetHashCode(), + (Uri v) => ((object)v).GetHashCode(), (Uri v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), converter: new ValueConverter( - (Uri v) => v.ToString(), + (Uri v) => ((object)v).ToString(), (string v) => new Uri(v, UriKind.RelativeOrAbsolute)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (Uri v) => v.ToString(), + (Uri v) => ((object)v).ToString(), (string v) => new Uri(v, UriKind.RelativeOrAbsolute))))); nullableUriArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUriArray", "TestNamespace") }); @@ -11549,37 +13418,37 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas physicalAddress.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_PhysicalAddress((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_PhysicalAddress((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(physicalAddress, 197), + (InternalEntityEntry entry) => entry.ReadOriginalValue(physicalAddress, 217), (InternalEntityEntry entry) => entry.GetCurrentValue(physicalAddress), - (ValueBuffer valueBuffer) => valueBuffer[197]); + (ValueBuffer valueBuffer) => valueBuffer[217]); physicalAddress.SetPropertyIndexes( - index: 197, - originalValueIndex: 197, + index: 217, + originalValueIndex: 217, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); physicalAddress.TypeMapping = SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), - (PhysicalAddress v) => v.GetHashCode(), + (PhysicalAddress v) => ((object)v).GetHashCode(), (PhysicalAddress v) => v), keyComparer: new ValueComparer( (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), - (PhysicalAddress v) => v.GetHashCode(), + (PhysicalAddress v) => ((object)v).GetHashCode(), (PhysicalAddress v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( size: 20), converter: new ValueConverter( - (PhysicalAddress v) => v.ToString(), + (PhysicalAddress v) => ((object)v).ToString(), (string v) => PhysicalAddress.Parse(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (PhysicalAddress v) => v.ToString(), + (PhysicalAddress v) => ((object)v).ToString(), (string v) => PhysicalAddress.Parse(v)))); physicalAddress.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_PhysicalAddress", "TestNamespace") }); @@ -11600,62 +13469,62 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas physicalAddressArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_PhysicalAddressArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_PhysicalAddressArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(physicalAddressArray, 198), + (InternalEntityEntry entry) => entry.ReadOriginalValue(physicalAddressArray, 218), (InternalEntityEntry entry) => entry.GetCurrentValue(physicalAddressArray), - (ValueBuffer valueBuffer) => valueBuffer[198]); + (ValueBuffer valueBuffer) => valueBuffer[218]); physicalAddressArray.SetPropertyIndexes( - index: 198, - originalValueIndex: 198, + index: 218, + originalValueIndex: 218, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); physicalAddressArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfReferenceTypesComparer(new ValueComparer( (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), - (PhysicalAddress v) => v.GetHashCode(), + (PhysicalAddress v) => ((object)v).GetHashCode(), (PhysicalAddress v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), - (PhysicalAddress v) => v.GetHashCode(), + (PhysicalAddress v) => ((object)v).GetHashCode(), (PhysicalAddress v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (PhysicalAddress v) => v.ToString(), + (PhysicalAddress v) => ((object)v).ToString(), (string v) => PhysicalAddress.Parse(v))))), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (PhysicalAddress v) => v.ToString(), + (PhysicalAddress v) => ((object)v).ToString(), (string v) => PhysicalAddress.Parse(v)))), elementMapping: SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), - (PhysicalAddress v) => v.GetHashCode(), + (PhysicalAddress v) => ((object)v).GetHashCode(), (PhysicalAddress v) => v), keyComparer: new ValueComparer( (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), - (PhysicalAddress v) => v.GetHashCode(), + (PhysicalAddress v) => ((object)v).GetHashCode(), (PhysicalAddress v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( size: 20), converter: new ValueConverter( - (PhysicalAddress v) => v.ToString(), + (PhysicalAddress v) => ((object)v).ToString(), (string v) => PhysicalAddress.Parse(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (PhysicalAddress v) => v.ToString(), + (PhysicalAddress v) => ((object)v).ToString(), (string v) => PhysicalAddress.Parse(v))))); physicalAddressArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_PhysicalAddressArray", "TestNamespace") }); @@ -11677,23 +13546,23 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas physicalAddressToBytesConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_PhysicalAddressToBytesConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_PhysicalAddressToBytesConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(physicalAddressToBytesConverterProperty, 199), + (InternalEntityEntry entry) => entry.ReadOriginalValue(physicalAddressToBytesConverterProperty, 219), (InternalEntityEntry entry) => entry.GetCurrentValue(physicalAddressToBytesConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[199]); + (ValueBuffer valueBuffer) => valueBuffer[219]); physicalAddressToBytesConverterProperty.SetPropertyIndexes( - index: 199, - originalValueIndex: 199, + index: 219, + originalValueIndex: 219, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); physicalAddressToBytesConverterProperty.TypeMapping = SqliteByteArrayTypeMapping.Default.Clone( comparer: new ValueComparer( (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), - (PhysicalAddress v) => v.GetHashCode(), + (PhysicalAddress v) => ((object)v).GetHashCode(), (PhysicalAddress v) => v), keyComparer: new ValueComparer( (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), - (PhysicalAddress v) => v.GetHashCode(), + (PhysicalAddress v) => ((object)v).GetHashCode(), (PhysicalAddress v) => v), providerValueComparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), @@ -11729,37 +13598,37 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas physicalAddressToStringConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_PhysicalAddressToStringConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_PhysicalAddressToStringConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(physicalAddressToStringConverterProperty, 200), + (InternalEntityEntry entry) => entry.ReadOriginalValue(physicalAddressToStringConverterProperty, 220), (InternalEntityEntry entry) => entry.GetCurrentValue(physicalAddressToStringConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[200]); + (ValueBuffer valueBuffer) => valueBuffer[220]); physicalAddressToStringConverterProperty.SetPropertyIndexes( - index: 200, - originalValueIndex: 200, + index: 220, + originalValueIndex: 220, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); physicalAddressToStringConverterProperty.TypeMapping = SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), - (PhysicalAddress v) => v.GetHashCode(), + (PhysicalAddress v) => ((object)v).GetHashCode(), (PhysicalAddress v) => v), keyComparer: new ValueComparer( (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), - (PhysicalAddress v) => v.GetHashCode(), + (PhysicalAddress v) => ((object)v).GetHashCode(), (PhysicalAddress v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( size: 20), converter: new ValueConverter( - (PhysicalAddress v) => v.ToString(), + (PhysicalAddress v) => ((object)v).ToString(), (string v) => PhysicalAddress.Parse(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (PhysicalAddress v) => v.ToString(), + (PhysicalAddress v) => ((object)v).ToString(), (string v) => PhysicalAddress.Parse(v)))); physicalAddressToStringConverterProperty.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_PhysicalAddressToStringConverterProperty", "TestNamespace") }); @@ -11780,12 +13649,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas @string.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_String((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_String((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(@string, 201), + (InternalEntityEntry entry) => entry.ReadOriginalValue(@string, 221), (InternalEntityEntry entry) => entry.GetCurrentValue(@string), - (ValueBuffer valueBuffer) => valueBuffer[201]); + (ValueBuffer valueBuffer) => valueBuffer[221]); @string.SetPropertyIndexes( - index: 201, - originalValueIndex: 201, + index: 221, + originalValueIndex: 221, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); @@ -11809,35 +13678,100 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas stringArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(stringArray, 202), + (InternalEntityEntry entry) => entry.ReadOriginalValue(stringArray, 222), (InternalEntityEntry entry) => entry.GetCurrentValue(stringArray), - (ValueBuffer valueBuffer) => valueBuffer[202]); + (ValueBuffer valueBuffer) => valueBuffer[222]); stringArray.SetPropertyIndexes( - index: 202, - originalValueIndex: 202, + index: 222, + originalValueIndex: 222, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); stringArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfReferenceTypesComparer(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter( JsonStringReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( JsonStringReaderWriter.Instance), elementMapping: SqliteStringTypeMapping.Default); stringArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringArray", "TestNamespace") }); + var stringNestedCollection = runtimeEntityType.AddProperty( + "StringNestedCollection", + typeof(string[][]), + propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("StringNestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + stringNestedCollection.SetGetter( + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringNestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringNestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringNestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringNestedCollection(instance) == null); + stringNestedCollection.SetSetter( + (CompiledModelTestBase.ManyTypes entity, string[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringNestedCollection(entity) = value); + stringNestedCollection.SetMaterializationSetter( + (CompiledModelTestBase.ManyTypes entity, string[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringNestedCollection(entity) = value); + stringNestedCollection.SetAccessors( + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => entry.ReadOriginalValue(stringNestedCollection, 223), + (InternalEntityEntry entry) => entry.GetCurrentValue(stringNestedCollection), + (ValueBuffer valueBuffer) => valueBuffer[223]); + stringNestedCollection.SetPropertyIndexes( + index: 223, + originalValueIndex: 223, + shadowIndex: -1, + relationshipIndex: -1, + storeGenerationIndex: -1); + stringNestedCollection.TypeMapping = SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfReferenceTypesComparer(new ListOfReferenceTypesComparer(new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v))), + keyComparer: new ListOfReferenceTypesComparer(new ListOfReferenceTypesComparer(new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v))), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfReferencesReaderWriter( + JsonStringReaderWriter.Instance))), + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfReferencesReaderWriter( + JsonStringReaderWriter.Instance)), + elementMapping: SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfReferenceTypesComparer(new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v)), + keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v)), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter( + JsonStringReaderWriter.Instance)), + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( + JsonStringReaderWriter.Instance), + elementMapping: SqliteStringTypeMapping.Default)); + stringNestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringNestedCollection", "TestNamespace") }); + var stringToBoolConverterProperty = runtimeEntityType.AddProperty( "StringToBoolConverterProperty", typeof(string), @@ -11856,27 +13790,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas stringToBoolConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringToBoolConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringToBoolConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(stringToBoolConverterProperty, 203), + (InternalEntityEntry entry) => entry.ReadOriginalValue(stringToBoolConverterProperty, 224), (InternalEntityEntry entry) => entry.GetCurrentValue(stringToBoolConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[203]); + (ValueBuffer valueBuffer) => valueBuffer[224]); stringToBoolConverterProperty.SetPropertyIndexes( - index: 203, - originalValueIndex: 203, + index: 224, + originalValueIndex: 224, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); stringToBoolConverterProperty.TypeMapping = BoolTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "INTEGER"), @@ -11908,36 +13842,36 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas stringToBytesConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringToBytesConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringToBytesConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(stringToBytesConverterProperty, 204), + (InternalEntityEntry entry) => entry.ReadOriginalValue(stringToBytesConverterProperty, 225), (InternalEntityEntry entry) => entry.GetCurrentValue(stringToBytesConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[204]); + (ValueBuffer valueBuffer) => valueBuffer[225]); stringToBytesConverterProperty.SetPropertyIndexes( - index: 204, - originalValueIndex: 204, + index: 225, + originalValueIndex: 225, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); stringToBytesConverterProperty.TypeMapping = SqliteByteArrayTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), (byte[] v) => StructuralComparisons.StructuralEqualityComparer.GetHashCode((object)v), (byte[] source) => source.ToArray()), converter: new ValueConverter( - (string v) => Encoding.UTF32.GetBytes(v), - (byte[] v) => Encoding.UTF32.GetString(v)), + (string v) => Encoding.GetEncoding(12000).GetBytes(v), + (byte[] v) => Encoding.GetEncoding(12000).GetString(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( SqliteJsonByteArrayReaderWriter.Instance, new ValueConverter( - (string v) => Encoding.UTF32.GetBytes(v), - (byte[] v) => Encoding.UTF32.GetString(v)))); + (string v) => Encoding.GetEncoding(12000).GetBytes(v), + (byte[] v) => Encoding.GetEncoding(12000).GetString(v)))); stringToBytesConverterProperty.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringToBytesConverterProperty", "TestNamespace") }); var stringToCharConverterProperty = runtimeEntityType.AddProperty( @@ -11958,23 +13892,23 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas stringToCharConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringToCharConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringToCharConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(stringToCharConverterProperty, 205), + (InternalEntityEntry entry) => entry.ReadOriginalValue(stringToCharConverterProperty, 226), (InternalEntityEntry entry) => entry.GetCurrentValue(stringToCharConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[205]); + (ValueBuffer valueBuffer) => valueBuffer[226]); stringToCharConverterProperty.SetPropertyIndexes( - index: 205, - originalValueIndex: 205, + index: 226, + originalValueIndex: 226, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); stringToCharConverterProperty.TypeMapping = CharTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (char v1, char v2) => v1 == v2, @@ -12011,27 +13945,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas stringToDateOnlyConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringToDateOnlyConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringToDateOnlyConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(stringToDateOnlyConverterProperty, 206), + (InternalEntityEntry entry) => entry.ReadOriginalValue(stringToDateOnlyConverterProperty, 227), (InternalEntityEntry entry) => entry.GetCurrentValue(stringToDateOnlyConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[206]); + (ValueBuffer valueBuffer) => valueBuffer[227]); stringToDateOnlyConverterProperty.SetPropertyIndexes( - index: 206, - originalValueIndex: 206, + index: 227, + originalValueIndex: 227, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); stringToDateOnlyConverterProperty.TypeMapping = SqliteDateOnlyTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (DateOnly v1, DateOnly v2) => v1.Equals(v2), - (DateOnly v) => v.GetHashCode(), + (DateOnly v) => ((object)v).GetHashCode(), (DateOnly v) => v), mappingInfo: new RelationalTypeMappingInfo( size: 10), @@ -12063,27 +13997,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas stringToDateTimeConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringToDateTimeConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringToDateTimeConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(stringToDateTimeConverterProperty, 207), + (InternalEntityEntry entry) => entry.ReadOriginalValue(stringToDateTimeConverterProperty, 228), (InternalEntityEntry entry) => entry.GetCurrentValue(stringToDateTimeConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[207]); + (ValueBuffer valueBuffer) => valueBuffer[228]); stringToDateTimeConverterProperty.SetPropertyIndexes( - index: 207, - originalValueIndex: 207, + index: 228, + originalValueIndex: 228, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); stringToDateTimeConverterProperty.TypeMapping = SqliteDateTimeTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v), mappingInfo: new RelationalTypeMappingInfo( size: 48), @@ -12115,27 +14049,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas stringToDateTimeOffsetConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringToDateTimeOffsetConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringToDateTimeOffsetConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(stringToDateTimeOffsetConverterProperty, 208), + (InternalEntityEntry entry) => entry.ReadOriginalValue(stringToDateTimeOffsetConverterProperty, 229), (InternalEntityEntry entry) => entry.GetCurrentValue(stringToDateTimeOffsetConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[208]); + (ValueBuffer valueBuffer) => valueBuffer[229]); stringToDateTimeOffsetConverterProperty.SetPropertyIndexes( - index: 208, - originalValueIndex: 208, + index: 229, + originalValueIndex: 229, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); stringToDateTimeOffsetConverterProperty.TypeMapping = SqliteDateTimeOffsetTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (DateTimeOffset v1, DateTimeOffset v2) => v1.EqualsExact(v2), - (DateTimeOffset v) => v.GetHashCode(), + (DateTimeOffset v) => ((object)v).GetHashCode(), (DateTimeOffset v) => v), mappingInfo: new RelationalTypeMappingInfo( size: 48), @@ -12167,27 +14101,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas stringToDecimalNumberConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringToDecimalNumberConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringToDecimalNumberConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(stringToDecimalNumberConverterProperty, 209), + (InternalEntityEntry entry) => entry.ReadOriginalValue(stringToDecimalNumberConverterProperty, 230), (InternalEntityEntry entry) => entry.GetCurrentValue(stringToDecimalNumberConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[209]); + (ValueBuffer valueBuffer) => valueBuffer[230]); stringToDecimalNumberConverterProperty.SetPropertyIndexes( - index: 209, - originalValueIndex: 209, + index: 230, + originalValueIndex: 230, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); stringToDecimalNumberConverterProperty.TypeMapping = SqliteDecimalTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v), mappingInfo: new RelationalTypeMappingInfo( size: 64), @@ -12219,27 +14153,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas stringToDoubleNumberConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringToDoubleNumberConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringToDoubleNumberConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(stringToDoubleNumberConverterProperty, 210), + (InternalEntityEntry entry) => entry.ReadOriginalValue(stringToDoubleNumberConverterProperty, 231), (InternalEntityEntry entry) => entry.GetCurrentValue(stringToDoubleNumberConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[210]); + (ValueBuffer valueBuffer) => valueBuffer[231]); stringToDoubleNumberConverterProperty.SetPropertyIndexes( - index: 210, - originalValueIndex: 210, + index: 231, + originalValueIndex: 231, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); stringToDoubleNumberConverterProperty.TypeMapping = DoubleTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (double v1, double v2) => v1.Equals(v2), - (double v) => v.GetHashCode(), + (double v) => ((object)v).GetHashCode(), (double v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "REAL", @@ -12272,23 +14206,23 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas stringToEnumConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringToEnumConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringToEnumConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(stringToEnumConverterProperty, 211), + (InternalEntityEntry entry) => entry.ReadOriginalValue(stringToEnumConverterProperty, 232), (InternalEntityEntry entry) => entry.GetCurrentValue(stringToEnumConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[211]); + (ValueBuffer valueBuffer) => valueBuffer[232]); stringToEnumConverterProperty.SetPropertyIndexes( - index: 211, - originalValueIndex: 211, + index: 232, + originalValueIndex: 232, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); stringToEnumConverterProperty.TypeMapping = UIntTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (uint v1, uint v2) => v1 == v2, @@ -12298,12 +14232,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas storeTypeName: "INTEGER"), converter: new ValueConverter( (string v) => (uint)StringEnumConverter.ConvertToEnum(v), - (uint value) => ((CompiledModelTestBase.EnumU32)value).ToString()), + (uint value) => ((object)(CompiledModelTestBase.EnumU32)value).ToString()), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonUInt32ReaderWriter.Instance, new ValueConverter( (string v) => (uint)StringEnumConverter.ConvertToEnum(v), - (uint value) => ((CompiledModelTestBase.EnumU32)value).ToString()))); + (uint value) => ((object)(CompiledModelTestBase.EnumU32)value).ToString()))); stringToEnumConverterProperty.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringToEnumConverterProperty", "TestNamespace") }); var stringToGuidConverterProperty = runtimeEntityType.AddProperty( @@ -12323,12 +14257,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas stringToGuidConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringToGuidConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringToGuidConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(stringToGuidConverterProperty, 212), + (InternalEntityEntry entry) => entry.ReadOriginalValue(stringToGuidConverterProperty, 233), (InternalEntityEntry entry) => entry.GetCurrentValue(stringToGuidConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[212]); + (ValueBuffer valueBuffer) => valueBuffer[233]); stringToGuidConverterProperty.SetPropertyIndexes( - index: 212, - originalValueIndex: 212, + index: 233, + originalValueIndex: 233, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); @@ -12353,23 +14287,23 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas stringToIntNumberConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringToIntNumberConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringToIntNumberConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(stringToIntNumberConverterProperty, 213), + (InternalEntityEntry entry) => entry.ReadOriginalValue(stringToIntNumberConverterProperty, 234), (InternalEntityEntry entry) => entry.GetCurrentValue(stringToIntNumberConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[213]); + (ValueBuffer valueBuffer) => valueBuffer[234]); stringToIntNumberConverterProperty.SetPropertyIndexes( - index: 213, - originalValueIndex: 213, + index: 234, + originalValueIndex: 234, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); stringToIntNumberConverterProperty.TypeMapping = IntTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -12406,27 +14340,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas stringToTimeOnlyConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringToTimeOnlyConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringToTimeOnlyConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(stringToTimeOnlyConverterProperty, 214), + (InternalEntityEntry entry) => entry.ReadOriginalValue(stringToTimeOnlyConverterProperty, 235), (InternalEntityEntry entry) => entry.GetCurrentValue(stringToTimeOnlyConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[214]); + (ValueBuffer valueBuffer) => valueBuffer[235]); stringToTimeOnlyConverterProperty.SetPropertyIndexes( - index: 214, - originalValueIndex: 214, + index: 235, + originalValueIndex: 235, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); stringToTimeOnlyConverterProperty.TypeMapping = SqliteTimeOnlyTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (TimeOnly v1, TimeOnly v2) => v1.Equals(v2), - (TimeOnly v) => v.GetHashCode(), + (TimeOnly v) => ((object)v).GetHashCode(), (TimeOnly v) => v), mappingInfo: new RelationalTypeMappingInfo( size: 48), @@ -12458,27 +14392,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas stringToTimeSpanConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringToTimeSpanConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringToTimeSpanConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(stringToTimeSpanConverterProperty, 215), + (InternalEntityEntry entry) => entry.ReadOriginalValue(stringToTimeSpanConverterProperty, 236), (InternalEntityEntry entry) => entry.GetCurrentValue(stringToTimeSpanConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[215]); + (ValueBuffer valueBuffer) => valueBuffer[236]); stringToTimeSpanConverterProperty.SetPropertyIndexes( - index: 215, - originalValueIndex: 215, + index: 236, + originalValueIndex: 236, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); stringToTimeSpanConverterProperty.TypeMapping = TimeSpanTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (TimeSpan v1, TimeSpan v2) => v1.Equals(v2), - (TimeSpan v) => v.GetHashCode(), + (TimeSpan v) => ((object)v).GetHashCode(), (TimeSpan v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "TEXT", @@ -12511,36 +14445,36 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas stringToUriConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringToUriConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringToUriConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(stringToUriConverterProperty, 216), + (InternalEntityEntry entry) => entry.ReadOriginalValue(stringToUriConverterProperty, 237), (InternalEntityEntry entry) => entry.GetCurrentValue(stringToUriConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[216]); + (ValueBuffer valueBuffer) => valueBuffer[237]); stringToUriConverterProperty.SetPropertyIndexes( - index: 216, - originalValueIndex: 216, + index: 237, + originalValueIndex: 237, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); stringToUriConverterProperty.TypeMapping = SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), converter: new ValueConverter( - (string v) => new Uri(v, UriKind.RelativeOrAbsolute).ToString(), - (string v) => new Uri(v, UriKind.RelativeOrAbsolute).ToString()), + (string v) => ((object)new Uri(v, UriKind.RelativeOrAbsolute)).ToString(), + (string v) => ((object)new Uri(v, UriKind.RelativeOrAbsolute)).ToString()), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (string v) => new Uri(v, UriKind.RelativeOrAbsolute).ToString(), - (string v) => new Uri(v, UriKind.RelativeOrAbsolute).ToString()))); + (string v) => ((object)new Uri(v, UriKind.RelativeOrAbsolute)).ToString(), + (string v) => ((object)new Uri(v, UriKind.RelativeOrAbsolute)).ToString()))); stringToUriConverterProperty.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringToUriConverterProperty", "TestNamespace") }); var timeOnly = runtimeEntityType.AddProperty( @@ -12561,12 +14495,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas timeOnly.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_TimeOnly((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_TimeOnly((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(timeOnly, 217), + (InternalEntityEntry entry) => entry.ReadOriginalValue(timeOnly, 238), (InternalEntityEntry entry) => entry.GetCurrentValue(timeOnly), - (ValueBuffer valueBuffer) => valueBuffer[217]); + (ValueBuffer valueBuffer) => valueBuffer[238]); timeOnly.SetPropertyIndexes( - index: 217, - originalValueIndex: 217, + index: 238, + originalValueIndex: 238, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); @@ -12590,31 +14524,31 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas timeOnlyArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_TimeOnlyArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_TimeOnlyArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(timeOnlyArray, 218), + (InternalEntityEntry entry) => entry.ReadOriginalValue(timeOnlyArray, 239), (InternalEntityEntry entry) => entry.GetCurrentValue(timeOnlyArray), - (ValueBuffer valueBuffer) => valueBuffer[218]); + (ValueBuffer valueBuffer) => valueBuffer[239]); timeOnlyArray.SetPropertyIndexes( - index: 218, - originalValueIndex: 218, + index: 239, + originalValueIndex: 239, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); timeOnlyArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer(new ValueComparer( (TimeOnly v1, TimeOnly v2) => v1.Equals(v2), - (TimeOnly v) => v.GetHashCode(), + (TimeOnly v) => ((object)v).GetHashCode(), (TimeOnly v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer(new ValueComparer( (TimeOnly v1, TimeOnly v2) => v1.Equals(v2), - (TimeOnly v) => v.GetHashCode(), + (TimeOnly v) => ((object)v).GetHashCode(), (TimeOnly v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( JsonTimeOnlyReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( JsonTimeOnlyReaderWriter.Instance), elementMapping: SqliteTimeOnlyTypeMapping.Default); timeOnlyArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_TimeOnlyArray", "TestNamespace") }); @@ -12637,27 +14571,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas timeOnlyToStringConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_TimeOnlyToStringConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_TimeOnlyToStringConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(timeOnlyToStringConverterProperty, 219), + (InternalEntityEntry entry) => entry.ReadOriginalValue(timeOnlyToStringConverterProperty, 240), (InternalEntityEntry entry) => entry.GetCurrentValue(timeOnlyToStringConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[219]); + (ValueBuffer valueBuffer) => valueBuffer[240]); timeOnlyToStringConverterProperty.SetPropertyIndexes( - index: 219, - originalValueIndex: 219, + index: 240, + originalValueIndex: 240, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); timeOnlyToStringConverterProperty.TypeMapping = SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (TimeOnly v1, TimeOnly v2) => v1.Equals(v2), - (TimeOnly v) => v.GetHashCode(), + (TimeOnly v) => ((object)v).GetHashCode(), (TimeOnly v) => v), keyComparer: new ValueComparer( (TimeOnly v1, TimeOnly v2) => v1.Equals(v2), - (TimeOnly v) => v.GetHashCode(), + (TimeOnly v) => ((object)v).GetHashCode(), (TimeOnly v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( size: 48), @@ -12690,27 +14624,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas timeOnlyToTicksConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_TimeOnlyToTicksConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_TimeOnlyToTicksConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(timeOnlyToTicksConverterProperty, 220), + (InternalEntityEntry entry) => entry.ReadOriginalValue(timeOnlyToTicksConverterProperty, 241), (InternalEntityEntry entry) => entry.GetCurrentValue(timeOnlyToTicksConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[220]); + (ValueBuffer valueBuffer) => valueBuffer[241]); timeOnlyToTicksConverterProperty.SetPropertyIndexes( - index: 220, - originalValueIndex: 220, + index: 241, + originalValueIndex: 241, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); timeOnlyToTicksConverterProperty.TypeMapping = LongTypeMapping.Default.Clone( comparer: new ValueComparer( (TimeOnly v1, TimeOnly v2) => v1.Equals(v2), - (TimeOnly v) => v.GetHashCode(), + (TimeOnly v) => ((object)v).GetHashCode(), (TimeOnly v) => v), keyComparer: new ValueComparer( (TimeOnly v1, TimeOnly v2) => v1.Equals(v2), - (TimeOnly v) => v.GetHashCode(), + (TimeOnly v) => ((object)v).GetHashCode(), (TimeOnly v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "INTEGER"), @@ -12743,27 +14677,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas timeSpan.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_TimeSpan((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_TimeSpan((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(timeSpan, 221), + (InternalEntityEntry entry) => entry.ReadOriginalValue(timeSpan, 242), (InternalEntityEntry entry) => entry.GetCurrentValue(timeSpan), - (ValueBuffer valueBuffer) => valueBuffer[221]); + (ValueBuffer valueBuffer) => valueBuffer[242]); timeSpan.SetPropertyIndexes( - index: 221, - originalValueIndex: 221, + index: 242, + originalValueIndex: 242, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); timeSpan.TypeMapping = TimeSpanTypeMapping.Default.Clone( comparer: new ValueComparer( (TimeSpan v1, TimeSpan v2) => v1.Equals(v2), - (TimeSpan v) => v.GetHashCode(), + (TimeSpan v) => ((object)v).GetHashCode(), (TimeSpan v) => v), keyComparer: new ValueComparer( (TimeSpan v1, TimeSpan v2) => v1.Equals(v2), - (TimeSpan v) => v.GetHashCode(), + (TimeSpan v) => ((object)v).GetHashCode(), (TimeSpan v) => v), providerValueComparer: new ValueComparer( (TimeSpan v1, TimeSpan v2) => v1.Equals(v2), - (TimeSpan v) => v.GetHashCode(), + (TimeSpan v) => ((object)v).GetHashCode(), (TimeSpan v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "TEXT")); @@ -12786,44 +14720,44 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas timeSpanArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_TimeSpanArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_TimeSpanArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(timeSpanArray, 222), + (InternalEntityEntry entry) => entry.ReadOriginalValue(timeSpanArray, 243), (InternalEntityEntry entry) => entry.GetCurrentValue(timeSpanArray), - (ValueBuffer valueBuffer) => valueBuffer[222]); + (ValueBuffer valueBuffer) => valueBuffer[243]); timeSpanArray.SetPropertyIndexes( - index: 222, - originalValueIndex: 222, + index: 243, + originalValueIndex: 243, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); timeSpanArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer(new ValueComparer( (TimeSpan v1, TimeSpan v2) => v1.Equals(v2), - (TimeSpan v) => v.GetHashCode(), + (TimeSpan v) => ((object)v).GetHashCode(), (TimeSpan v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer(new ValueComparer( (TimeSpan v1, TimeSpan v2) => v1.Equals(v2), - (TimeSpan v) => v.GetHashCode(), + (TimeSpan v) => ((object)v).GetHashCode(), (TimeSpan v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( JsonTimeSpanReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( JsonTimeSpanReaderWriter.Instance), elementMapping: TimeSpanTypeMapping.Default.Clone( comparer: new ValueComparer( (TimeSpan v1, TimeSpan v2) => v1.Equals(v2), - (TimeSpan v) => v.GetHashCode(), + (TimeSpan v) => ((object)v).GetHashCode(), (TimeSpan v) => v), keyComparer: new ValueComparer( (TimeSpan v1, TimeSpan v2) => v1.Equals(v2), - (TimeSpan v) => v.GetHashCode(), + (TimeSpan v) => ((object)v).GetHashCode(), (TimeSpan v) => v), providerValueComparer: new ValueComparer( (TimeSpan v1, TimeSpan v2) => v1.Equals(v2), - (TimeSpan v) => v.GetHashCode(), + (TimeSpan v) => ((object)v).GetHashCode(), (TimeSpan v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "TEXT"))); @@ -12847,27 +14781,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas timeSpanToStringConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_TimeSpanToStringConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_TimeSpanToStringConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(timeSpanToStringConverterProperty, 223), + (InternalEntityEntry entry) => entry.ReadOriginalValue(timeSpanToStringConverterProperty, 244), (InternalEntityEntry entry) => entry.GetCurrentValue(timeSpanToStringConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[223]); + (ValueBuffer valueBuffer) => valueBuffer[244]); timeSpanToStringConverterProperty.SetPropertyIndexes( - index: 223, - originalValueIndex: 223, + index: 244, + originalValueIndex: 244, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); timeSpanToStringConverterProperty.TypeMapping = SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (TimeSpan v1, TimeSpan v2) => v1.Equals(v2), - (TimeSpan v) => v.GetHashCode(), + (TimeSpan v) => ((object)v).GetHashCode(), (TimeSpan v) => v), keyComparer: new ValueComparer( (TimeSpan v1, TimeSpan v2) => v1.Equals(v2), - (TimeSpan v) => v.GetHashCode(), + (TimeSpan v) => ((object)v).GetHashCode(), (TimeSpan v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( size: 48), @@ -12900,27 +14834,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas timeSpanToTicksConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_TimeSpanToTicksConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_TimeSpanToTicksConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(timeSpanToTicksConverterProperty, 224), + (InternalEntityEntry entry) => entry.ReadOriginalValue(timeSpanToTicksConverterProperty, 245), (InternalEntityEntry entry) => entry.GetCurrentValue(timeSpanToTicksConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[224]); + (ValueBuffer valueBuffer) => valueBuffer[245]); timeSpanToTicksConverterProperty.SetPropertyIndexes( - index: 224, - originalValueIndex: 224, + index: 245, + originalValueIndex: 245, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); timeSpanToTicksConverterProperty.TypeMapping = LongTypeMapping.Default.Clone( comparer: new ValueComparer( (TimeSpan v1, TimeSpan v2) => v1.Equals(v2), - (TimeSpan v) => v.GetHashCode(), + (TimeSpan v) => ((object)v).GetHashCode(), (TimeSpan v) => v), keyComparer: new ValueComparer( (TimeSpan v1, TimeSpan v2) => v1.Equals(v2), - (TimeSpan v) => v.GetHashCode(), + (TimeSpan v) => ((object)v).GetHashCode(), (TimeSpan v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "INTEGER"), @@ -12953,12 +14887,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas uInt16.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UInt16((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UInt16((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(uInt16, 225), + (InternalEntityEntry entry) => entry.ReadOriginalValue(uInt16, 246), (InternalEntityEntry entry) => entry.GetCurrentValue(uInt16), - (ValueBuffer valueBuffer) => valueBuffer[225]); + (ValueBuffer valueBuffer) => valueBuffer[246]); uInt16.SetPropertyIndexes( - index: 225, - originalValueIndex: 225, + index: 246, + originalValueIndex: 246, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); @@ -12996,31 +14930,31 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas uInt16Array.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UInt16Array((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UInt16Array((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(uInt16Array, 226), + (InternalEntityEntry entry) => entry.ReadOriginalValue(uInt16Array, 247), (InternalEntityEntry entry) => entry.GetCurrentValue(uInt16Array), - (ValueBuffer valueBuffer) => valueBuffer[226]); + (ValueBuffer valueBuffer) => valueBuffer[247]); uInt16Array.SetPropertyIndexes( - index: 226, - originalValueIndex: 226, + index: 247, + originalValueIndex: 247, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); uInt16Array.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer(new ValueComparer( (ushort v1, ushort v2) => v1 == v2, (ushort v) => (int)v, (ushort v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer(new ValueComparer( (ushort v1, ushort v2) => v1 == v2, (ushort v) => (int)v, (ushort v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( JsonUInt16ReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( JsonUInt16ReaderWriter.Instance), elementMapping: UShortTypeMapping.Default.Clone( comparer: new ValueComparer( @@ -13057,12 +14991,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas uInt32.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UInt32((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UInt32((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(uInt32, 227), + (InternalEntityEntry entry) => entry.ReadOriginalValue(uInt32, 248), (InternalEntityEntry entry) => entry.GetCurrentValue(uInt32), - (ValueBuffer valueBuffer) => valueBuffer[227]); + (ValueBuffer valueBuffer) => valueBuffer[248]); uInt32.SetPropertyIndexes( - index: 227, - originalValueIndex: 227, + index: 248, + originalValueIndex: 248, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); @@ -13100,31 +15034,31 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas uInt32Array.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UInt32Array((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UInt32Array((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(uInt32Array, 228), + (InternalEntityEntry entry) => entry.ReadOriginalValue(uInt32Array, 249), (InternalEntityEntry entry) => entry.GetCurrentValue(uInt32Array), - (ValueBuffer valueBuffer) => valueBuffer[228]); + (ValueBuffer valueBuffer) => valueBuffer[249]); uInt32Array.SetPropertyIndexes( - index: 228, - originalValueIndex: 228, + index: 249, + originalValueIndex: 249, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); uInt32Array.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer(new ValueComparer( (uint v1, uint v2) => v1 == v2, (uint v) => (int)v, (uint v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer(new ValueComparer( (uint v1, uint v2) => v1 == v2, (uint v) => (int)v, (uint v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( JsonUInt32ReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( JsonUInt32ReaderWriter.Instance), elementMapping: UIntTypeMapping.Default.Clone( comparer: new ValueComparer( @@ -13161,12 +15095,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas uInt64.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UInt64((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UInt64((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(uInt64, 229), + (InternalEntityEntry entry) => entry.ReadOriginalValue(uInt64, 250), (InternalEntityEntry entry) => entry.GetCurrentValue(uInt64), - (ValueBuffer valueBuffer) => valueBuffer[229]); + (ValueBuffer valueBuffer) => valueBuffer[250]); uInt64.SetPropertyIndexes( - index: 229, - originalValueIndex: 229, + index: 250, + originalValueIndex: 250, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); @@ -13190,31 +15124,31 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas uInt64Array.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UInt64Array((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UInt64Array((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(uInt64Array, 230), + (InternalEntityEntry entry) => entry.ReadOriginalValue(uInt64Array, 251), (InternalEntityEntry entry) => entry.GetCurrentValue(uInt64Array), - (ValueBuffer valueBuffer) => valueBuffer[230]); + (ValueBuffer valueBuffer) => valueBuffer[251]); uInt64Array.SetPropertyIndexes( - index: 230, - originalValueIndex: 230, + index: 251, + originalValueIndex: 251, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); uInt64Array.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer(new ValueComparer( (ulong v1, ulong v2) => v1 == v2, - (ulong v) => v.GetHashCode(), + (ulong v) => ((object)v).GetHashCode(), (ulong v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer(new ValueComparer( (ulong v1, ulong v2) => v1 == v2, - (ulong v) => v.GetHashCode(), + (ulong v) => ((object)v).GetHashCode(), (ulong v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( JsonUInt64ReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( JsonUInt64ReaderWriter.Instance), elementMapping: SqliteULongTypeMapping.Default); uInt64Array.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UInt64Array", "TestNamespace") }); @@ -13237,12 +15171,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas uInt8.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UInt8((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UInt8((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(uInt8, 231), + (InternalEntityEntry entry) => entry.ReadOriginalValue(uInt8, 252), (InternalEntityEntry entry) => entry.GetCurrentValue(uInt8), - (ValueBuffer valueBuffer) => valueBuffer[231]); + (ValueBuffer valueBuffer) => valueBuffer[252]); uInt8.SetPropertyIndexes( - index: 231, - originalValueIndex: 231, + index: 252, + originalValueIndex: 252, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); @@ -13280,19 +15214,19 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas uInt8Array.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UInt8Array((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UInt8Array((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(uInt8Array, 232), + (InternalEntityEntry entry) => entry.ReadOriginalValue(uInt8Array, 253), (InternalEntityEntry entry) => entry.GetCurrentValue(uInt8Array), - (ValueBuffer valueBuffer) => valueBuffer[232]); + (ValueBuffer valueBuffer) => valueBuffer[253]); uInt8Array.SetPropertyIndexes( - index: 232, - originalValueIndex: 232, + index: 253, + originalValueIndex: 253, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); uInt8Array.TypeMapping = SqliteByteArrayTypeMapping.Default.Clone( comparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), - (byte[] v) => v.GetHashCode(), + (byte[] v) => ((object)v).GetHashCode(), (byte[] v) => v), keyComparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), @@ -13304,6 +15238,64 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (byte[] source) => source.ToArray())); uInt8Array.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UInt8Array", "TestNamespace") }); + var uInt8NestedCollection = runtimeEntityType.AddProperty( + "UInt8NestedCollection", + typeof(List), + propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("UInt8NestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + uInt8NestedCollection.SetGetter( + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UInt8NestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UInt8NestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UInt8NestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UInt8NestedCollection(instance) == null); + uInt8NestedCollection.SetSetter( + (CompiledModelTestBase.ManyTypes entity, List value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UInt8NestedCollection(entity) = value); + uInt8NestedCollection.SetMaterializationSetter( + (CompiledModelTestBase.ManyTypes entity, List value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UInt8NestedCollection(entity) = value); + uInt8NestedCollection.SetAccessors( + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UInt8NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UInt8NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(uInt8NestedCollection, 254), + (InternalEntityEntry entry) => entry.GetCurrentValue>(uInt8NestedCollection), + (ValueBuffer valueBuffer) => valueBuffer[254]); + uInt8NestedCollection.SetPropertyIndexes( + index: 254, + originalValueIndex: 254, + shadowIndex: -1, + relationshipIndex: -1, + storeGenerationIndex: -1); + uInt8NestedCollection.TypeMapping = SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfReferenceTypesComparer, byte[]>(new ValueComparer( + (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), + (byte[] v) => ((object)v).GetHashCode(), + (byte[] v) => v)), + keyComparer: new ListOfReferenceTypesComparer, byte[]>(new ValueComparer( + (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), + (byte[] v) => ((object)v).GetHashCode(), + (byte[] v) => v)), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter, byte[]>( + SqliteJsonByteArrayReaderWriter.Instance)), + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter, byte[]>( + SqliteJsonByteArrayReaderWriter.Instance), + elementMapping: SqliteByteArrayTypeMapping.Default.Clone( + comparer: new ValueComparer( + (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), + (byte[] v) => ((object)v).GetHashCode(), + (byte[] v) => v), + keyComparer: new ValueComparer( + (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), + (byte[] v) => StructuralComparisons.StructuralEqualityComparer.GetHashCode((object)v), + (byte[] source) => source.ToArray()), + providerValueComparer: new ValueComparer( + (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), + (byte[] v) => StructuralComparisons.StructuralEqualityComparer.GetHashCode((object)v), + (byte[] source) => source.ToArray()))); + uInt8NestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UInt8NestedCollection", "TestNamespace") }); + var uri = runtimeEntityType.AddProperty( "Uri", typeof(Uri), @@ -13321,35 +15313,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas uri.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Uri((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Uri((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(uri, 233), + (InternalEntityEntry entry) => entry.ReadOriginalValue(uri, 255), (InternalEntityEntry entry) => entry.GetCurrentValue(uri), - (ValueBuffer valueBuffer) => valueBuffer[233]); + (ValueBuffer valueBuffer) => valueBuffer[255]); uri.SetPropertyIndexes( - index: 233, - originalValueIndex: 233, + index: 255, + originalValueIndex: 255, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); uri.TypeMapping = SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (Uri v1, Uri v2) => v1 == v2, - (Uri v) => v.GetHashCode(), + (Uri v) => ((object)v).GetHashCode(), (Uri v) => v), keyComparer: new ValueComparer( (Uri v1, Uri v2) => v1 == v2, - (Uri v) => v.GetHashCode(), + (Uri v) => ((object)v).GetHashCode(), (Uri v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), converter: new ValueConverter( - (Uri v) => v.ToString(), + (Uri v) => ((object)v).ToString(), (string v) => new Uri(v, UriKind.RelativeOrAbsolute)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (Uri v) => v.ToString(), + (Uri v) => ((object)v).ToString(), (string v) => new Uri(v, UriKind.RelativeOrAbsolute)))); uri.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Uri", "TestNamespace") }); @@ -13370,60 +15362,60 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas uriArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UriArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UriArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(uriArray, 234), + (InternalEntityEntry entry) => entry.ReadOriginalValue(uriArray, 256), (InternalEntityEntry entry) => entry.GetCurrentValue(uriArray), - (ValueBuffer valueBuffer) => valueBuffer[234]); + (ValueBuffer valueBuffer) => valueBuffer[256]); uriArray.SetPropertyIndexes( - index: 234, - originalValueIndex: 234, + index: 256, + originalValueIndex: 256, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); uriArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfReferenceTypesComparer(new ValueComparer( (Uri v1, Uri v2) => v1 == v2, - (Uri v) => v.GetHashCode(), + (Uri v) => ((object)v).GetHashCode(), (Uri v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( (Uri v1, Uri v2) => v1 == v2, - (Uri v) => v.GetHashCode(), + (Uri v) => ((object)v).GetHashCode(), (Uri v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (Uri v) => v.ToString(), + (Uri v) => ((object)v).ToString(), (string v) => new Uri(v, UriKind.RelativeOrAbsolute))))), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (Uri v) => v.ToString(), + (Uri v) => ((object)v).ToString(), (string v) => new Uri(v, UriKind.RelativeOrAbsolute)))), elementMapping: SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (Uri v1, Uri v2) => v1 == v2, - (Uri v) => v.GetHashCode(), + (Uri v) => ((object)v).GetHashCode(), (Uri v) => v), keyComparer: new ValueComparer( (Uri v1, Uri v2) => v1 == v2, - (Uri v) => v.GetHashCode(), + (Uri v) => ((object)v).GetHashCode(), (Uri v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), converter: new ValueConverter( - (Uri v) => v.ToString(), + (Uri v) => ((object)v).ToString(), (string v) => new Uri(v, UriKind.RelativeOrAbsolute)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (Uri v) => v.ToString(), + (Uri v) => ((object)v).ToString(), (string v) => new Uri(v, UriKind.RelativeOrAbsolute))))); uriArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UriArray", "TestNamespace") }); @@ -13445,35 +15437,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas uriToStringConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UriToStringConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UriToStringConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(uriToStringConverterProperty, 235), + (InternalEntityEntry entry) => entry.ReadOriginalValue(uriToStringConverterProperty, 257), (InternalEntityEntry entry) => entry.GetCurrentValue(uriToStringConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[235]); + (ValueBuffer valueBuffer) => valueBuffer[257]); uriToStringConverterProperty.SetPropertyIndexes( - index: 235, - originalValueIndex: 235, + index: 257, + originalValueIndex: 257, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); uriToStringConverterProperty.TypeMapping = SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (Uri v1, Uri v2) => v1 == v2, - (Uri v) => v.GetHashCode(), + (Uri v) => ((object)v).GetHashCode(), (Uri v) => v), keyComparer: new ValueComparer( (Uri v1, Uri v2) => v1 == v2, - (Uri v) => v.GetHashCode(), + (Uri v) => ((object)v).GetHashCode(), (Uri v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), converter: new ValueConverter( - (Uri v) => v.ToString(), + (Uri v) => ((object)v).ToString(), (string v) => new Uri(v, UriKind.RelativeOrAbsolute)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (Uri v) => v.ToString(), + (Uri v) => ((object)v).ToString(), (string v) => new Uri(v, UriKind.RelativeOrAbsolute)))); uriToStringConverterProperty.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UriToStringConverterProperty", "TestNamespace") }); @@ -13489,15 +15481,18 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) var id = runtimeEntityType.FindProperty("Id")!; var @bool = runtimeEntityType.FindProperty("Bool")!; var boolArray = runtimeEntityType.FindProperty("BoolArray")!; + var boolNestedCollection = runtimeEntityType.FindProperty("BoolNestedCollection")!; var boolToStringConverterProperty = runtimeEntityType.FindProperty("BoolToStringConverterProperty")!; var boolToTwoValuesConverterProperty = runtimeEntityType.FindProperty("BoolToTwoValuesConverterProperty")!; var boolToZeroOneConverterProperty = runtimeEntityType.FindProperty("BoolToZeroOneConverterProperty")!; var bytes = runtimeEntityType.FindProperty("Bytes")!; var bytesArray = runtimeEntityType.FindProperty("BytesArray")!; + var bytesNestedCollection = runtimeEntityType.FindProperty("BytesNestedCollection")!; var bytesToStringConverterProperty = runtimeEntityType.FindProperty("BytesToStringConverterProperty")!; var castingConverterProperty = runtimeEntityType.FindProperty("CastingConverterProperty")!; var @char = runtimeEntityType.FindProperty("Char")!; var charArray = runtimeEntityType.FindProperty("CharArray")!; + var charNestedCollection = runtimeEntityType.FindProperty("CharNestedCollection")!; var charToStringConverterProperty = runtimeEntityType.FindProperty("CharToStringConverterProperty")!; var dateOnly = runtimeEntityType.FindProperty("DateOnly")!; var dateOnlyArray = runtimeEntityType.FindProperty("DateOnlyArray")!; @@ -13530,6 +15525,7 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) var enum32AsStringArray = runtimeEntityType.FindProperty("Enum32AsStringArray")!; var enum32AsStringCollection = runtimeEntityType.FindProperty("Enum32AsStringCollection")!; var enum32Collection = runtimeEntityType.FindProperty("Enum32Collection")!; + var enum32NestedCollection = runtimeEntityType.FindProperty("Enum32NestedCollection")!; var enum64 = runtimeEntityType.FindProperty("Enum64")!; var enum64Array = runtimeEntityType.FindProperty("Enum64Array")!; var enum64AsString = runtimeEntityType.FindProperty("Enum64AsString")!; @@ -13542,6 +15538,7 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) var enum8AsStringArray = runtimeEntityType.FindProperty("Enum8AsStringArray")!; var enum8AsStringCollection = runtimeEntityType.FindProperty("Enum8AsStringCollection")!; var enum8Collection = runtimeEntityType.FindProperty("Enum8Collection")!; + var enum8NestedCollection = runtimeEntityType.FindProperty("Enum8NestedCollection")!; var enumToNumberConverterProperty = runtimeEntityType.FindProperty("EnumToNumberConverterProperty")!; var enumToStringConverterProperty = runtimeEntityType.FindProperty("EnumToStringConverterProperty")!; var enumU16 = runtimeEntityType.FindProperty("EnumU16")!; @@ -13562,6 +15559,7 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) var enumU64AsStringArray = runtimeEntityType.FindProperty("EnumU64AsStringArray")!; var enumU64AsStringCollection = runtimeEntityType.FindProperty("EnumU64AsStringCollection")!; var enumU64Collection = runtimeEntityType.FindProperty("EnumU64Collection")!; + var enumU64NestedCollection = runtimeEntityType.FindProperty("EnumU64NestedCollection")!; var enumU8 = runtimeEntityType.FindProperty("EnumU8")!; var enumU8Array = runtimeEntityType.FindProperty("EnumU8Array")!; var enumU8AsString = runtimeEntityType.FindProperty("EnumU8AsString")!; @@ -13572,6 +15570,7 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) var floatArray = runtimeEntityType.FindProperty("FloatArray")!; var guid = runtimeEntityType.FindProperty("Guid")!; var guidArray = runtimeEntityType.FindProperty("GuidArray")!; + var guidNestedCollection = runtimeEntityType.FindProperty("GuidNestedCollection")!; var guidToBytesConverterProperty = runtimeEntityType.FindProperty("GuidToBytesConverterProperty")!; var guidToStringConverterProperty = runtimeEntityType.FindProperty("GuidToStringConverterProperty")!; var iPAddress = runtimeEntityType.FindProperty("IPAddress")!; @@ -13582,10 +15581,13 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) var int16Array = runtimeEntityType.FindProperty("Int16Array")!; var int32 = runtimeEntityType.FindProperty("Int32")!; var int32Array = runtimeEntityType.FindProperty("Int32Array")!; + var int32NestedCollection = runtimeEntityType.FindProperty("Int32NestedCollection")!; var int64 = runtimeEntityType.FindProperty("Int64")!; var int64Array = runtimeEntityType.FindProperty("Int64Array")!; + var int64NestedCollection = runtimeEntityType.FindProperty("Int64NestedCollection")!; var int8 = runtimeEntityType.FindProperty("Int8")!; var int8Array = runtimeEntityType.FindProperty("Int8Array")!; + var int8NestedCollection = runtimeEntityType.FindProperty("Int8NestedCollection")!; var intNumberToBytesConverterProperty = runtimeEntityType.FindProperty("IntNumberToBytesConverterProperty")!; var intNumberToStringConverterProperty = runtimeEntityType.FindProperty("IntNumberToStringConverterProperty")!; var nullIntToNullStringConverterProperty = runtimeEntityType.FindProperty("NullIntToNullStringConverterProperty")!; @@ -13593,6 +15595,7 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) var nullableBoolArray = runtimeEntityType.FindProperty("NullableBoolArray")!; var nullableBytes = runtimeEntityType.FindProperty("NullableBytes")!; var nullableBytesArray = runtimeEntityType.FindProperty("NullableBytesArray")!; + var nullableBytesNestedCollection = runtimeEntityType.FindProperty("NullableBytesNestedCollection")!; var nullableChar = runtimeEntityType.FindProperty("NullableChar")!; var nullableCharArray = runtimeEntityType.FindProperty("NullableCharArray")!; var nullableDateOnly = runtimeEntityType.FindProperty("NullableDateOnly")!; @@ -13615,6 +15618,7 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) var nullableEnum32AsStringArray = runtimeEntityType.FindProperty("NullableEnum32AsStringArray")!; var nullableEnum32AsStringCollection = runtimeEntityType.FindProperty("NullableEnum32AsStringCollection")!; var nullableEnum32Collection = runtimeEntityType.FindProperty("NullableEnum32Collection")!; + var nullableEnum32NestedCollection = runtimeEntityType.FindProperty("NullableEnum32NestedCollection")!; var nullableEnum64 = runtimeEntityType.FindProperty("NullableEnum64")!; var nullableEnum64Array = runtimeEntityType.FindProperty("NullableEnum64Array")!; var nullableEnum64AsString = runtimeEntityType.FindProperty("NullableEnum64AsString")!; @@ -13627,6 +15631,7 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) var nullableEnum8AsStringArray = runtimeEntityType.FindProperty("NullableEnum8AsStringArray")!; var nullableEnum8AsStringCollection = runtimeEntityType.FindProperty("NullableEnum8AsStringCollection")!; var nullableEnum8Collection = runtimeEntityType.FindProperty("NullableEnum8Collection")!; + var nullableEnum8NestedCollection = runtimeEntityType.FindProperty("NullableEnum8NestedCollection")!; var nullableEnumU16 = runtimeEntityType.FindProperty("NullableEnumU16")!; var nullableEnumU16Array = runtimeEntityType.FindProperty("NullableEnumU16Array")!; var nullableEnumU16AsString = runtimeEntityType.FindProperty("NullableEnumU16AsString")!; @@ -13645,6 +15650,7 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) var nullableEnumU64AsStringArray = runtimeEntityType.FindProperty("NullableEnumU64AsStringArray")!; var nullableEnumU64AsStringCollection = runtimeEntityType.FindProperty("NullableEnumU64AsStringCollection")!; var nullableEnumU64Collection = runtimeEntityType.FindProperty("NullableEnumU64Collection")!; + var nullableEnumU64NestedCollection = runtimeEntityType.FindProperty("NullableEnumU64NestedCollection")!; var nullableEnumU8 = runtimeEntityType.FindProperty("NullableEnumU8")!; var nullableEnumU8Array = runtimeEntityType.FindProperty("NullableEnumU8Array")!; var nullableEnumU8AsString = runtimeEntityType.FindProperty("NullableEnumU8AsString")!; @@ -13655,20 +15661,25 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) var nullableFloatArray = runtimeEntityType.FindProperty("NullableFloatArray")!; var nullableGuid = runtimeEntityType.FindProperty("NullableGuid")!; var nullableGuidArray = runtimeEntityType.FindProperty("NullableGuidArray")!; + var nullableGuidNestedCollection = runtimeEntityType.FindProperty("NullableGuidNestedCollection")!; var nullableIPAddress = runtimeEntityType.FindProperty("NullableIPAddress")!; var nullableIPAddressArray = runtimeEntityType.FindProperty("NullableIPAddressArray")!; var nullableInt16 = runtimeEntityType.FindProperty("NullableInt16")!; var nullableInt16Array = runtimeEntityType.FindProperty("NullableInt16Array")!; var nullableInt32 = runtimeEntityType.FindProperty("NullableInt32")!; var nullableInt32Array = runtimeEntityType.FindProperty("NullableInt32Array")!; + var nullableInt32NestedCollection = runtimeEntityType.FindProperty("NullableInt32NestedCollection")!; var nullableInt64 = runtimeEntityType.FindProperty("NullableInt64")!; var nullableInt64Array = runtimeEntityType.FindProperty("NullableInt64Array")!; + var nullableInt64NestedCollection = runtimeEntityType.FindProperty("NullableInt64NestedCollection")!; var nullableInt8 = runtimeEntityType.FindProperty("NullableInt8")!; var nullableInt8Array = runtimeEntityType.FindProperty("NullableInt8Array")!; var nullablePhysicalAddress = runtimeEntityType.FindProperty("NullablePhysicalAddress")!; var nullablePhysicalAddressArray = runtimeEntityType.FindProperty("NullablePhysicalAddressArray")!; + var nullablePhysicalAddressNestedCollection = runtimeEntityType.FindProperty("NullablePhysicalAddressNestedCollection")!; var nullableString = runtimeEntityType.FindProperty("NullableString")!; var nullableStringArray = runtimeEntityType.FindProperty("NullableStringArray")!; + var nullableStringNestedCollection = runtimeEntityType.FindProperty("NullableStringNestedCollection")!; var nullableTimeOnly = runtimeEntityType.FindProperty("NullableTimeOnly")!; var nullableTimeOnlyArray = runtimeEntityType.FindProperty("NullableTimeOnlyArray")!; var nullableTimeSpan = runtimeEntityType.FindProperty("NullableTimeSpan")!; @@ -13681,6 +15692,7 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) var nullableUInt64Array = runtimeEntityType.FindProperty("NullableUInt64Array")!; var nullableUInt8 = runtimeEntityType.FindProperty("NullableUInt8")!; var nullableUInt8Array = runtimeEntityType.FindProperty("NullableUInt8Array")!; + var nullableUInt8NestedCollection = runtimeEntityType.FindProperty("NullableUInt8NestedCollection")!; var nullableUri = runtimeEntityType.FindProperty("NullableUri")!; var nullableUriArray = runtimeEntityType.FindProperty("NullableUriArray")!; var physicalAddress = runtimeEntityType.FindProperty("PhysicalAddress")!; @@ -13689,6 +15701,7 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) var physicalAddressToStringConverterProperty = runtimeEntityType.FindProperty("PhysicalAddressToStringConverterProperty")!; var @string = runtimeEntityType.FindProperty("String")!; var stringArray = runtimeEntityType.FindProperty("StringArray")!; + var stringNestedCollection = runtimeEntityType.FindProperty("StringNestedCollection")!; var stringToBoolConverterProperty = runtimeEntityType.FindProperty("StringToBoolConverterProperty")!; var stringToBytesConverterProperty = runtimeEntityType.FindProperty("StringToBytesConverterProperty")!; var stringToCharConverterProperty = runtimeEntityType.FindProperty("StringToCharConverterProperty")!; @@ -13719,6 +15732,7 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) var uInt64Array = runtimeEntityType.FindProperty("UInt64Array")!; var uInt8 = runtimeEntityType.FindProperty("UInt8")!; var uInt8Array = runtimeEntityType.FindProperty("UInt8Array")!; + var uInt8NestedCollection = runtimeEntityType.FindProperty("UInt8NestedCollection")!; var uri = runtimeEntityType.FindProperty("Uri")!; var uriArray = runtimeEntityType.FindProperty("UriArray")!; var uriToStringConverterProperty = runtimeEntityType.FindProperty("UriToStringConverterProperty")!; @@ -13726,24 +15740,26 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (CompiledModelTestBase.ManyTypes)source.Entity; - var liftedArg = (ISnapshot)new Snapshot(((ValueComparer)id.GetValueComparer()).Snapshot(source.GetCurrentValue(id)), ((ValueComparer)@bool.GetValueComparer()).Snapshot(source.GetCurrentValue(@bool)), (IEnumerable)source.GetCurrentValue(boolArray) == null ? null : (bool[])((ValueComparer>)boolArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(boolArray)), ((ValueComparer)boolToStringConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(boolToStringConverterProperty)), ((ValueComparer)boolToTwoValuesConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(boolToTwoValuesConverterProperty)), ((ValueComparer)boolToZeroOneConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(boolToZeroOneConverterProperty)), source.GetCurrentValue(bytes) == null ? null : ((ValueComparer)bytes.GetValueComparer()).Snapshot(source.GetCurrentValue(bytes)), (IEnumerable)source.GetCurrentValue(bytesArray) == null ? null : (byte[][])((ValueComparer>)bytesArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(bytesArray)), source.GetCurrentValue(bytesToStringConverterProperty) == null ? null : ((ValueComparer)bytesToStringConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(bytesToStringConverterProperty)), ((ValueComparer)castingConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(castingConverterProperty)), ((ValueComparer)@char.GetValueComparer()).Snapshot(source.GetCurrentValue(@char)), (IEnumerable)source.GetCurrentValue(charArray) == null ? null : (char[])((ValueComparer>)charArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(charArray)), ((ValueComparer)charToStringConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(charToStringConverterProperty)), ((ValueComparer)dateOnly.GetValueComparer()).Snapshot(source.GetCurrentValue(dateOnly)), (IEnumerable)source.GetCurrentValue(dateOnlyArray) == null ? null : (DateOnly[])((ValueComparer>)dateOnlyArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(dateOnlyArray)), ((ValueComparer)dateOnlyToStringConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(dateOnlyToStringConverterProperty)), ((ValueComparer)dateTime.GetValueComparer()).Snapshot(source.GetCurrentValue(dateTime)), (IEnumerable)source.GetCurrentValue(dateTimeArray) == null ? null : (DateTime[])((ValueComparer>)dateTimeArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(dateTimeArray)), ((ValueComparer)dateTimeOffsetToBinaryConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(dateTimeOffsetToBinaryConverterProperty)), ((ValueComparer)dateTimeOffsetToBytesConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(dateTimeOffsetToBytesConverterProperty)), ((ValueComparer)dateTimeOffsetToStringConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(dateTimeOffsetToStringConverterProperty)), ((ValueComparer)dateTimeToBinaryConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(dateTimeToBinaryConverterProperty)), ((ValueComparer)dateTimeToStringConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(dateTimeToStringConverterProperty)), ((ValueComparer)dateTimeToTicksConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(dateTimeToTicksConverterProperty)), ((ValueComparer)@decimal.GetValueComparer()).Snapshot(source.GetCurrentValue(@decimal)), (IEnumerable)source.GetCurrentValue(decimalArray) == null ? null : (decimal[])((ValueComparer>)decimalArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(decimalArray)), ((ValueComparer)decimalNumberToBytesConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(decimalNumberToBytesConverterProperty)), ((ValueComparer)decimalNumberToStringConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(decimalNumberToStringConverterProperty)), ((ValueComparer)@double.GetValueComparer()).Snapshot(source.GetCurrentValue(@double)), (IEnumerable)source.GetCurrentValue(doubleArray) == null ? null : (double[])((ValueComparer>)doubleArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(doubleArray))); + var liftedArg = (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetValueComparer()).Snapshot(source.GetCurrentValue(id)), ((ValueComparer)((IProperty)@bool).GetValueComparer()).Snapshot(source.GetCurrentValue(@bool)), (IEnumerable)source.GetCurrentValue(boolArray) == null ? null : (bool[])((ValueComparer>)((IProperty)boolArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(boolArray)), (object)source.GetCurrentValue(boolNestedCollection) == null ? null : (bool[][])((ValueComparer)((IProperty)boolNestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue(boolNestedCollection)), ((ValueComparer)((IProperty)boolToStringConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(boolToStringConverterProperty)), ((ValueComparer)((IProperty)boolToTwoValuesConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(boolToTwoValuesConverterProperty)), ((ValueComparer)((IProperty)boolToZeroOneConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(boolToZeroOneConverterProperty)), source.GetCurrentValue(bytes) == null ? null : ((ValueComparer)((IProperty)bytes).GetValueComparer()).Snapshot(source.GetCurrentValue(bytes)), (object)source.GetCurrentValue(bytesArray) == null ? null : (byte[][])((ValueComparer)((IProperty)bytesArray).GetValueComparer()).Snapshot((object)source.GetCurrentValue(bytesArray)), (object)source.GetCurrentValue(bytesNestedCollection) == null ? null : (byte[][][])((ValueComparer)((IProperty)bytesNestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue(bytesNestedCollection)), source.GetCurrentValue(bytesToStringConverterProperty) == null ? null : ((ValueComparer)((IProperty)bytesToStringConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(bytesToStringConverterProperty)), ((ValueComparer)((IProperty)castingConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(castingConverterProperty)), ((ValueComparer)((IProperty)@char).GetValueComparer()).Snapshot(source.GetCurrentValue(@char)), (IEnumerable)source.GetCurrentValue(charArray) == null ? null : (char[])((ValueComparer>)((IProperty)charArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(charArray)), (object)source.GetCurrentValue(charNestedCollection) == null ? null : (char[][])((ValueComparer)((IProperty)charNestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue(charNestedCollection)), ((ValueComparer)((IProperty)charToStringConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(charToStringConverterProperty)), ((ValueComparer)((IProperty)dateOnly).GetValueComparer()).Snapshot(source.GetCurrentValue(dateOnly)), (IEnumerable)source.GetCurrentValue(dateOnlyArray) == null ? null : (DateOnly[])((ValueComparer>)((IProperty)dateOnlyArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(dateOnlyArray)), ((ValueComparer)((IProperty)dateOnlyToStringConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(dateOnlyToStringConverterProperty)), ((ValueComparer)((IProperty)dateTime).GetValueComparer()).Snapshot(source.GetCurrentValue(dateTime)), (IEnumerable)source.GetCurrentValue(dateTimeArray) == null ? null : (DateTime[])((ValueComparer>)((IProperty)dateTimeArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(dateTimeArray)), ((ValueComparer)((IProperty)dateTimeOffsetToBinaryConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(dateTimeOffsetToBinaryConverterProperty)), ((ValueComparer)((IProperty)dateTimeOffsetToBytesConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(dateTimeOffsetToBytesConverterProperty)), ((ValueComparer)((IProperty)dateTimeOffsetToStringConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(dateTimeOffsetToStringConverterProperty)), ((ValueComparer)((IProperty)dateTimeToBinaryConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(dateTimeToBinaryConverterProperty)), ((ValueComparer)((IProperty)dateTimeToStringConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(dateTimeToStringConverterProperty)), ((ValueComparer)((IProperty)dateTimeToTicksConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(dateTimeToTicksConverterProperty)), ((ValueComparer)((IProperty)@decimal).GetValueComparer()).Snapshot(source.GetCurrentValue(@decimal)), (IEnumerable)source.GetCurrentValue(decimalArray) == null ? null : (decimal[])((ValueComparer>)((IProperty)decimalArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(decimalArray)), ((ValueComparer)((IProperty)decimalNumberToBytesConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(decimalNumberToBytesConverterProperty))); var entity0 = (CompiledModelTestBase.ManyTypes)source.Entity; - var liftedArg0 = (ISnapshot)new Snapshot, List, CompiledModelTestBase.Enum32, CompiledModelTestBase.Enum32[], CompiledModelTestBase.Enum32, CompiledModelTestBase.Enum32[], List, List, CompiledModelTestBase.Enum64, CompiledModelTestBase.Enum64[], CompiledModelTestBase.Enum64, CompiledModelTestBase.Enum64[], List, List, CompiledModelTestBase.Enum8, CompiledModelTestBase.Enum8[], CompiledModelTestBase.Enum8, CompiledModelTestBase.Enum8[], List, List, CompiledModelTestBase.Enum32, CompiledModelTestBase.Enum32, CompiledModelTestBase.EnumU16, CompiledModelTestBase.EnumU16[]>(((ValueComparer)doubleNumberToBytesConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(doubleNumberToBytesConverterProperty)), ((ValueComparer)doubleNumberToStringConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(doubleNumberToStringConverterProperty)), ((ValueComparer)enum16.GetValueComparer()).Snapshot(source.GetCurrentValue(enum16)), (IEnumerable)source.GetCurrentValue(enum16Array) == null ? null : (CompiledModelTestBase.Enum16[])((ValueComparer>)enum16Array.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enum16Array)), ((ValueComparer)enum16AsString.GetValueComparer()).Snapshot(source.GetCurrentValue(enum16AsString)), (IEnumerable)source.GetCurrentValue(enum16AsStringArray) == null ? null : (CompiledModelTestBase.Enum16[])((ValueComparer>)enum16AsStringArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enum16AsStringArray)), (IEnumerable)source.GetCurrentValue>(enum16AsStringCollection) == null ? null : (List)((ValueComparer>)enum16AsStringCollection.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enum16AsStringCollection)), (IEnumerable)source.GetCurrentValue>(enum16Collection) == null ? null : (List)((ValueComparer>)enum16Collection.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enum16Collection)), ((ValueComparer)enum32.GetValueComparer()).Snapshot(source.GetCurrentValue(enum32)), (IEnumerable)source.GetCurrentValue(enum32Array) == null ? null : (CompiledModelTestBase.Enum32[])((ValueComparer>)enum32Array.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enum32Array)), ((ValueComparer)enum32AsString.GetValueComparer()).Snapshot(source.GetCurrentValue(enum32AsString)), (IEnumerable)source.GetCurrentValue(enum32AsStringArray) == null ? null : (CompiledModelTestBase.Enum32[])((ValueComparer>)enum32AsStringArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enum32AsStringArray)), (IEnumerable)source.GetCurrentValue>(enum32AsStringCollection) == null ? null : (List)((ValueComparer>)enum32AsStringCollection.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enum32AsStringCollection)), (IEnumerable)source.GetCurrentValue>(enum32Collection) == null ? null : (List)((ValueComparer>)enum32Collection.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enum32Collection)), ((ValueComparer)enum64.GetValueComparer()).Snapshot(source.GetCurrentValue(enum64)), (IEnumerable)source.GetCurrentValue(enum64Array) == null ? null : (CompiledModelTestBase.Enum64[])((ValueComparer>)enum64Array.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enum64Array)), ((ValueComparer)enum64AsString.GetValueComparer()).Snapshot(source.GetCurrentValue(enum64AsString)), (IEnumerable)source.GetCurrentValue(enum64AsStringArray) == null ? null : (CompiledModelTestBase.Enum64[])((ValueComparer>)enum64AsStringArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enum64AsStringArray)), (IEnumerable)source.GetCurrentValue>(enum64AsStringCollection) == null ? null : (List)((ValueComparer>)enum64AsStringCollection.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enum64AsStringCollection)), (IEnumerable)source.GetCurrentValue>(enum64Collection) == null ? null : (List)((ValueComparer>)enum64Collection.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enum64Collection)), ((ValueComparer)enum8.GetValueComparer()).Snapshot(source.GetCurrentValue(enum8)), (IEnumerable)source.GetCurrentValue(enum8Array) == null ? null : (CompiledModelTestBase.Enum8[])((ValueComparer>)enum8Array.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enum8Array)), ((ValueComparer)enum8AsString.GetValueComparer()).Snapshot(source.GetCurrentValue(enum8AsString)), (IEnumerable)source.GetCurrentValue(enum8AsStringArray) == null ? null : (CompiledModelTestBase.Enum8[])((ValueComparer>)enum8AsStringArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enum8AsStringArray)), (IEnumerable)source.GetCurrentValue>(enum8AsStringCollection) == null ? null : (List)((ValueComparer>)enum8AsStringCollection.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enum8AsStringCollection)), (IEnumerable)source.GetCurrentValue>(enum8Collection) == null ? null : (List)((ValueComparer>)enum8Collection.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enum8Collection)), ((ValueComparer)enumToNumberConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(enumToNumberConverterProperty)), ((ValueComparer)enumToStringConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(enumToStringConverterProperty)), ((ValueComparer)enumU16.GetValueComparer()).Snapshot(source.GetCurrentValue(enumU16)), (IEnumerable)source.GetCurrentValue(enumU16Array) == null ? null : (CompiledModelTestBase.EnumU16[])((ValueComparer>)enumU16Array.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enumU16Array))); + var liftedArg0 = (ISnapshot)new Snapshot, List, CompiledModelTestBase.Enum32, CompiledModelTestBase.Enum32[], CompiledModelTestBase.Enum32, CompiledModelTestBase.Enum32[], List, List, List[][], CompiledModelTestBase.Enum64, CompiledModelTestBase.Enum64[], CompiledModelTestBase.Enum64, CompiledModelTestBase.Enum64[], List, List, CompiledModelTestBase.Enum8, CompiledModelTestBase.Enum8[], CompiledModelTestBase.Enum8, CompiledModelTestBase.Enum8[], List, List>(((ValueComparer)((IProperty)decimalNumberToStringConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(decimalNumberToStringConverterProperty)), ((ValueComparer)((IProperty)@double).GetValueComparer()).Snapshot(source.GetCurrentValue(@double)), (IEnumerable)source.GetCurrentValue(doubleArray) == null ? null : (double[])((ValueComparer>)((IProperty)doubleArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(doubleArray)), ((ValueComparer)((IProperty)doubleNumberToBytesConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(doubleNumberToBytesConverterProperty)), ((ValueComparer)((IProperty)doubleNumberToStringConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(doubleNumberToStringConverterProperty)), ((ValueComparer)((IProperty)enum16).GetValueComparer()).Snapshot(source.GetCurrentValue(enum16)), (IEnumerable)source.GetCurrentValue(enum16Array) == null ? null : (CompiledModelTestBase.Enum16[])((ValueComparer>)((IProperty)enum16Array).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enum16Array)), ((ValueComparer)((IProperty)enum16AsString).GetValueComparer()).Snapshot(source.GetCurrentValue(enum16AsString)), (IEnumerable)source.GetCurrentValue(enum16AsStringArray) == null ? null : (CompiledModelTestBase.Enum16[])((ValueComparer>)((IProperty)enum16AsStringArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enum16AsStringArray)), (IEnumerable)source.GetCurrentValue>(enum16AsStringCollection) == null ? null : (List)((ValueComparer>)((IProperty)enum16AsStringCollection).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enum16AsStringCollection)), (IEnumerable)source.GetCurrentValue>(enum16Collection) == null ? null : (List)((ValueComparer>)((IProperty)enum16Collection).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enum16Collection)), ((ValueComparer)((IProperty)enum32).GetValueComparer()).Snapshot(source.GetCurrentValue(enum32)), (IEnumerable)source.GetCurrentValue(enum32Array) == null ? null : (CompiledModelTestBase.Enum32[])((ValueComparer>)((IProperty)enum32Array).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enum32Array)), ((ValueComparer)((IProperty)enum32AsString).GetValueComparer()).Snapshot(source.GetCurrentValue(enum32AsString)), (IEnumerable)source.GetCurrentValue(enum32AsStringArray) == null ? null : (CompiledModelTestBase.Enum32[])((ValueComparer>)((IProperty)enum32AsStringArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enum32AsStringArray)), (IEnumerable)source.GetCurrentValue>(enum32AsStringCollection) == null ? null : (List)((ValueComparer>)((IProperty)enum32AsStringCollection).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enum32AsStringCollection)), (IEnumerable)source.GetCurrentValue>(enum32Collection) == null ? null : (List)((ValueComparer>)((IProperty)enum32Collection).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enum32Collection)), (object)source.GetCurrentValue[][]>(enum32NestedCollection) == null ? null : (List[][])((ValueComparer)((IProperty)enum32NestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue[][]>(enum32NestedCollection)), ((ValueComparer)((IProperty)enum64).GetValueComparer()).Snapshot(source.GetCurrentValue(enum64)), (IEnumerable)source.GetCurrentValue(enum64Array) == null ? null : (CompiledModelTestBase.Enum64[])((ValueComparer>)((IProperty)enum64Array).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enum64Array)), ((ValueComparer)((IProperty)enum64AsString).GetValueComparer()).Snapshot(source.GetCurrentValue(enum64AsString)), (IEnumerable)source.GetCurrentValue(enum64AsStringArray) == null ? null : (CompiledModelTestBase.Enum64[])((ValueComparer>)((IProperty)enum64AsStringArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enum64AsStringArray)), (IEnumerable)source.GetCurrentValue>(enum64AsStringCollection) == null ? null : (List)((ValueComparer>)((IProperty)enum64AsStringCollection).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enum64AsStringCollection)), (IEnumerable)source.GetCurrentValue>(enum64Collection) == null ? null : (List)((ValueComparer>)((IProperty)enum64Collection).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enum64Collection)), ((ValueComparer)((IProperty)enum8).GetValueComparer()).Snapshot(source.GetCurrentValue(enum8)), (IEnumerable)source.GetCurrentValue(enum8Array) == null ? null : (CompiledModelTestBase.Enum8[])((ValueComparer>)((IProperty)enum8Array).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enum8Array)), ((ValueComparer)((IProperty)enum8AsString).GetValueComparer()).Snapshot(source.GetCurrentValue(enum8AsString)), (IEnumerable)source.GetCurrentValue(enum8AsStringArray) == null ? null : (CompiledModelTestBase.Enum8[])((ValueComparer>)((IProperty)enum8AsStringArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enum8AsStringArray)), (IEnumerable)source.GetCurrentValue>(enum8AsStringCollection) == null ? null : (List)((ValueComparer>)((IProperty)enum8AsStringCollection).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enum8AsStringCollection)), (IEnumerable)source.GetCurrentValue>(enum8Collection) == null ? null : (List)((ValueComparer>)((IProperty)enum8Collection).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enum8Collection))); var entity1 = (CompiledModelTestBase.ManyTypes)source.Entity; - var liftedArg1 = (ISnapshot)new Snapshot, List, CompiledModelTestBase.EnumU32, CompiledModelTestBase.EnumU32[], CompiledModelTestBase.EnumU32, CompiledModelTestBase.EnumU32[], List, List, CompiledModelTestBase.EnumU64, CompiledModelTestBase.EnumU64[], CompiledModelTestBase.EnumU64, CompiledModelTestBase.EnumU64[], List, List, CompiledModelTestBase.EnumU8, CompiledModelTestBase.EnumU8[], CompiledModelTestBase.EnumU8, CompiledModelTestBase.EnumU8[], List, List, float, float[], Guid, Guid[], Guid, Guid, IPAddress, IPAddress[]>(((ValueComparer)enumU16AsString.GetValueComparer()).Snapshot(source.GetCurrentValue(enumU16AsString)), (IEnumerable)source.GetCurrentValue(enumU16AsStringArray) == null ? null : (CompiledModelTestBase.EnumU16[])((ValueComparer>)enumU16AsStringArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enumU16AsStringArray)), (IEnumerable)source.GetCurrentValue>(enumU16AsStringCollection) == null ? null : (List)((ValueComparer>)enumU16AsStringCollection.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enumU16AsStringCollection)), (IEnumerable)source.GetCurrentValue>(enumU16Collection) == null ? null : (List)((ValueComparer>)enumU16Collection.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enumU16Collection)), ((ValueComparer)enumU32.GetValueComparer()).Snapshot(source.GetCurrentValue(enumU32)), (IEnumerable)source.GetCurrentValue(enumU32Array) == null ? null : (CompiledModelTestBase.EnumU32[])((ValueComparer>)enumU32Array.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enumU32Array)), ((ValueComparer)enumU32AsString.GetValueComparer()).Snapshot(source.GetCurrentValue(enumU32AsString)), (IEnumerable)source.GetCurrentValue(enumU32AsStringArray) == null ? null : (CompiledModelTestBase.EnumU32[])((ValueComparer>)enumU32AsStringArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enumU32AsStringArray)), (IEnumerable)source.GetCurrentValue>(enumU32AsStringCollection) == null ? null : (List)((ValueComparer>)enumU32AsStringCollection.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enumU32AsStringCollection)), (IEnumerable)source.GetCurrentValue>(enumU32Collection) == null ? null : (List)((ValueComparer>)enumU32Collection.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enumU32Collection)), ((ValueComparer)enumU64.GetValueComparer()).Snapshot(source.GetCurrentValue(enumU64)), (IEnumerable)source.GetCurrentValue(enumU64Array) == null ? null : (CompiledModelTestBase.EnumU64[])((ValueComparer>)enumU64Array.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enumU64Array)), ((ValueComparer)enumU64AsString.GetValueComparer()).Snapshot(source.GetCurrentValue(enumU64AsString)), (IEnumerable)source.GetCurrentValue(enumU64AsStringArray) == null ? null : (CompiledModelTestBase.EnumU64[])((ValueComparer>)enumU64AsStringArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enumU64AsStringArray)), (IEnumerable)source.GetCurrentValue>(enumU64AsStringCollection) == null ? null : (List)((ValueComparer>)enumU64AsStringCollection.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enumU64AsStringCollection)), (IEnumerable)source.GetCurrentValue>(enumU64Collection) == null ? null : (List)((ValueComparer>)enumU64Collection.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enumU64Collection)), ((ValueComparer)enumU8.GetValueComparer()).Snapshot(source.GetCurrentValue(enumU8)), (IEnumerable)source.GetCurrentValue(enumU8Array) == null ? null : (CompiledModelTestBase.EnumU8[])((ValueComparer>)enumU8Array.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enumU8Array)), ((ValueComparer)enumU8AsString.GetValueComparer()).Snapshot(source.GetCurrentValue(enumU8AsString)), (IEnumerable)source.GetCurrentValue(enumU8AsStringArray) == null ? null : (CompiledModelTestBase.EnumU8[])((ValueComparer>)enumU8AsStringArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enumU8AsStringArray)), (IEnumerable)source.GetCurrentValue>(enumU8AsStringCollection) == null ? null : (List)((ValueComparer>)enumU8AsStringCollection.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enumU8AsStringCollection)), (IEnumerable)source.GetCurrentValue>(enumU8Collection) == null ? null : (List)((ValueComparer>)enumU8Collection.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enumU8Collection)), ((ValueComparer)@float.GetValueComparer()).Snapshot(source.GetCurrentValue(@float)), (IEnumerable)source.GetCurrentValue(floatArray) == null ? null : (float[])((ValueComparer>)floatArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(floatArray)), ((ValueComparer)guid.GetValueComparer()).Snapshot(source.GetCurrentValue(guid)), (IEnumerable)source.GetCurrentValue(guidArray) == null ? null : (Guid[])((ValueComparer>)guidArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(guidArray)), ((ValueComparer)guidToBytesConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(guidToBytesConverterProperty)), ((ValueComparer)guidToStringConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(guidToStringConverterProperty)), source.GetCurrentValue(iPAddress) == null ? null : ((ValueComparer)iPAddress.GetValueComparer()).Snapshot(source.GetCurrentValue(iPAddress)), (IEnumerable)source.GetCurrentValue(iPAddressArray) == null ? null : (IPAddress[])((ValueComparer>)iPAddressArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(iPAddressArray))); + var liftedArg1 = (ISnapshot)new Snapshot, List, CompiledModelTestBase.EnumU32, CompiledModelTestBase.EnumU32[], CompiledModelTestBase.EnumU32, CompiledModelTestBase.EnumU32[], List, List, CompiledModelTestBase.EnumU64, CompiledModelTestBase.EnumU64[], CompiledModelTestBase.EnumU64, CompiledModelTestBase.EnumU64[], List, List, CompiledModelTestBase.EnumU64[][], CompiledModelTestBase.EnumU8, CompiledModelTestBase.EnumU8[], CompiledModelTestBase.EnumU8, CompiledModelTestBase.EnumU8[], List, List, float, float[]>((object)source.GetCurrentValue(enum8NestedCollection) == null ? null : (CompiledModelTestBase.Enum8[][])((ValueComparer)((IProperty)enum8NestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue(enum8NestedCollection)), ((ValueComparer)((IProperty)enumToNumberConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(enumToNumberConverterProperty)), ((ValueComparer)((IProperty)enumToStringConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(enumToStringConverterProperty)), ((ValueComparer)((IProperty)enumU16).GetValueComparer()).Snapshot(source.GetCurrentValue(enumU16)), (IEnumerable)source.GetCurrentValue(enumU16Array) == null ? null : (CompiledModelTestBase.EnumU16[])((ValueComparer>)((IProperty)enumU16Array).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enumU16Array)), ((ValueComparer)((IProperty)enumU16AsString).GetValueComparer()).Snapshot(source.GetCurrentValue(enumU16AsString)), (IEnumerable)source.GetCurrentValue(enumU16AsStringArray) == null ? null : (CompiledModelTestBase.EnumU16[])((ValueComparer>)((IProperty)enumU16AsStringArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enumU16AsStringArray)), (IEnumerable)source.GetCurrentValue>(enumU16AsStringCollection) == null ? null : (List)((ValueComparer>)((IProperty)enumU16AsStringCollection).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enumU16AsStringCollection)), (IEnumerable)source.GetCurrentValue>(enumU16Collection) == null ? null : (List)((ValueComparer>)((IProperty)enumU16Collection).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enumU16Collection)), ((ValueComparer)((IProperty)enumU32).GetValueComparer()).Snapshot(source.GetCurrentValue(enumU32)), (IEnumerable)source.GetCurrentValue(enumU32Array) == null ? null : (CompiledModelTestBase.EnumU32[])((ValueComparer>)((IProperty)enumU32Array).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enumU32Array)), ((ValueComparer)((IProperty)enumU32AsString).GetValueComparer()).Snapshot(source.GetCurrentValue(enumU32AsString)), (IEnumerable)source.GetCurrentValue(enumU32AsStringArray) == null ? null : (CompiledModelTestBase.EnumU32[])((ValueComparer>)((IProperty)enumU32AsStringArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enumU32AsStringArray)), (IEnumerable)source.GetCurrentValue>(enumU32AsStringCollection) == null ? null : (List)((ValueComparer>)((IProperty)enumU32AsStringCollection).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enumU32AsStringCollection)), (IEnumerable)source.GetCurrentValue>(enumU32Collection) == null ? null : (List)((ValueComparer>)((IProperty)enumU32Collection).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enumU32Collection)), ((ValueComparer)((IProperty)enumU64).GetValueComparer()).Snapshot(source.GetCurrentValue(enumU64)), (IEnumerable)source.GetCurrentValue(enumU64Array) == null ? null : (CompiledModelTestBase.EnumU64[])((ValueComparer>)((IProperty)enumU64Array).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enumU64Array)), ((ValueComparer)((IProperty)enumU64AsString).GetValueComparer()).Snapshot(source.GetCurrentValue(enumU64AsString)), (IEnumerable)source.GetCurrentValue(enumU64AsStringArray) == null ? null : (CompiledModelTestBase.EnumU64[])((ValueComparer>)((IProperty)enumU64AsStringArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enumU64AsStringArray)), (IEnumerable)source.GetCurrentValue>(enumU64AsStringCollection) == null ? null : (List)((ValueComparer>)((IProperty)enumU64AsStringCollection).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enumU64AsStringCollection)), (IEnumerable)source.GetCurrentValue>(enumU64Collection) == null ? null : (List)((ValueComparer>)((IProperty)enumU64Collection).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enumU64Collection)), (object)source.GetCurrentValue(enumU64NestedCollection) == null ? null : (CompiledModelTestBase.EnumU64[][])((ValueComparer)((IProperty)enumU64NestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue(enumU64NestedCollection)), ((ValueComparer)((IProperty)enumU8).GetValueComparer()).Snapshot(source.GetCurrentValue(enumU8)), (IEnumerable)source.GetCurrentValue(enumU8Array) == null ? null : (CompiledModelTestBase.EnumU8[])((ValueComparer>)((IProperty)enumU8Array).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enumU8Array)), ((ValueComparer)((IProperty)enumU8AsString).GetValueComparer()).Snapshot(source.GetCurrentValue(enumU8AsString)), (IEnumerable)source.GetCurrentValue(enumU8AsStringArray) == null ? null : (CompiledModelTestBase.EnumU8[])((ValueComparer>)((IProperty)enumU8AsStringArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enumU8AsStringArray)), (IEnumerable)source.GetCurrentValue>(enumU8AsStringCollection) == null ? null : (List)((ValueComparer>)((IProperty)enumU8AsStringCollection).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enumU8AsStringCollection)), (IEnumerable)source.GetCurrentValue>(enumU8Collection) == null ? null : (List)((ValueComparer>)((IProperty)enumU8Collection).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enumU8Collection)), ((ValueComparer)((IProperty)@float).GetValueComparer()).Snapshot(source.GetCurrentValue(@float)), (IEnumerable)source.GetCurrentValue(floatArray) == null ? null : (float[])((ValueComparer>)((IProperty)floatArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(floatArray))); var entity2 = (CompiledModelTestBase.ManyTypes)source.Entity; - var liftedArg2 = (ISnapshot)new Snapshot, Nullable, Nullable[], byte[], byte[][], Nullable, Nullable[], Nullable, Nullable[], Nullable, Nullable[], Nullable, Nullable[], Nullable, Nullable[], Nullable, Nullable[], Nullable>(source.GetCurrentValue(iPAddressToBytesConverterProperty) == null ? null : ((ValueComparer)iPAddressToBytesConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(iPAddressToBytesConverterProperty)), source.GetCurrentValue(iPAddressToStringConverterProperty) == null ? null : ((ValueComparer)iPAddressToStringConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(iPAddressToStringConverterProperty)), ((ValueComparer)int16.GetValueComparer()).Snapshot(source.GetCurrentValue(int16)), (IEnumerable)source.GetCurrentValue(int16Array) == null ? null : (short[])((ValueComparer>)int16Array.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(int16Array)), ((ValueComparer)int32.GetValueComparer()).Snapshot(source.GetCurrentValue(int32)), (IEnumerable)source.GetCurrentValue(int32Array) == null ? null : (int[])((ValueComparer>)int32Array.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(int32Array)), ((ValueComparer)int64.GetValueComparer()).Snapshot(source.GetCurrentValue(int64)), (IEnumerable)source.GetCurrentValue(int64Array) == null ? null : (long[])((ValueComparer>)int64Array.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(int64Array)), ((ValueComparer)int8.GetValueComparer()).Snapshot(source.GetCurrentValue(int8)), (IEnumerable)source.GetCurrentValue(int8Array) == null ? null : (sbyte[])((ValueComparer>)int8Array.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(int8Array)), ((ValueComparer)intNumberToBytesConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(intNumberToBytesConverterProperty)), ((ValueComparer)intNumberToStringConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(intNumberToStringConverterProperty)), source.GetCurrentValue>(nullIntToNullStringConverterProperty) == null ? null : ((ValueComparer>)nullIntToNullStringConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullIntToNullStringConverterProperty)), source.GetCurrentValue>(nullableBool) == null ? null : ((ValueComparer>)nullableBool.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableBool)), (IEnumerable>)source.GetCurrentValue[]>(nullableBoolArray) == null ? null : (Nullable[])((ValueComparer>>)nullableBoolArray.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableBoolArray)), source.GetCurrentValue(nullableBytes) == null ? null : ((ValueComparer)nullableBytes.GetValueComparer()).Snapshot(source.GetCurrentValue(nullableBytes)), (IEnumerable)source.GetCurrentValue(nullableBytesArray) == null ? null : (byte[][])((ValueComparer>)nullableBytesArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(nullableBytesArray)), source.GetCurrentValue>(nullableChar) == null ? null : ((ValueComparer>)nullableChar.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableChar)), (IEnumerable>)source.GetCurrentValue[]>(nullableCharArray) == null ? null : (Nullable[])((ValueComparer>>)nullableCharArray.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableCharArray)), source.GetCurrentValue>(nullableDateOnly) == null ? null : ((ValueComparer>)nullableDateOnly.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableDateOnly)), (IEnumerable>)source.GetCurrentValue[]>(nullableDateOnlyArray) == null ? null : (Nullable[])((ValueComparer>>)nullableDateOnlyArray.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableDateOnlyArray)), source.GetCurrentValue>(nullableDateTime) == null ? null : ((ValueComparer>)nullableDateTime.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableDateTime)), (IEnumerable>)source.GetCurrentValue[]>(nullableDateTimeArray) == null ? null : (Nullable[])((ValueComparer>>)nullableDateTimeArray.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableDateTimeArray)), source.GetCurrentValue>(nullableDecimal) == null ? null : ((ValueComparer>)nullableDecimal.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableDecimal)), (IEnumerable>)source.GetCurrentValue[]>(nullableDecimalArray) == null ? null : (Nullable[])((ValueComparer>>)nullableDecimalArray.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableDecimalArray)), source.GetCurrentValue>(nullableDouble) == null ? null : ((ValueComparer>)nullableDouble.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableDouble)), (IEnumerable>)source.GetCurrentValue[]>(nullableDoubleArray) == null ? null : (Nullable[])((ValueComparer>>)nullableDoubleArray.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableDoubleArray)), source.GetCurrentValue>(nullableEnum16) == null ? null : ((ValueComparer>)nullableEnum16.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnum16)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnum16Array) == null ? null : (Nullable[])((ValueComparer>>)nullableEnum16Array.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnum16Array)), source.GetCurrentValue>(nullableEnum16AsString) == null ? null : ((ValueComparer>)nullableEnum16AsString.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnum16AsString))); + var liftedArg2 = (ISnapshot)new Snapshot, Guid, Guid, IPAddress, IPAddress[], IPAddress, IPAddress, short, short[], int, int[], int[][], long, long[], IList[], sbyte, sbyte[], sbyte[][][], int, int, Nullable, Nullable, Nullable[], byte[], byte[][], byte[][][], Nullable, Nullable[]>(((ValueComparer)((IProperty)guid).GetValueComparer()).Snapshot(source.GetCurrentValue(guid)), (IEnumerable)source.GetCurrentValue(guidArray) == null ? null : (Guid[])((ValueComparer>)((IProperty)guidArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(guidArray)), (object)source.GetCurrentValue>(guidNestedCollection) == null ? null : (ICollection)((ValueComparer)((IProperty)guidNestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(guidNestedCollection)), ((ValueComparer)((IProperty)guidToBytesConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(guidToBytesConverterProperty)), ((ValueComparer)((IProperty)guidToStringConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(guidToStringConverterProperty)), source.GetCurrentValue(iPAddress) == null ? null : ((ValueComparer)((IProperty)iPAddress).GetValueComparer()).Snapshot(source.GetCurrentValue(iPAddress)), (object)source.GetCurrentValue(iPAddressArray) == null ? null : (IPAddress[])((ValueComparer)((IProperty)iPAddressArray).GetValueComparer()).Snapshot((object)source.GetCurrentValue(iPAddressArray)), source.GetCurrentValue(iPAddressToBytesConverterProperty) == null ? null : ((ValueComparer)((IProperty)iPAddressToBytesConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(iPAddressToBytesConverterProperty)), source.GetCurrentValue(iPAddressToStringConverterProperty) == null ? null : ((ValueComparer)((IProperty)iPAddressToStringConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(iPAddressToStringConverterProperty)), ((ValueComparer)((IProperty)int16).GetValueComparer()).Snapshot(source.GetCurrentValue(int16)), (IEnumerable)source.GetCurrentValue(int16Array) == null ? null : (short[])((ValueComparer>)((IProperty)int16Array).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(int16Array)), ((ValueComparer)((IProperty)int32).GetValueComparer()).Snapshot(source.GetCurrentValue(int32)), (IEnumerable)source.GetCurrentValue(int32Array) == null ? null : (int[])((ValueComparer>)((IProperty)int32Array).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(int32Array)), (object)source.GetCurrentValue(int32NestedCollection) == null ? null : (int[][])((ValueComparer)((IProperty)int32NestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue(int32NestedCollection)), ((ValueComparer)((IProperty)int64).GetValueComparer()).Snapshot(source.GetCurrentValue(int64)), (IEnumerable)source.GetCurrentValue(int64Array) == null ? null : (long[])((ValueComparer>)((IProperty)int64Array).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(int64Array)), (object)source.GetCurrentValue[]>(int64NestedCollection) == null ? null : (IList[])((ValueComparer)((IProperty)int64NestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue[]>(int64NestedCollection)), ((ValueComparer)((IProperty)int8).GetValueComparer()).Snapshot(source.GetCurrentValue(int8)), (IEnumerable)source.GetCurrentValue(int8Array) == null ? null : (sbyte[])((ValueComparer>)((IProperty)int8Array).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(int8Array)), (object)source.GetCurrentValue(int8NestedCollection) == null ? null : (sbyte[][][])((ValueComparer)((IProperty)int8NestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue(int8NestedCollection)), ((ValueComparer)((IProperty)intNumberToBytesConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(intNumberToBytesConverterProperty)), ((ValueComparer)((IProperty)intNumberToStringConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(intNumberToStringConverterProperty)), source.GetCurrentValue>(nullIntToNullStringConverterProperty) == null ? null : ((ValueComparer>)((IProperty)nullIntToNullStringConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullIntToNullStringConverterProperty)), source.GetCurrentValue>(nullableBool) == null ? null : ((ValueComparer>)((IProperty)nullableBool).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableBool)), (IEnumerable>)source.GetCurrentValue[]>(nullableBoolArray) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableBoolArray).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableBoolArray)), source.GetCurrentValue(nullableBytes) == null ? null : ((ValueComparer)((IProperty)nullableBytes).GetValueComparer()).Snapshot(source.GetCurrentValue(nullableBytes)), (object)source.GetCurrentValue(nullableBytesArray) == null ? null : (byte[][])((ValueComparer)((IProperty)nullableBytesArray).GetValueComparer()).Snapshot((object)source.GetCurrentValue(nullableBytesArray)), (object)source.GetCurrentValue(nullableBytesNestedCollection) == null ? null : (byte[][][])((ValueComparer)((IProperty)nullableBytesNestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue(nullableBytesNestedCollection)), source.GetCurrentValue>(nullableChar) == null ? null : ((ValueComparer>)((IProperty)nullableChar).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableChar)), (IEnumerable>)source.GetCurrentValue[]>(nullableCharArray) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableCharArray).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableCharArray))); var entity3 = (CompiledModelTestBase.ManyTypes)source.Entity; - var liftedArg3 = (ISnapshot)new Snapshot[], List>, List>, Nullable, Nullable[], Nullable, Nullable[], List>, List>, Nullable, Nullable[], Nullable, Nullable[], List>, List>, Nullable, Nullable[], Nullable, Nullable[], List>, List>, Nullable, Nullable[], Nullable, Nullable[], List>, List>, Nullable, Nullable[], Nullable>((IEnumerable>)source.GetCurrentValue[]>(nullableEnum16AsStringArray) == null ? null : (Nullable[])((ValueComparer>>)nullableEnum16AsStringArray.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnum16AsStringArray)), (IEnumerable>)source.GetCurrentValue>>(nullableEnum16AsStringCollection) == null ? null : (List>)((ValueComparer>>)nullableEnum16AsStringCollection.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnum16AsStringCollection)), (IEnumerable>)source.GetCurrentValue>>(nullableEnum16Collection) == null ? null : (List>)((ValueComparer>>)nullableEnum16Collection.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnum16Collection)), source.GetCurrentValue>(nullableEnum32) == null ? null : ((ValueComparer>)nullableEnum32.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnum32)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnum32Array) == null ? null : (Nullable[])((ValueComparer>>)nullableEnum32Array.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnum32Array)), source.GetCurrentValue>(nullableEnum32AsString) == null ? null : ((ValueComparer>)nullableEnum32AsString.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnum32AsString)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnum32AsStringArray) == null ? null : (Nullable[])((ValueComparer>>)nullableEnum32AsStringArray.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnum32AsStringArray)), (IEnumerable>)source.GetCurrentValue>>(nullableEnum32AsStringCollection) == null ? null : (List>)((ValueComparer>>)nullableEnum32AsStringCollection.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnum32AsStringCollection)), (IEnumerable>)source.GetCurrentValue>>(nullableEnum32Collection) == null ? null : (List>)((ValueComparer>>)nullableEnum32Collection.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnum32Collection)), source.GetCurrentValue>(nullableEnum64) == null ? null : ((ValueComparer>)nullableEnum64.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnum64)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnum64Array) == null ? null : (Nullable[])((ValueComparer>>)nullableEnum64Array.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnum64Array)), source.GetCurrentValue>(nullableEnum64AsString) == null ? null : ((ValueComparer>)nullableEnum64AsString.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnum64AsString)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnum64AsStringArray) == null ? null : (Nullable[])((ValueComparer>>)nullableEnum64AsStringArray.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnum64AsStringArray)), (IEnumerable>)source.GetCurrentValue>>(nullableEnum64AsStringCollection) == null ? null : (List>)((ValueComparer>>)nullableEnum64AsStringCollection.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnum64AsStringCollection)), (IEnumerable>)source.GetCurrentValue>>(nullableEnum64Collection) == null ? null : (List>)((ValueComparer>>)nullableEnum64Collection.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnum64Collection)), source.GetCurrentValue>(nullableEnum8) == null ? null : ((ValueComparer>)nullableEnum8.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnum8)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnum8Array) == null ? null : (Nullable[])((ValueComparer>>)nullableEnum8Array.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnum8Array)), source.GetCurrentValue>(nullableEnum8AsString) == null ? null : ((ValueComparer>)nullableEnum8AsString.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnum8AsString)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnum8AsStringArray) == null ? null : (Nullable[])((ValueComparer>>)nullableEnum8AsStringArray.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnum8AsStringArray)), (IEnumerable>)source.GetCurrentValue>>(nullableEnum8AsStringCollection) == null ? null : (List>)((ValueComparer>>)nullableEnum8AsStringCollection.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnum8AsStringCollection)), (IEnumerable>)source.GetCurrentValue>>(nullableEnum8Collection) == null ? null : (List>)((ValueComparer>>)nullableEnum8Collection.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnum8Collection)), source.GetCurrentValue>(nullableEnumU16) == null ? null : ((ValueComparer>)nullableEnumU16.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnumU16)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnumU16Array) == null ? null : (Nullable[])((ValueComparer>>)nullableEnumU16Array.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnumU16Array)), source.GetCurrentValue>(nullableEnumU16AsString) == null ? null : ((ValueComparer>)nullableEnumU16AsString.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnumU16AsString)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnumU16AsStringArray) == null ? null : (Nullable[])((ValueComparer>>)nullableEnumU16AsStringArray.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnumU16AsStringArray)), (IEnumerable>)source.GetCurrentValue>>(nullableEnumU16AsStringCollection) == null ? null : (List>)((ValueComparer>>)nullableEnumU16AsStringCollection.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnumU16AsStringCollection)), (IEnumerable>)source.GetCurrentValue>>(nullableEnumU16Collection) == null ? null : (List>)((ValueComparer>>)nullableEnumU16Collection.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnumU16Collection)), source.GetCurrentValue>(nullableEnumU32) == null ? null : ((ValueComparer>)nullableEnumU32.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnumU32)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnumU32Array) == null ? null : (Nullable[])((ValueComparer>>)nullableEnumU32Array.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnumU32Array)), source.GetCurrentValue>(nullableEnumU32AsString) == null ? null : ((ValueComparer>)nullableEnumU32AsString.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnumU32AsString))); + var liftedArg3 = (ISnapshot)new Snapshot, Nullable[], Nullable, Nullable[], Nullable, Nullable[], Nullable, Nullable[], Nullable, Nullable[], Nullable, Nullable[], List>, List>, Nullable, Nullable[], Nullable, Nullable[], List>, List>, Nullable[][][], Nullable, Nullable[], Nullable, Nullable[], List>, List>, Nullable, Nullable[], Nullable>(source.GetCurrentValue>(nullableDateOnly) == null ? null : ((ValueComparer>)((IProperty)nullableDateOnly).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableDateOnly)), (IEnumerable>)source.GetCurrentValue[]>(nullableDateOnlyArray) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableDateOnlyArray).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableDateOnlyArray)), source.GetCurrentValue>(nullableDateTime) == null ? null : ((ValueComparer>)((IProperty)nullableDateTime).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableDateTime)), (IEnumerable>)source.GetCurrentValue[]>(nullableDateTimeArray) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableDateTimeArray).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableDateTimeArray)), source.GetCurrentValue>(nullableDecimal) == null ? null : ((ValueComparer>)((IProperty)nullableDecimal).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableDecimal)), (IEnumerable>)source.GetCurrentValue[]>(nullableDecimalArray) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableDecimalArray).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableDecimalArray)), source.GetCurrentValue>(nullableDouble) == null ? null : ((ValueComparer>)((IProperty)nullableDouble).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableDouble)), (IEnumerable>)source.GetCurrentValue[]>(nullableDoubleArray) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableDoubleArray).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableDoubleArray)), source.GetCurrentValue>(nullableEnum16) == null ? null : ((ValueComparer>)((IProperty)nullableEnum16).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnum16)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnum16Array) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableEnum16Array).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnum16Array)), source.GetCurrentValue>(nullableEnum16AsString) == null ? null : ((ValueComparer>)((IProperty)nullableEnum16AsString).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnum16AsString)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnum16AsStringArray) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableEnum16AsStringArray).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnum16AsStringArray)), (IEnumerable>)source.GetCurrentValue>>(nullableEnum16AsStringCollection) == null ? null : (List>)((ValueComparer>>)((IProperty)nullableEnum16AsStringCollection).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnum16AsStringCollection)), (IEnumerable>)source.GetCurrentValue>>(nullableEnum16Collection) == null ? null : (List>)((ValueComparer>>)((IProperty)nullableEnum16Collection).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnum16Collection)), source.GetCurrentValue>(nullableEnum32) == null ? null : ((ValueComparer>)((IProperty)nullableEnum32).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnum32)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnum32Array) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableEnum32Array).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnum32Array)), source.GetCurrentValue>(nullableEnum32AsString) == null ? null : ((ValueComparer>)((IProperty)nullableEnum32AsString).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnum32AsString)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnum32AsStringArray) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableEnum32AsStringArray).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnum32AsStringArray)), (IEnumerable>)source.GetCurrentValue>>(nullableEnum32AsStringCollection) == null ? null : (List>)((ValueComparer>>)((IProperty)nullableEnum32AsStringCollection).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnum32AsStringCollection)), (IEnumerable>)source.GetCurrentValue>>(nullableEnum32Collection) == null ? null : (List>)((ValueComparer>>)((IProperty)nullableEnum32Collection).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnum32Collection)), (object)source.GetCurrentValue[][][]>(nullableEnum32NestedCollection) == null ? null : (Nullable[][][])((ValueComparer)((IProperty)nullableEnum32NestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue[][][]>(nullableEnum32NestedCollection)), source.GetCurrentValue>(nullableEnum64) == null ? null : ((ValueComparer>)((IProperty)nullableEnum64).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnum64)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnum64Array) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableEnum64Array).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnum64Array)), source.GetCurrentValue>(nullableEnum64AsString) == null ? null : ((ValueComparer>)((IProperty)nullableEnum64AsString).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnum64AsString)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnum64AsStringArray) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableEnum64AsStringArray).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnum64AsStringArray)), (IEnumerable>)source.GetCurrentValue>>(nullableEnum64AsStringCollection) == null ? null : (List>)((ValueComparer>>)((IProperty)nullableEnum64AsStringCollection).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnum64AsStringCollection)), (IEnumerable>)source.GetCurrentValue>>(nullableEnum64Collection) == null ? null : (List>)((ValueComparer>>)((IProperty)nullableEnum64Collection).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnum64Collection)), source.GetCurrentValue>(nullableEnum8) == null ? null : ((ValueComparer>)((IProperty)nullableEnum8).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnum8)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnum8Array) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableEnum8Array).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnum8Array)), source.GetCurrentValue>(nullableEnum8AsString) == null ? null : ((ValueComparer>)((IProperty)nullableEnum8AsString).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnum8AsString))); var entity4 = (CompiledModelTestBase.ManyTypes)source.Entity; - var liftedArg4 = (ISnapshot)new Snapshot[], List>, List>, Nullable, Nullable[], Nullable, Nullable[], List>, List>, Nullable, Nullable[], Nullable, Nullable[], List>, List>, Nullable, Nullable[], Nullable, Nullable[], IPAddress, IPAddress[], Nullable, Nullable[], Nullable, Nullable[], Nullable, Nullable[], Nullable, Nullable[], PhysicalAddress>((IEnumerable>)source.GetCurrentValue[]>(nullableEnumU32AsStringArray) == null ? null : (Nullable[])((ValueComparer>>)nullableEnumU32AsStringArray.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnumU32AsStringArray)), (IEnumerable>)source.GetCurrentValue>>(nullableEnumU32AsStringCollection) == null ? null : (List>)((ValueComparer>>)nullableEnumU32AsStringCollection.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnumU32AsStringCollection)), (IEnumerable>)source.GetCurrentValue>>(nullableEnumU32Collection) == null ? null : (List>)((ValueComparer>>)nullableEnumU32Collection.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnumU32Collection)), source.GetCurrentValue>(nullableEnumU64) == null ? null : ((ValueComparer>)nullableEnumU64.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnumU64)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnumU64Array) == null ? null : (Nullable[])((ValueComparer>>)nullableEnumU64Array.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnumU64Array)), source.GetCurrentValue>(nullableEnumU64AsString) == null ? null : ((ValueComparer>)nullableEnumU64AsString.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnumU64AsString)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnumU64AsStringArray) == null ? null : (Nullable[])((ValueComparer>>)nullableEnumU64AsStringArray.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnumU64AsStringArray)), (IEnumerable>)source.GetCurrentValue>>(nullableEnumU64AsStringCollection) == null ? null : (List>)((ValueComparer>>)nullableEnumU64AsStringCollection.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnumU64AsStringCollection)), (IEnumerable>)source.GetCurrentValue>>(nullableEnumU64Collection) == null ? null : (List>)((ValueComparer>>)nullableEnumU64Collection.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnumU64Collection)), source.GetCurrentValue>(nullableEnumU8) == null ? null : ((ValueComparer>)nullableEnumU8.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnumU8)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnumU8Array) == null ? null : (Nullable[])((ValueComparer>>)nullableEnumU8Array.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnumU8Array)), source.GetCurrentValue>(nullableEnumU8AsString) == null ? null : ((ValueComparer>)nullableEnumU8AsString.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnumU8AsString)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnumU8AsStringArray) == null ? null : (Nullable[])((ValueComparer>>)nullableEnumU8AsStringArray.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnumU8AsStringArray)), (IEnumerable>)source.GetCurrentValue>>(nullableEnumU8AsStringCollection) == null ? null : (List>)((ValueComparer>>)nullableEnumU8AsStringCollection.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnumU8AsStringCollection)), (IEnumerable>)source.GetCurrentValue>>(nullableEnumU8Collection) == null ? null : (List>)((ValueComparer>>)nullableEnumU8Collection.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnumU8Collection)), source.GetCurrentValue>(nullableFloat) == null ? null : ((ValueComparer>)nullableFloat.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableFloat)), (IEnumerable>)source.GetCurrentValue[]>(nullableFloatArray) == null ? null : (Nullable[])((ValueComparer>>)nullableFloatArray.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableFloatArray)), source.GetCurrentValue>(nullableGuid) == null ? null : ((ValueComparer>)nullableGuid.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableGuid)), (IEnumerable>)source.GetCurrentValue[]>(nullableGuidArray) == null ? null : (Nullable[])((ValueComparer>>)nullableGuidArray.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableGuidArray)), source.GetCurrentValue(nullableIPAddress) == null ? null : ((ValueComparer)nullableIPAddress.GetValueComparer()).Snapshot(source.GetCurrentValue(nullableIPAddress)), (IEnumerable)source.GetCurrentValue(nullableIPAddressArray) == null ? null : (IPAddress[])((ValueComparer>)nullableIPAddressArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(nullableIPAddressArray)), source.GetCurrentValue>(nullableInt16) == null ? null : ((ValueComparer>)nullableInt16.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableInt16)), (IEnumerable>)source.GetCurrentValue[]>(nullableInt16Array) == null ? null : (Nullable[])((ValueComparer>>)nullableInt16Array.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableInt16Array)), source.GetCurrentValue>(nullableInt32) == null ? null : ((ValueComparer>)nullableInt32.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableInt32)), (IEnumerable>)source.GetCurrentValue[]>(nullableInt32Array) == null ? null : (Nullable[])((ValueComparer>>)nullableInt32Array.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableInt32Array)), source.GetCurrentValue>(nullableInt64) == null ? null : ((ValueComparer>)nullableInt64.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableInt64)), (IEnumerable>)source.GetCurrentValue[]>(nullableInt64Array) == null ? null : (Nullable[])((ValueComparer>>)nullableInt64Array.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableInt64Array)), source.GetCurrentValue>(nullableInt8) == null ? null : ((ValueComparer>)nullableInt8.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableInt8)), (IEnumerable>)source.GetCurrentValue[]>(nullableInt8Array) == null ? null : (Nullable[])((ValueComparer>>)nullableInt8Array.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableInt8Array)), source.GetCurrentValue(nullablePhysicalAddress) == null ? null : ((ValueComparer)nullablePhysicalAddress.GetValueComparer()).Snapshot(source.GetCurrentValue(nullablePhysicalAddress))); + var liftedArg4 = (ISnapshot)new Snapshot[], List>, List>, Nullable[][], Nullable, Nullable[], Nullable, Nullable[], List>, List>, Nullable, Nullable[], Nullable, Nullable[], List>, List>, Nullable, Nullable[], Nullable, Nullable[], List>, List>, Nullable[][], Nullable, Nullable[], Nullable, Nullable[], List>, List>, Nullable>((IEnumerable>)source.GetCurrentValue[]>(nullableEnum8AsStringArray) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableEnum8AsStringArray).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnum8AsStringArray)), (IEnumerable>)source.GetCurrentValue>>(nullableEnum8AsStringCollection) == null ? null : (List>)((ValueComparer>>)((IProperty)nullableEnum8AsStringCollection).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnum8AsStringCollection)), (IEnumerable>)source.GetCurrentValue>>(nullableEnum8Collection) == null ? null : (List>)((ValueComparer>>)((IProperty)nullableEnum8Collection).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnum8Collection)), (object)source.GetCurrentValue[][]>(nullableEnum8NestedCollection) == null ? null : (Nullable[][])((ValueComparer)((IProperty)nullableEnum8NestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue[][]>(nullableEnum8NestedCollection)), source.GetCurrentValue>(nullableEnumU16) == null ? null : ((ValueComparer>)((IProperty)nullableEnumU16).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnumU16)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnumU16Array) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableEnumU16Array).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnumU16Array)), source.GetCurrentValue>(nullableEnumU16AsString) == null ? null : ((ValueComparer>)((IProperty)nullableEnumU16AsString).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnumU16AsString)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnumU16AsStringArray) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableEnumU16AsStringArray).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnumU16AsStringArray)), (IEnumerable>)source.GetCurrentValue>>(nullableEnumU16AsStringCollection) == null ? null : (List>)((ValueComparer>>)((IProperty)nullableEnumU16AsStringCollection).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnumU16AsStringCollection)), (IEnumerable>)source.GetCurrentValue>>(nullableEnumU16Collection) == null ? null : (List>)((ValueComparer>>)((IProperty)nullableEnumU16Collection).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnumU16Collection)), source.GetCurrentValue>(nullableEnumU32) == null ? null : ((ValueComparer>)((IProperty)nullableEnumU32).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnumU32)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnumU32Array) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableEnumU32Array).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnumU32Array)), source.GetCurrentValue>(nullableEnumU32AsString) == null ? null : ((ValueComparer>)((IProperty)nullableEnumU32AsString).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnumU32AsString)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnumU32AsStringArray) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableEnumU32AsStringArray).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnumU32AsStringArray)), (IEnumerable>)source.GetCurrentValue>>(nullableEnumU32AsStringCollection) == null ? null : (List>)((ValueComparer>>)((IProperty)nullableEnumU32AsStringCollection).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnumU32AsStringCollection)), (IEnumerable>)source.GetCurrentValue>>(nullableEnumU32Collection) == null ? null : (List>)((ValueComparer>>)((IProperty)nullableEnumU32Collection).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnumU32Collection)), source.GetCurrentValue>(nullableEnumU64) == null ? null : ((ValueComparer>)((IProperty)nullableEnumU64).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnumU64)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnumU64Array) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableEnumU64Array).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnumU64Array)), source.GetCurrentValue>(nullableEnumU64AsString) == null ? null : ((ValueComparer>)((IProperty)nullableEnumU64AsString).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnumU64AsString)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnumU64AsStringArray) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableEnumU64AsStringArray).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnumU64AsStringArray)), (IEnumerable>)source.GetCurrentValue>>(nullableEnumU64AsStringCollection) == null ? null : (List>)((ValueComparer>>)((IProperty)nullableEnumU64AsStringCollection).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnumU64AsStringCollection)), (IEnumerable>)source.GetCurrentValue>>(nullableEnumU64Collection) == null ? null : (List>)((ValueComparer>>)((IProperty)nullableEnumU64Collection).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnumU64Collection)), (object)source.GetCurrentValue[][]>(nullableEnumU64NestedCollection) == null ? null : (Nullable[][])((ValueComparer)((IProperty)nullableEnumU64NestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue[][]>(nullableEnumU64NestedCollection)), source.GetCurrentValue>(nullableEnumU8) == null ? null : ((ValueComparer>)((IProperty)nullableEnumU8).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnumU8)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnumU8Array) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableEnumU8Array).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnumU8Array)), source.GetCurrentValue>(nullableEnumU8AsString) == null ? null : ((ValueComparer>)((IProperty)nullableEnumU8AsString).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnumU8AsString)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnumU8AsStringArray) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableEnumU8AsStringArray).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnumU8AsStringArray)), (IEnumerable>)source.GetCurrentValue>>(nullableEnumU8AsStringCollection) == null ? null : (List>)((ValueComparer>>)((IProperty)nullableEnumU8AsStringCollection).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnumU8AsStringCollection)), (IEnumerable>)source.GetCurrentValue>>(nullableEnumU8Collection) == null ? null : (List>)((ValueComparer>>)((IProperty)nullableEnumU8Collection).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnumU8Collection)), source.GetCurrentValue>(nullableFloat) == null ? null : ((ValueComparer>)((IProperty)nullableFloat).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableFloat))); var entity5 = (CompiledModelTestBase.ManyTypes)source.Entity; - var liftedArg5 = (ISnapshot)new Snapshot, Nullable[], Nullable, Nullable[], Nullable, Nullable[], Nullable, Nullable[], Nullable, Nullable[], Nullable, Nullable[], Uri, Uri[], PhysicalAddress, PhysicalAddress[], PhysicalAddress, PhysicalAddress, string, string[], string, string, string, string, string, string, string>((IEnumerable)source.GetCurrentValue(nullablePhysicalAddressArray) == null ? null : (PhysicalAddress[])((ValueComparer>)nullablePhysicalAddressArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(nullablePhysicalAddressArray)), source.GetCurrentValue(nullableString) == null ? null : ((ValueComparer)nullableString.GetValueComparer()).Snapshot(source.GetCurrentValue(nullableString)), (IEnumerable)source.GetCurrentValue(nullableStringArray) == null ? null : (string[])((ValueComparer>)nullableStringArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(nullableStringArray)), source.GetCurrentValue>(nullableTimeOnly) == null ? null : ((ValueComparer>)nullableTimeOnly.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableTimeOnly)), (IEnumerable>)source.GetCurrentValue[]>(nullableTimeOnlyArray) == null ? null : (Nullable[])((ValueComparer>>)nullableTimeOnlyArray.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableTimeOnlyArray)), source.GetCurrentValue>(nullableTimeSpan) == null ? null : ((ValueComparer>)nullableTimeSpan.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableTimeSpan)), (IEnumerable>)source.GetCurrentValue[]>(nullableTimeSpanArray) == null ? null : (Nullable[])((ValueComparer>>)nullableTimeSpanArray.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableTimeSpanArray)), source.GetCurrentValue>(nullableUInt16) == null ? null : ((ValueComparer>)nullableUInt16.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableUInt16)), (IEnumerable>)source.GetCurrentValue[]>(nullableUInt16Array) == null ? null : (Nullable[])((ValueComparer>>)nullableUInt16Array.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableUInt16Array)), source.GetCurrentValue>(nullableUInt32) == null ? null : ((ValueComparer>)nullableUInt32.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableUInt32)), (IEnumerable>)source.GetCurrentValue[]>(nullableUInt32Array) == null ? null : (Nullable[])((ValueComparer>>)nullableUInt32Array.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableUInt32Array)), source.GetCurrentValue>(nullableUInt64) == null ? null : ((ValueComparer>)nullableUInt64.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableUInt64)), (IEnumerable>)source.GetCurrentValue[]>(nullableUInt64Array) == null ? null : (Nullable[])((ValueComparer>>)nullableUInt64Array.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableUInt64Array)), source.GetCurrentValue>(nullableUInt8) == null ? null : ((ValueComparer>)nullableUInt8.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableUInt8)), (IEnumerable>)source.GetCurrentValue[]>(nullableUInt8Array) == null ? null : (Nullable[])((ValueComparer>>)nullableUInt8Array.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableUInt8Array)), source.GetCurrentValue(nullableUri) == null ? null : ((ValueComparer)nullableUri.GetValueComparer()).Snapshot(source.GetCurrentValue(nullableUri)), (IEnumerable)source.GetCurrentValue(nullableUriArray) == null ? null : (Uri[])((ValueComparer>)nullableUriArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(nullableUriArray)), source.GetCurrentValue(physicalAddress) == null ? null : ((ValueComparer)physicalAddress.GetValueComparer()).Snapshot(source.GetCurrentValue(physicalAddress)), (IEnumerable)source.GetCurrentValue(physicalAddressArray) == null ? null : (PhysicalAddress[])((ValueComparer>)physicalAddressArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(physicalAddressArray)), source.GetCurrentValue(physicalAddressToBytesConverterProperty) == null ? null : ((ValueComparer)physicalAddressToBytesConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(physicalAddressToBytesConverterProperty)), source.GetCurrentValue(physicalAddressToStringConverterProperty) == null ? null : ((ValueComparer)physicalAddressToStringConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(physicalAddressToStringConverterProperty)), source.GetCurrentValue(@string) == null ? null : ((ValueComparer)@string.GetValueComparer()).Snapshot(source.GetCurrentValue(@string)), (IEnumerable)source.GetCurrentValue(stringArray) == null ? null : (string[])((ValueComparer>)stringArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(stringArray)), source.GetCurrentValue(stringToBoolConverterProperty) == null ? null : ((ValueComparer)stringToBoolConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(stringToBoolConverterProperty)), source.GetCurrentValue(stringToBytesConverterProperty) == null ? null : ((ValueComparer)stringToBytesConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(stringToBytesConverterProperty)), source.GetCurrentValue(stringToCharConverterProperty) == null ? null : ((ValueComparer)stringToCharConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(stringToCharConverterProperty)), source.GetCurrentValue(stringToDateOnlyConverterProperty) == null ? null : ((ValueComparer)stringToDateOnlyConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(stringToDateOnlyConverterProperty)), source.GetCurrentValue(stringToDateTimeConverterProperty) == null ? null : ((ValueComparer)stringToDateTimeConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(stringToDateTimeConverterProperty)), source.GetCurrentValue(stringToDateTimeOffsetConverterProperty) == null ? null : ((ValueComparer)stringToDateTimeOffsetConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(stringToDateTimeOffsetConverterProperty)), source.GetCurrentValue(stringToDecimalNumberConverterProperty) == null ? null : ((ValueComparer)stringToDecimalNumberConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(stringToDecimalNumberConverterProperty))); + var liftedArg5 = (ISnapshot)new Snapshot[], Nullable, Nullable[], Nullable[][], IPAddress, IPAddress[], Nullable, Nullable[], Nullable, Nullable[], Nullable[][], Nullable, Nullable[], List[][]>, Nullable, Nullable[], PhysicalAddress, PhysicalAddress[], IEnumerable, string, string[], string[][], Nullable, Nullable[], Nullable, Nullable[], Nullable, Nullable[], Nullable, Nullable[]>((IEnumerable>)source.GetCurrentValue[]>(nullableFloatArray) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableFloatArray).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableFloatArray)), source.GetCurrentValue>(nullableGuid) == null ? null : ((ValueComparer>)((IProperty)nullableGuid).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableGuid)), (IEnumerable>)source.GetCurrentValue[]>(nullableGuidArray) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableGuidArray).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableGuidArray)), (object)source.GetCurrentValue[][]>(nullableGuidNestedCollection) == null ? null : (Nullable[][])((ValueComparer)((IProperty)nullableGuidNestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue[][]>(nullableGuidNestedCollection)), source.GetCurrentValue(nullableIPAddress) == null ? null : ((ValueComparer)((IProperty)nullableIPAddress).GetValueComparer()).Snapshot(source.GetCurrentValue(nullableIPAddress)), (object)source.GetCurrentValue(nullableIPAddressArray) == null ? null : (IPAddress[])((ValueComparer)((IProperty)nullableIPAddressArray).GetValueComparer()).Snapshot((object)source.GetCurrentValue(nullableIPAddressArray)), source.GetCurrentValue>(nullableInt16) == null ? null : ((ValueComparer>)((IProperty)nullableInt16).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableInt16)), (IEnumerable>)source.GetCurrentValue[]>(nullableInt16Array) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableInt16Array).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableInt16Array)), source.GetCurrentValue>(nullableInt32) == null ? null : ((ValueComparer>)((IProperty)nullableInt32).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableInt32)), (IEnumerable>)source.GetCurrentValue[]>(nullableInt32Array) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableInt32Array).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableInt32Array)), (object)source.GetCurrentValue[][]>(nullableInt32NestedCollection) == null ? null : (Nullable[][])((ValueComparer)((IProperty)nullableInt32NestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue[][]>(nullableInt32NestedCollection)), source.GetCurrentValue>(nullableInt64) == null ? null : ((ValueComparer>)((IProperty)nullableInt64).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableInt64)), (IEnumerable>)source.GetCurrentValue[]>(nullableInt64Array) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableInt64Array).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableInt64Array)), (object)source.GetCurrentValue[][]>>(nullableInt64NestedCollection) == null ? null : (List[][]>)((ValueComparer)((IProperty)nullableInt64NestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue[][]>>(nullableInt64NestedCollection)), source.GetCurrentValue>(nullableInt8) == null ? null : ((ValueComparer>)((IProperty)nullableInt8).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableInt8)), (IEnumerable>)source.GetCurrentValue[]>(nullableInt8Array) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableInt8Array).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableInt8Array)), source.GetCurrentValue(nullablePhysicalAddress) == null ? null : ((ValueComparer)((IProperty)nullablePhysicalAddress).GetValueComparer()).Snapshot(source.GetCurrentValue(nullablePhysicalAddress)), (object)source.GetCurrentValue(nullablePhysicalAddressArray) == null ? null : (PhysicalAddress[])((ValueComparer)((IProperty)nullablePhysicalAddressArray).GetValueComparer()).Snapshot((object)source.GetCurrentValue(nullablePhysicalAddressArray)), (object)source.GetCurrentValue>(nullablePhysicalAddressNestedCollection) == null ? null : (IEnumerable)((ValueComparer)((IProperty)nullablePhysicalAddressNestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(nullablePhysicalAddressNestedCollection)), source.GetCurrentValue(nullableString) == null ? null : ((ValueComparer)((IProperty)nullableString).GetValueComparer()).Snapshot(source.GetCurrentValue(nullableString)), (object)source.GetCurrentValue(nullableStringArray) == null ? null : (string[])((ValueComparer)((IProperty)nullableStringArray).GetValueComparer()).Snapshot((object)source.GetCurrentValue(nullableStringArray)), (object)source.GetCurrentValue(nullableStringNestedCollection) == null ? null : (string[][])((ValueComparer)((IProperty)nullableStringNestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue(nullableStringNestedCollection)), source.GetCurrentValue>(nullableTimeOnly) == null ? null : ((ValueComparer>)((IProperty)nullableTimeOnly).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableTimeOnly)), (IEnumerable>)source.GetCurrentValue[]>(nullableTimeOnlyArray) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableTimeOnlyArray).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableTimeOnlyArray)), source.GetCurrentValue>(nullableTimeSpan) == null ? null : ((ValueComparer>)((IProperty)nullableTimeSpan).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableTimeSpan)), (IEnumerable>)source.GetCurrentValue[]>(nullableTimeSpanArray) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableTimeSpanArray).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableTimeSpanArray)), source.GetCurrentValue>(nullableUInt16) == null ? null : ((ValueComparer>)((IProperty)nullableUInt16).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableUInt16)), (IEnumerable>)source.GetCurrentValue[]>(nullableUInt16Array) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableUInt16Array).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableUInt16Array)), source.GetCurrentValue>(nullableUInt32) == null ? null : ((ValueComparer>)((IProperty)nullableUInt32).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableUInt32)), (IEnumerable>)source.GetCurrentValue[]>(nullableUInt32Array) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableUInt32Array).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableUInt32Array))); var entity6 = (CompiledModelTestBase.ManyTypes)source.Entity; - return (ISnapshot)new MultiSnapshot(new ISnapshot[] { liftedArg, liftedArg0, liftedArg1, liftedArg2, liftedArg3, liftedArg4, liftedArg5, (ISnapshot)new Snapshot(source.GetCurrentValue(stringToDoubleNumberConverterProperty) == null ? null : ((ValueComparer)stringToDoubleNumberConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(stringToDoubleNumberConverterProperty)), source.GetCurrentValue(stringToEnumConverterProperty) == null ? null : ((ValueComparer)stringToEnumConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(stringToEnumConverterProperty)), source.GetCurrentValue(stringToGuidConverterProperty) == null ? null : ((ValueComparer)stringToGuidConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(stringToGuidConverterProperty)), source.GetCurrentValue(stringToIntNumberConverterProperty) == null ? null : ((ValueComparer)stringToIntNumberConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(stringToIntNumberConverterProperty)), source.GetCurrentValue(stringToTimeOnlyConverterProperty) == null ? null : ((ValueComparer)stringToTimeOnlyConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(stringToTimeOnlyConverterProperty)), source.GetCurrentValue(stringToTimeSpanConverterProperty) == null ? null : ((ValueComparer)stringToTimeSpanConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(stringToTimeSpanConverterProperty)), source.GetCurrentValue(stringToUriConverterProperty) == null ? null : ((ValueComparer)stringToUriConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(stringToUriConverterProperty)), ((ValueComparer)timeOnly.GetValueComparer()).Snapshot(source.GetCurrentValue(timeOnly)), (IEnumerable)source.GetCurrentValue(timeOnlyArray) == null ? null : (TimeOnly[])((ValueComparer>)timeOnlyArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(timeOnlyArray)), ((ValueComparer)timeOnlyToStringConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(timeOnlyToStringConverterProperty)), ((ValueComparer)timeOnlyToTicksConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(timeOnlyToTicksConverterProperty)), ((ValueComparer)timeSpan.GetValueComparer()).Snapshot(source.GetCurrentValue(timeSpan)), (IEnumerable)source.GetCurrentValue(timeSpanArray) == null ? null : (TimeSpan[])((ValueComparer>)timeSpanArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(timeSpanArray)), ((ValueComparer)timeSpanToStringConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(timeSpanToStringConverterProperty)), ((ValueComparer)timeSpanToTicksConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(timeSpanToTicksConverterProperty)), ((ValueComparer)uInt16.GetValueComparer()).Snapshot(source.GetCurrentValue(uInt16)), (IEnumerable)source.GetCurrentValue(uInt16Array) == null ? null : (ushort[])((ValueComparer>)uInt16Array.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(uInt16Array)), ((ValueComparer)uInt32.GetValueComparer()).Snapshot(source.GetCurrentValue(uInt32)), (IEnumerable)source.GetCurrentValue(uInt32Array) == null ? null : (uint[])((ValueComparer>)uInt32Array.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(uInt32Array)), ((ValueComparer)uInt64.GetValueComparer()).Snapshot(source.GetCurrentValue(uInt64)), (IEnumerable)source.GetCurrentValue(uInt64Array) == null ? null : (ulong[])((ValueComparer>)uInt64Array.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(uInt64Array)), ((ValueComparer)uInt8.GetValueComparer()).Snapshot(source.GetCurrentValue(uInt8)), source.GetCurrentValue(uInt8Array) == null ? null : ((ValueComparer)uInt8Array.GetValueComparer()).Snapshot(source.GetCurrentValue(uInt8Array)), source.GetCurrentValue(uri) == null ? null : ((ValueComparer)uri.GetValueComparer()).Snapshot(source.GetCurrentValue(uri)), (IEnumerable)source.GetCurrentValue(uriArray) == null ? null : (Uri[])((ValueComparer>)uriArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(uriArray)), source.GetCurrentValue(uriToStringConverterProperty) == null ? null : ((ValueComparer)uriToStringConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(uriToStringConverterProperty))) }); + var liftedArg6 = (ISnapshot)new Snapshot, Nullable[], Nullable, Nullable[], Nullable[][], Uri, Uri[], PhysicalAddress, PhysicalAddress[], PhysicalAddress, PhysicalAddress, string, string[], string[][], string, string, string, string, string, string, string, string, string, string, string, string, string, string, TimeOnly, TimeOnly[]>(source.GetCurrentValue>(nullableUInt64) == null ? null : ((ValueComparer>)((IProperty)nullableUInt64).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableUInt64)), (IEnumerable>)source.GetCurrentValue[]>(nullableUInt64Array) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableUInt64Array).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableUInt64Array)), source.GetCurrentValue>(nullableUInt8) == null ? null : ((ValueComparer>)((IProperty)nullableUInt8).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableUInt8)), (IEnumerable>)source.GetCurrentValue[]>(nullableUInt8Array) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableUInt8Array).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableUInt8Array)), (object)source.GetCurrentValue[][]>(nullableUInt8NestedCollection) == null ? null : (Nullable[][])((ValueComparer)((IProperty)nullableUInt8NestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue[][]>(nullableUInt8NestedCollection)), source.GetCurrentValue(nullableUri) == null ? null : ((ValueComparer)((IProperty)nullableUri).GetValueComparer()).Snapshot(source.GetCurrentValue(nullableUri)), (object)source.GetCurrentValue(nullableUriArray) == null ? null : (Uri[])((ValueComparer)((IProperty)nullableUriArray).GetValueComparer()).Snapshot((object)source.GetCurrentValue(nullableUriArray)), source.GetCurrentValue(physicalAddress) == null ? null : ((ValueComparer)((IProperty)physicalAddress).GetValueComparer()).Snapshot(source.GetCurrentValue(physicalAddress)), (object)source.GetCurrentValue(physicalAddressArray) == null ? null : (PhysicalAddress[])((ValueComparer)((IProperty)physicalAddressArray).GetValueComparer()).Snapshot((object)source.GetCurrentValue(physicalAddressArray)), source.GetCurrentValue(physicalAddressToBytesConverterProperty) == null ? null : ((ValueComparer)((IProperty)physicalAddressToBytesConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(physicalAddressToBytesConverterProperty)), source.GetCurrentValue(physicalAddressToStringConverterProperty) == null ? null : ((ValueComparer)((IProperty)physicalAddressToStringConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(physicalAddressToStringConverterProperty)), source.GetCurrentValue(@string) == null ? null : ((ValueComparer)((IProperty)@string).GetValueComparer()).Snapshot(source.GetCurrentValue(@string)), (object)source.GetCurrentValue(stringArray) == null ? null : (string[])((ValueComparer)((IProperty)stringArray).GetValueComparer()).Snapshot((object)source.GetCurrentValue(stringArray)), (object)source.GetCurrentValue(stringNestedCollection) == null ? null : (string[][])((ValueComparer)((IProperty)stringNestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue(stringNestedCollection)), source.GetCurrentValue(stringToBoolConverterProperty) == null ? null : ((ValueComparer)((IProperty)stringToBoolConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(stringToBoolConverterProperty)), source.GetCurrentValue(stringToBytesConverterProperty) == null ? null : ((ValueComparer)((IProperty)stringToBytesConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(stringToBytesConverterProperty)), source.GetCurrentValue(stringToCharConverterProperty) == null ? null : ((ValueComparer)((IProperty)stringToCharConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(stringToCharConverterProperty)), source.GetCurrentValue(stringToDateOnlyConverterProperty) == null ? null : ((ValueComparer)((IProperty)stringToDateOnlyConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(stringToDateOnlyConverterProperty)), source.GetCurrentValue(stringToDateTimeConverterProperty) == null ? null : ((ValueComparer)((IProperty)stringToDateTimeConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(stringToDateTimeConverterProperty)), source.GetCurrentValue(stringToDateTimeOffsetConverterProperty) == null ? null : ((ValueComparer)((IProperty)stringToDateTimeOffsetConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(stringToDateTimeOffsetConverterProperty)), source.GetCurrentValue(stringToDecimalNumberConverterProperty) == null ? null : ((ValueComparer)((IProperty)stringToDecimalNumberConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(stringToDecimalNumberConverterProperty)), source.GetCurrentValue(stringToDoubleNumberConverterProperty) == null ? null : ((ValueComparer)((IProperty)stringToDoubleNumberConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(stringToDoubleNumberConverterProperty)), source.GetCurrentValue(stringToEnumConverterProperty) == null ? null : ((ValueComparer)((IProperty)stringToEnumConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(stringToEnumConverterProperty)), source.GetCurrentValue(stringToGuidConverterProperty) == null ? null : ((ValueComparer)((IProperty)stringToGuidConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(stringToGuidConverterProperty)), source.GetCurrentValue(stringToIntNumberConverterProperty) == null ? null : ((ValueComparer)((IProperty)stringToIntNumberConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(stringToIntNumberConverterProperty)), source.GetCurrentValue(stringToTimeOnlyConverterProperty) == null ? null : ((ValueComparer)((IProperty)stringToTimeOnlyConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(stringToTimeOnlyConverterProperty)), source.GetCurrentValue(stringToTimeSpanConverterProperty) == null ? null : ((ValueComparer)((IProperty)stringToTimeSpanConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(stringToTimeSpanConverterProperty)), source.GetCurrentValue(stringToUriConverterProperty) == null ? null : ((ValueComparer)((IProperty)stringToUriConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(stringToUriConverterProperty)), ((ValueComparer)((IProperty)timeOnly).GetValueComparer()).Snapshot(source.GetCurrentValue(timeOnly)), (IEnumerable)source.GetCurrentValue(timeOnlyArray) == null ? null : (TimeOnly[])((ValueComparer>)((IProperty)timeOnlyArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(timeOnlyArray))); + var entity7 = (CompiledModelTestBase.ManyTypes)source.Entity; + return (ISnapshot)new MultiSnapshot(new ISnapshot[] { liftedArg, liftedArg0, liftedArg1, liftedArg2, liftedArg3, liftedArg4, liftedArg5, liftedArg6, (ISnapshot)new Snapshot, Uri, Uri[], Uri>(((ValueComparer)((IProperty)timeOnlyToStringConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(timeOnlyToStringConverterProperty)), ((ValueComparer)((IProperty)timeOnlyToTicksConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(timeOnlyToTicksConverterProperty)), ((ValueComparer)((IProperty)timeSpan).GetValueComparer()).Snapshot(source.GetCurrentValue(timeSpan)), (IEnumerable)source.GetCurrentValue(timeSpanArray) == null ? null : (TimeSpan[])((ValueComparer>)((IProperty)timeSpanArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(timeSpanArray)), ((ValueComparer)((IProperty)timeSpanToStringConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(timeSpanToStringConverterProperty)), ((ValueComparer)((IProperty)timeSpanToTicksConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(timeSpanToTicksConverterProperty)), ((ValueComparer)((IProperty)uInt16).GetValueComparer()).Snapshot(source.GetCurrentValue(uInt16)), (IEnumerable)source.GetCurrentValue(uInt16Array) == null ? null : (ushort[])((ValueComparer>)((IProperty)uInt16Array).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(uInt16Array)), ((ValueComparer)((IProperty)uInt32).GetValueComparer()).Snapshot(source.GetCurrentValue(uInt32)), (IEnumerable)source.GetCurrentValue(uInt32Array) == null ? null : (uint[])((ValueComparer>)((IProperty)uInt32Array).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(uInt32Array)), ((ValueComparer)((IProperty)uInt64).GetValueComparer()).Snapshot(source.GetCurrentValue(uInt64)), (IEnumerable)source.GetCurrentValue(uInt64Array) == null ? null : (ulong[])((ValueComparer>)((IProperty)uInt64Array).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(uInt64Array)), ((ValueComparer)((IProperty)uInt8).GetValueComparer()).Snapshot(source.GetCurrentValue(uInt8)), source.GetCurrentValue(uInt8Array) == null ? null : ((ValueComparer)((IProperty)uInt8Array).GetValueComparer()).Snapshot(source.GetCurrentValue(uInt8Array)), (object)source.GetCurrentValue>(uInt8NestedCollection) == null ? null : (List)((ValueComparer)((IProperty)uInt8NestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(uInt8NestedCollection)), source.GetCurrentValue(uri) == null ? null : ((ValueComparer)((IProperty)uri).GetValueComparer()).Snapshot(source.GetCurrentValue(uri)), (object)source.GetCurrentValue(uriArray) == null ? null : (Uri[])((ValueComparer)((IProperty)uriArray).GetValueComparer()).Snapshot((object)source.GetCurrentValue(uriArray)), source.GetCurrentValue(uriToStringConverterProperty) == null ? null : ((ValueComparer)((IProperty)uriToStringConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(uriToStringConverterProperty))) }); }); runtimeEntityType.SetStoreGeneratedValuesFactory( - () => (ISnapshot)new Snapshot(((ValueComparer)id.GetValueComparer()).Snapshot(default(CompiledModelTestBase.ManyTypesId)))); + () => (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetValueComparer()).Snapshot(default(CompiledModelTestBase.ManyTypesId)))); runtimeEntityType.SetTemporaryValuesFactory( (InternalEntityEntry source) => (ISnapshot)new Snapshot(default(CompiledModelTestBase.ManyTypesId))); runtimeEntityType.SetShadowValuesFactory( @@ -13753,14 +15769,14 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) runtimeEntityType.SetRelationshipSnapshotFactory( (InternalEntityEntry source) => { - var entity = (CompiledModelTestBase.ManyTypes)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)id.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(id))); + var entity8 = (CompiledModelTestBase.ManyTypes)source.Entity; + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(id))); }); runtimeEntityType.Counts = new PropertyCounts( - propertyCount: 236, + propertyCount: 258, navigationCount: 0, complexPropertyCount: 0, - originalValueCount: 236, + originalValueCount: 258, shadowCount: 0, relationshipCount: 1, storeGeneratedCount: 1); @@ -13785,6 +15801,9 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref bool[] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BoolArray(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] + public static extern ref bool[][] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BoolNestedCollection(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref bool UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BoolToStringConverterProperty(CompiledModelTestBase.ManyTypes @this); @@ -13800,6 +15819,9 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref byte[][] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BytesArray(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] + public static extern ref byte[][][] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BytesNestedCollection(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref byte[] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BytesToStringConverterProperty(CompiledModelTestBase.ManyTypes @this); @@ -13812,6 +15834,9 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref char[] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_CharArray(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] + public static extern ref char[][] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_CharNestedCollection(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref char UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_CharToStringConverterProperty(CompiledModelTestBase.ManyTypes @this); @@ -13908,6 +15933,9 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref List UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum32Collection(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] + public static extern ref List[][] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum32NestedCollection(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref CompiledModelTestBase.Enum64 UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum64(CompiledModelTestBase.ManyTypes @this); @@ -13944,6 +15972,9 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref List UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum8Collection(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] + public static extern ref CompiledModelTestBase.Enum8[][] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum8NestedCollection(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref CompiledModelTestBase.Enum32 UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumToNumberConverterProperty(CompiledModelTestBase.ManyTypes @this); @@ -14004,6 +16035,9 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref List UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU64Collection(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] + public static extern ref CompiledModelTestBase.EnumU64[][] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU64NestedCollection(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref CompiledModelTestBase.EnumU8 UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU8(CompiledModelTestBase.ManyTypes @this); @@ -14034,6 +16068,9 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref Guid[] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_GuidArray(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] + public static extern ref ICollection UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_GuidNestedCollection(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref Guid UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_GuidToBytesConverterProperty(CompiledModelTestBase.ManyTypes @this); @@ -14064,18 +16101,27 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref int[] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int32Array(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] + public static extern ref int[][] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int32NestedCollection(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref long UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int64(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref long[] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int64Array(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] + public static extern ref IList[] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int64NestedCollection(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref sbyte UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int8(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref sbyte[] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int8Array(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] + public static extern ref sbyte[][][] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int8NestedCollection(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref int UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_IntNumberToBytesConverterProperty(CompiledModelTestBase.ManyTypes @this); @@ -14097,6 +16143,9 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref byte[][] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableBytesArray(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] + public static extern ref byte[][][] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableBytesNestedCollection(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref char? UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableChar(CompiledModelTestBase.ManyTypes @this); @@ -14163,6 +16212,9 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref List UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum32Collection(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] + public static extern ref CompiledModelTestBase.Enum32?[][][] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum32NestedCollection(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref CompiledModelTestBase.Enum64? UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum64(CompiledModelTestBase.ManyTypes @this); @@ -14199,6 +16251,9 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref List UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum8Collection(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] + public static extern ref CompiledModelTestBase.Enum8?[][] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum8NestedCollection(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref CompiledModelTestBase.EnumU16? UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU16(CompiledModelTestBase.ManyTypes @this); @@ -14253,6 +16308,9 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref List UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU64Collection(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] + public static extern ref CompiledModelTestBase.EnumU64?[][] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU64NestedCollection(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref CompiledModelTestBase.EnumU8? UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU8(CompiledModelTestBase.ManyTypes @this); @@ -14283,6 +16341,9 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref Guid?[] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableGuidArray(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] + public static extern ref Guid?[][] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableGuidNestedCollection(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref IPAddress UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableIPAddress(CompiledModelTestBase.ManyTypes @this); @@ -14301,12 +16362,18 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref int?[] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt32Array(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] + public static extern ref int?[][] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt32NestedCollection(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref long? UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt64(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref long?[] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt64Array(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] + public static extern ref List UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt64NestedCollection(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref sbyte? UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt8(CompiledModelTestBase.ManyTypes @this); @@ -14319,12 +16386,18 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref PhysicalAddress[] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullablePhysicalAddressArray(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] + public static extern ref IEnumerable UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullablePhysicalAddressNestedCollection(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref string UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableString(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref string[] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableStringArray(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] + public static extern ref string[][] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableStringNestedCollection(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref TimeOnly? UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableTimeOnly(CompiledModelTestBase.ManyTypes @this); @@ -14361,6 +16434,9 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref byte?[] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUInt8Array(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] + public static extern ref byte?[][] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUInt8NestedCollection(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref Uri UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUri(CompiledModelTestBase.ManyTypes @this); @@ -14385,6 +16461,9 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref string[] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringArray(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] + public static extern ref string[][] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringNestedCollection(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref string UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringToBoolConverterProperty(CompiledModelTestBase.ManyTypes @this); @@ -14475,6 +16554,9 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref byte[] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UInt8Array(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] + public static extern ref List UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UInt8NestedCollection(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref Uri UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Uri(CompiledModelTestBase.ManyTypes @this); diff --git a/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/BigModel/OwnedType0EntityType.cs b/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/BigModel/OwnedType0EntityType.cs index 5c35a4f6d41..ec64462ca8f 100644 --- a/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/BigModel/OwnedType0EntityType.cs +++ b/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/BigModel/OwnedType0EntityType.cs @@ -51,15 +51,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas principalDerivedId.TypeMapping = LongTypeMapping.Default.Clone( comparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), keyComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "INTEGER")); @@ -210,52 +210,52 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas relationshipIndex: -1, storeGenerationIndex: -1); refTypeArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfReferenceTypesComparer(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)))), elementMapping: SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), keyComparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( size: 45), converter: new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))); refTypeArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("OwnedType0EntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_OwnedType__refTypeArray", "TestNamespace") }); @@ -287,21 +287,21 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas relationshipIndex: -1, storeGenerationIndex: -1); refTypeEnumerable.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfReferenceTypesComparer, string>(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfReferenceTypesComparer, string>(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, string>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter, string>( JsonStringReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, string>( + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter, string>( JsonStringReaderWriter.Instance), elementMapping: SqliteStringTypeMapping.Default); refTypeEnumerable.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("OwnedType0EntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_OwnedType__refTypeEnumerable", "TestNamespace") }); @@ -334,21 +334,21 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas relationshipIndex: -1, storeGenerationIndex: -1); refTypeIList.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfReferenceTypesComparer, string>(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfReferenceTypesComparer, string>(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, string>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter, string>( JsonStringReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, string>( + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter, string>( JsonStringReaderWriter.Instance), elementMapping: SqliteStringTypeMapping.Default); refTypeIList.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("OwnedType0EntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_OwnedType__refTypeIList", "TestNamespace") }); @@ -381,52 +381,52 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas relationshipIndex: -1, storeGenerationIndex: -1); refTypeList.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfReferenceTypesComparer, IPAddress>(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfReferenceTypesComparer, IPAddress>(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, IPAddress>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter, IPAddress>( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, IPAddress>( + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter, IPAddress>( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)))), elementMapping: SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), keyComparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( size: 45), converter: new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))); refTypeList.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("OwnedType0EntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_OwnedType__refTypeList", "TestNamespace") }); @@ -458,21 +458,21 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas relationshipIndex: -1, storeGenerationIndex: -1); valueTypeArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer(new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer(new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( SqliteJsonDateTimeReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( SqliteJsonDateTimeReaderWriter.Instance), elementMapping: SqliteDateTimeTypeMapping.Default); valueTypeArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("OwnedType0EntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_OwnedType__valueTypeArray", "TestNamespace") }); @@ -505,21 +505,21 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas relationshipIndex: -1, storeGenerationIndex: -1); valueTypeEnumerable.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer, byte>(new ValueComparer( (byte v1, byte v2) => v1 == v2, (byte v) => (int)v, (byte v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer, byte>(new ValueComparer( (byte v1, byte v2) => v1 == v2, (byte v) => (int)v, (byte v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, byte>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter, byte>( JsonByteReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, byte>( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, byte>( JsonByteReaderWriter.Instance), elementMapping: ByteTypeMapping.Default.Clone( comparer: new ValueComparer( @@ -566,21 +566,21 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas relationshipIndex: -1, storeGenerationIndex: -1); valueTypeIList.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer, byte>(new ValueComparer( (byte v1, byte v2) => v1 == v2, (byte v) => (int)v, (byte v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer, byte>(new ValueComparer( (byte v1, byte v2) => v1 == v2, (byte v) => (int)v, (byte v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, byte>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter, byte>( JsonByteReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, byte>( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, byte>( JsonByteReaderWriter.Instance), elementMapping: ByteTypeMapping.Default.Clone( comparer: new ValueComparer( @@ -627,21 +627,21 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas relationshipIndex: -1, storeGenerationIndex: -1); valueTypeList.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer, short>(new ValueComparer( (short v1, short v2) => v1 == v2, (short v) => (int)v, (short v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer, short>(new ValueComparer( (short v1, short v2) => v1 == v2, (short v) => (int)v, (short v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, short>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter, short>( JsonInt16ReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, short>( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, short>( JsonInt16ReaderWriter.Instance), elementMapping: ShortTypeMapping.Default.Clone( comparer: new ValueComparer( @@ -742,11 +742,11 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) runtimeEntityType.SetOriginalValuesFactory( (InternalEntityEntry source) => { - var entity = (CompiledModelTestBase.OwnedType)source.Entity; - return (ISnapshot)new Snapshot, IList, List, DateTime[], IEnumerable, IList, List>(((ValueComparer)principalDerivedId.GetValueComparer()).Snapshot(source.GetCurrentValue(principalDerivedId)), ((ValueComparer)principalDerivedAlternateId.GetValueComparer()).Snapshot(source.GetCurrentValue(principalDerivedAlternateId)), ((ValueComparer)id.GetValueComparer()).Snapshot(source.GetCurrentValue(id)), source.GetCurrentValue(details) == null ? null : ((ValueComparer)details.GetValueComparer()).Snapshot(source.GetCurrentValue(details)), ((ValueComparer)number.GetValueComparer()).Snapshot(source.GetCurrentValue(number)), (IEnumerable)source.GetCurrentValue(refTypeArray) == null ? null : (IPAddress[])((ValueComparer>)refTypeArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(refTypeArray)), source.GetCurrentValue>(refTypeEnumerable) == null ? null : ((ValueComparer>)refTypeEnumerable.GetValueComparer()).Snapshot(source.GetCurrentValue>(refTypeEnumerable)), (IEnumerable)source.GetCurrentValue>(refTypeIList) == null ? null : (IList)((ValueComparer>)refTypeIList.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(refTypeIList)), (IEnumerable)source.GetCurrentValue>(refTypeList) == null ? null : (List)((ValueComparer>)refTypeList.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(refTypeList)), (IEnumerable)source.GetCurrentValue(valueTypeArray) == null ? null : (DateTime[])((ValueComparer>)valueTypeArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(valueTypeArray)), source.GetCurrentValue>(valueTypeEnumerable) == null ? null : ((ValueComparer>)valueTypeEnumerable.GetValueComparer()).Snapshot(source.GetCurrentValue>(valueTypeEnumerable)), (IEnumerable)source.GetCurrentValue>(valueTypeIList) == null ? null : (IList)((ValueComparer>)valueTypeIList.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeIList)), (IEnumerable)source.GetCurrentValue>(valueTypeList) == null ? null : (List)((ValueComparer>)valueTypeList.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeList))); + var entity8 = (CompiledModelTestBase.OwnedType)source.Entity; + return (ISnapshot)new Snapshot, IList, List, DateTime[], IEnumerable, IList, List>(((ValueComparer)((IProperty)principalDerivedId).GetValueComparer()).Snapshot(source.GetCurrentValue(principalDerivedId)), ((ValueComparer)((IProperty)principalDerivedAlternateId).GetValueComparer()).Snapshot(source.GetCurrentValue(principalDerivedAlternateId)), ((ValueComparer)((IProperty)id).GetValueComparer()).Snapshot(source.GetCurrentValue(id)), source.GetCurrentValue(details) == null ? null : ((ValueComparer)((IProperty)details).GetValueComparer()).Snapshot(source.GetCurrentValue(details)), ((ValueComparer)((IProperty)number).GetValueComparer()).Snapshot(source.GetCurrentValue(number)), (object)source.GetCurrentValue(refTypeArray) == null ? null : (IPAddress[])((ValueComparer)((IProperty)refTypeArray).GetValueComparer()).Snapshot((object)source.GetCurrentValue(refTypeArray)), (object)source.GetCurrentValue>(refTypeEnumerable) == null ? null : (IEnumerable)((ValueComparer)((IProperty)refTypeEnumerable).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeEnumerable)), (object)source.GetCurrentValue>(refTypeIList) == null ? null : (IList)((ValueComparer)((IProperty)refTypeIList).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeIList)), (object)source.GetCurrentValue>(refTypeList) == null ? null : (List)((ValueComparer)((IProperty)refTypeList).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeList)), (IEnumerable)source.GetCurrentValue(valueTypeArray) == null ? null : (DateTime[])((ValueComparer>)((IProperty)valueTypeArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(valueTypeArray)), source.GetCurrentValue>(valueTypeEnumerable) == null ? null : ((ValueComparer>)((IProperty)valueTypeEnumerable).GetValueComparer()).Snapshot(source.GetCurrentValue>(valueTypeEnumerable)), (IEnumerable)source.GetCurrentValue>(valueTypeIList) == null ? null : (IList)((ValueComparer>)((IProperty)valueTypeIList).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeIList)), (IEnumerable)source.GetCurrentValue>(valueTypeList) == null ? null : (List)((ValueComparer>)((IProperty)valueTypeList).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeList))); }); runtimeEntityType.SetStoreGeneratedValuesFactory( - () => (ISnapshot)new Snapshot(((ValueComparer)principalDerivedId.GetValueComparer()).Snapshot(default(long)), ((ValueComparer)principalDerivedAlternateId.GetValueComparer()).Snapshot(default(Guid)), ((ValueComparer)id.GetValueComparer()).Snapshot(default(int)))); + () => (ISnapshot)new Snapshot(((ValueComparer)((IProperty)principalDerivedId).GetValueComparer()).Snapshot(default(long)), ((ValueComparer)((IProperty)principalDerivedAlternateId).GetValueComparer()).Snapshot(default(Guid)), ((ValueComparer)((IProperty)id).GetValueComparer()).Snapshot(default(int)))); runtimeEntityType.SetTemporaryValuesFactory( (InternalEntityEntry source) => (ISnapshot)new Snapshot(default(long), default(Guid), default(int))); runtimeEntityType.SetShadowValuesFactory( @@ -756,8 +756,8 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) runtimeEntityType.SetRelationshipSnapshotFactory( (InternalEntityEntry source) => { - var entity = (CompiledModelTestBase.OwnedType)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)principalDerivedId.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalDerivedId)), ((ValueComparer)principalDerivedAlternateId.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalDerivedAlternateId)), ((ValueComparer)id.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(id))); + var entity8 = (CompiledModelTestBase.OwnedType)source.Entity; + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)principalDerivedId).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalDerivedId)), ((ValueComparer)((IProperty)principalDerivedAlternateId).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalDerivedAlternateId)), ((ValueComparer)((IProperty)id).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(id))); }); runtimeEntityType.Counts = new PropertyCounts( propertyCount: 13, diff --git a/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/BigModel/OwnedTypeEntityType.cs b/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/BigModel/OwnedTypeEntityType.cs index e8848b9d629..beeeae191fa 100644 --- a/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/BigModel/OwnedTypeEntityType.cs +++ b/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/BigModel/OwnedTypeEntityType.cs @@ -53,15 +53,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas principalBaseId.TypeMapping = LongTypeMapping.Default.Clone( comparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), keyComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "INTEGER")); @@ -207,52 +207,52 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas relationshipIndex: -1, storeGenerationIndex: -1); refTypeArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfReferenceTypesComparer(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)))), elementMapping: SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), keyComparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( size: 45), converter: new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))); refTypeArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("OwnedTypeEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_OwnedType__refTypeArray", "TestNamespace") }); @@ -285,21 +285,21 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas relationshipIndex: -1, storeGenerationIndex: -1); refTypeEnumerable.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfReferenceTypesComparer, string>(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfReferenceTypesComparer, string>(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, string>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter, string>( JsonStringReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, string>( + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter, string>( JsonStringReaderWriter.Instance), elementMapping: SqliteStringTypeMapping.Default); refTypeEnumerable.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("OwnedTypeEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_OwnedType__refTypeEnumerable", "TestNamespace") }); @@ -333,21 +333,21 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas relationshipIndex: -1, storeGenerationIndex: -1); refTypeIList.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfReferenceTypesComparer, string>(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfReferenceTypesComparer, string>(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, string>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter, string>( JsonStringReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, string>( + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter, string>( JsonStringReaderWriter.Instance), elementMapping: SqliteStringTypeMapping.Default); refTypeIList.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("OwnedTypeEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_OwnedType__refTypeIList", "TestNamespace") }); @@ -381,52 +381,52 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas relationshipIndex: -1, storeGenerationIndex: -1); refTypeList.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfReferenceTypesComparer, IPAddress>(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfReferenceTypesComparer, IPAddress>(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, IPAddress>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter, IPAddress>( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, IPAddress>( + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter, IPAddress>( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)))), elementMapping: SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), keyComparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( size: 45), converter: new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))); refTypeList.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("OwnedTypeEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_OwnedType__refTypeList", "TestNamespace") }); @@ -459,21 +459,21 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas relationshipIndex: -1, storeGenerationIndex: -1); valueTypeArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer(new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer(new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( SqliteJsonDateTimeReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( SqliteJsonDateTimeReaderWriter.Instance), elementMapping: SqliteDateTimeTypeMapping.Default); valueTypeArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("OwnedTypeEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_OwnedType__valueTypeArray", "TestNamespace") }); @@ -507,21 +507,21 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas relationshipIndex: -1, storeGenerationIndex: -1); valueTypeEnumerable.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer, byte>(new ValueComparer( (byte v1, byte v2) => v1 == v2, (byte v) => (int)v, (byte v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer, byte>(new ValueComparer( (byte v1, byte v2) => v1 == v2, (byte v) => (int)v, (byte v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, byte>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter, byte>( JsonByteReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, byte>( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, byte>( JsonByteReaderWriter.Instance), elementMapping: ByteTypeMapping.Default.Clone( comparer: new ValueComparer( @@ -569,21 +569,21 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas relationshipIndex: -1, storeGenerationIndex: -1); valueTypeIList.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer, byte>(new ValueComparer( (byte v1, byte v2) => v1 == v2, (byte v) => (int)v, (byte v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer, byte>(new ValueComparer( (byte v1, byte v2) => v1 == v2, (byte v) => (int)v, (byte v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, byte>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter, byte>( JsonByteReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, byte>( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, byte>( JsonByteReaderWriter.Instance), elementMapping: ByteTypeMapping.Default.Clone( comparer: new ValueComparer( @@ -631,21 +631,21 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas relationshipIndex: -1, storeGenerationIndex: -1); valueTypeList.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer, short>(new ValueComparer( (short v1, short v2) => v1 == v2, (short v) => (int)v, (short v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer, short>(new ValueComparer( (short v1, short v2) => v1 == v2, (short v) => (int)v, (short v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, short>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter, short>( JsonInt16ReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, short>( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, short>( JsonInt16ReaderWriter.Instance), elementMapping: ShortTypeMapping.Default.Clone( comparer: new ValueComparer( @@ -757,11 +757,11 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) runtimeEntityType.SetOriginalValuesFactory( (InternalEntityEntry source) => { - var entity = (CompiledModelTestBase.OwnedType)source.Entity; - return (ISnapshot)new Snapshot, IList, List, DateTime[], IEnumerable, IList, List>(((ValueComparer)principalBaseId.GetValueComparer()).Snapshot(source.GetCurrentValue(principalBaseId)), ((ValueComparer)principalBaseAlternateId.GetValueComparer()).Snapshot(source.GetCurrentValue(principalBaseAlternateId)), source.GetCurrentValue(details) == null ? null : ((ValueComparer)details.GetValueComparer()).Snapshot(source.GetCurrentValue(details)), ((ValueComparer)number.GetValueComparer()).Snapshot(source.GetCurrentValue(number)), (IEnumerable)source.GetCurrentValue(refTypeArray) == null ? null : (IPAddress[])((ValueComparer>)refTypeArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(refTypeArray)), source.GetCurrentValue>(refTypeEnumerable) == null ? null : ((ValueComparer>)refTypeEnumerable.GetValueComparer()).Snapshot(source.GetCurrentValue>(refTypeEnumerable)), (IEnumerable)source.GetCurrentValue>(refTypeIList) == null ? null : (IList)((ValueComparer>)refTypeIList.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(refTypeIList)), (IEnumerable)source.GetCurrentValue>(refTypeList) == null ? null : (List)((ValueComparer>)refTypeList.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(refTypeList)), (IEnumerable)source.GetCurrentValue(valueTypeArray) == null ? null : (DateTime[])((ValueComparer>)valueTypeArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(valueTypeArray)), source.GetCurrentValue>(valueTypeEnumerable) == null ? null : ((ValueComparer>)valueTypeEnumerable.GetValueComparer()).Snapshot(source.GetCurrentValue>(valueTypeEnumerable)), (IEnumerable)source.GetCurrentValue>(valueTypeIList) == null ? null : (IList)((ValueComparer>)valueTypeIList.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeIList)), (IEnumerable)source.GetCurrentValue>(valueTypeList) == null ? null : (List)((ValueComparer>)valueTypeList.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeList))); + var entity8 = (CompiledModelTestBase.OwnedType)source.Entity; + return (ISnapshot)new Snapshot, IList, List, DateTime[], IEnumerable, IList, List>(((ValueComparer)((IProperty)principalBaseId).GetValueComparer()).Snapshot(source.GetCurrentValue(principalBaseId)), ((ValueComparer)((IProperty)principalBaseAlternateId).GetValueComparer()).Snapshot(source.GetCurrentValue(principalBaseAlternateId)), source.GetCurrentValue(details) == null ? null : ((ValueComparer)((IProperty)details).GetValueComparer()).Snapshot(source.GetCurrentValue(details)), ((ValueComparer)((IProperty)number).GetValueComparer()).Snapshot(source.GetCurrentValue(number)), (object)source.GetCurrentValue(refTypeArray) == null ? null : (IPAddress[])((ValueComparer)((IProperty)refTypeArray).GetValueComparer()).Snapshot((object)source.GetCurrentValue(refTypeArray)), (object)source.GetCurrentValue>(refTypeEnumerable) == null ? null : (IEnumerable)((ValueComparer)((IProperty)refTypeEnumerable).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeEnumerable)), (object)source.GetCurrentValue>(refTypeIList) == null ? null : (IList)((ValueComparer)((IProperty)refTypeIList).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeIList)), (object)source.GetCurrentValue>(refTypeList) == null ? null : (List)((ValueComparer)((IProperty)refTypeList).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeList)), (IEnumerable)source.GetCurrentValue(valueTypeArray) == null ? null : (DateTime[])((ValueComparer>)((IProperty)valueTypeArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(valueTypeArray)), source.GetCurrentValue>(valueTypeEnumerable) == null ? null : ((ValueComparer>)((IProperty)valueTypeEnumerable).GetValueComparer()).Snapshot(source.GetCurrentValue>(valueTypeEnumerable)), (IEnumerable)source.GetCurrentValue>(valueTypeIList) == null ? null : (IList)((ValueComparer>)((IProperty)valueTypeIList).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeIList)), (IEnumerable)source.GetCurrentValue>(valueTypeList) == null ? null : (List)((ValueComparer>)((IProperty)valueTypeList).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeList))); }); runtimeEntityType.SetStoreGeneratedValuesFactory( - () => (ISnapshot)new Snapshot(((ValueComparer)principalBaseId.GetValueComparer()).Snapshot(default(long)), ((ValueComparer)principalBaseAlternateId.GetValueComparer()).Snapshot(default(Guid)))); + () => (ISnapshot)new Snapshot(((ValueComparer)((IProperty)principalBaseId).GetValueComparer()).Snapshot(default(long)), ((ValueComparer)((IProperty)principalBaseAlternateId).GetValueComparer()).Snapshot(default(Guid)))); runtimeEntityType.SetTemporaryValuesFactory( (InternalEntityEntry source) => (ISnapshot)new Snapshot(default(long), default(Guid))); runtimeEntityType.SetShadowValuesFactory( @@ -771,8 +771,8 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) runtimeEntityType.SetRelationshipSnapshotFactory( (InternalEntityEntry source) => { - var entity = (CompiledModelTestBase.OwnedType)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)principalBaseId.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalBaseId)), ((ValueComparer)principalBaseAlternateId.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalBaseAlternateId))); + var entity8 = (CompiledModelTestBase.OwnedType)source.Entity; + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)principalBaseId).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalBaseId)), ((ValueComparer)((IProperty)principalBaseAlternateId).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalBaseAlternateId))); }); runtimeEntityType.Counts = new PropertyCounts( propertyCount: 12, diff --git a/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/BigModel/PrincipalBaseEntityType.cs b/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/BigModel/PrincipalBaseEntityType.cs index 736cff4cbb6..b60a44866c6 100644 --- a/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/BigModel/PrincipalBaseEntityType.cs +++ b/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/BigModel/PrincipalBaseEntityType.cs @@ -70,15 +70,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas id.TypeMapping = LongTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable)), providerValueComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable)), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "INTEGER")); @@ -156,11 +156,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum1.TypeMapping = IntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.AnEnum v1, CompiledModelTestBase.AnEnum v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.AnEnum v) => v.GetHashCode(), + (CompiledModelTestBase.AnEnum v) => ((object)v).GetHashCode(), (CompiledModelTestBase.AnEnum v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.AnEnum v1, CompiledModelTestBase.AnEnum v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.AnEnum v) => v.GetHashCode(), + (CompiledModelTestBase.AnEnum v) => ((object)v).GetHashCode(), (CompiledModelTestBase.AnEnum v) => v), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -209,11 +209,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum2.TypeMapping = IntTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.AnEnum)v1, (object)(CompiledModelTestBase.AnEnum)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.AnEnum)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.AnEnum)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.AnEnum)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.AnEnum)v1, (object)(CompiledModelTestBase.AnEnum)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.AnEnum)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.AnEnum)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.AnEnum)v : default(Nullable)), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -260,11 +260,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas flagsEnum1.TypeMapping = IntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.AFlagsEnum v1, CompiledModelTestBase.AFlagsEnum v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.AFlagsEnum v) => v.GetHashCode(), + (CompiledModelTestBase.AFlagsEnum v) => ((object)v).GetHashCode(), (CompiledModelTestBase.AFlagsEnum v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.AFlagsEnum v1, CompiledModelTestBase.AFlagsEnum v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.AFlagsEnum v) => v.GetHashCode(), + (CompiledModelTestBase.AFlagsEnum v) => ((object)v).GetHashCode(), (CompiledModelTestBase.AFlagsEnum v) => v), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -313,11 +313,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas flagsEnum2.TypeMapping = IntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.AFlagsEnum v1, CompiledModelTestBase.AFlagsEnum v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.AFlagsEnum v) => v.GetHashCode(), + (CompiledModelTestBase.AFlagsEnum v) => ((object)v).GetHashCode(), (CompiledModelTestBase.AFlagsEnum v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.AFlagsEnum v1, CompiledModelTestBase.AFlagsEnum v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.AFlagsEnum v) => v.GetHashCode(), + (CompiledModelTestBase.AFlagsEnum v) => ((object)v).GetHashCode(), (CompiledModelTestBase.AFlagsEnum v) => v), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -382,52 +382,52 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas relationshipIndex: -1, storeGenerationIndex: -1); refTypeArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfReferenceTypesComparer(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)))), elementMapping: SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), keyComparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( size: 45), converter: new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))); refTypeArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("PrincipalBaseEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalBase_RefTypeArray", "TestNamespace") }); @@ -459,21 +459,21 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas relationshipIndex: -1, storeGenerationIndex: -1); refTypeEnumerable.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfReferenceTypesComparer, string>(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfReferenceTypesComparer, string>(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, string>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter, string>( JsonStringReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, string>( + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter, string>( JsonStringReaderWriter.Instance), elementMapping: SqliteStringTypeMapping.Default); refTypeEnumerable.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("PrincipalBaseEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalBase_RefTypeEnumerable", "TestNamespace") }); @@ -506,21 +506,21 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas relationshipIndex: -1, storeGenerationIndex: -1); refTypeIList.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfReferenceTypesComparer, string>(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfReferenceTypesComparer, string>(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, string>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter, string>( JsonStringReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, string>( + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter, string>( JsonStringReaderWriter.Instance), elementMapping: SqliteStringTypeMapping.Default); refTypeIList.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("PrincipalBaseEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalBase_RefTypeIList", "TestNamespace") }); @@ -553,52 +553,52 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas relationshipIndex: -1, storeGenerationIndex: -1); refTypeList.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfReferenceTypesComparer, IPAddress>(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfReferenceTypesComparer, IPAddress>(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, IPAddress>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter, IPAddress>( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, IPAddress>( + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter, IPAddress>( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)))), elementMapping: SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), keyComparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( size: 45), converter: new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))); refTypeList.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("PrincipalBaseEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalBase_RefTypeList", "TestNamespace") }); @@ -630,21 +630,21 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas relationshipIndex: -1, storeGenerationIndex: -1); valueTypeArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer(new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer(new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( SqliteJsonDateTimeReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( SqliteJsonDateTimeReaderWriter.Instance), elementMapping: SqliteDateTimeTypeMapping.Default); valueTypeArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("PrincipalBaseEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalBase_ValueTypeArray", "TestNamespace") }); @@ -677,21 +677,21 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas relationshipIndex: -1, storeGenerationIndex: -1); valueTypeEnumerable.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer, byte>(new ValueComparer( (byte v1, byte v2) => v1 == v2, (byte v) => (int)v, (byte v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer, byte>(new ValueComparer( (byte v1, byte v2) => v1 == v2, (byte v) => (int)v, (byte v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, byte>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter, byte>( JsonByteReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, byte>( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, byte>( JsonByteReaderWriter.Instance), elementMapping: ByteTypeMapping.Default.Clone( comparer: new ValueComparer( @@ -738,21 +738,21 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas relationshipIndex: -1, storeGenerationIndex: -1); valueTypeIList.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer, byte>(new ValueComparer( (byte v1, byte v2) => v1 == v2, (byte v) => (int)v, (byte v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer, byte>(new ValueComparer( (byte v1, byte v2) => v1 == v2, (byte v) => (int)v, (byte v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, byte>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter, byte>( JsonByteReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, byte>( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, byte>( JsonByteReaderWriter.Instance), elementMapping: ByteTypeMapping.Default.Clone( comparer: new ValueComparer( @@ -799,21 +799,21 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas relationshipIndex: -1, storeGenerationIndex: -1); valueTypeList.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer, short>(new ValueComparer( (short v1, short v2) => v1 == v2, (short v) => (int)v, (short v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer, short>(new ValueComparer( (short v1, short v2) => v1 == v2, (short v) => (int)v, (short v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, short>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter, short>( JsonInt16ReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, short>( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, short>( JsonInt16ReaderWriter.Instance), elementMapping: ShortTypeMapping.Default.Clone( comparer: new ValueComparer( @@ -920,11 +920,11 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) runtimeEntityType.SetOriginalValuesFactory( (InternalEntityEntry source) => { - var entity = (CompiledModelTestBase.PrincipalBase)source.Entity; - return (ISnapshot)new Snapshot, Guid, CompiledModelTestBase.AnEnum, Nullable, CompiledModelTestBase.AFlagsEnum, CompiledModelTestBase.AFlagsEnum, Point, IPAddress[], IEnumerable, IList, List, DateTime[], IEnumerable, IList, List>(source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)id.GetValueComparer()).Snapshot(source.GetCurrentValue>(id)), ((ValueComparer)alternateId.GetValueComparer()).Snapshot(source.GetCurrentValue(alternateId)), ((ValueComparer)enum1.GetValueComparer()).Snapshot(source.GetCurrentValue(enum1)), source.GetCurrentValue>(enum2) == null ? null : ((ValueComparer>)enum2.GetValueComparer()).Snapshot(source.GetCurrentValue>(enum2)), ((ValueComparer)flagsEnum1.GetValueComparer()).Snapshot(source.GetCurrentValue(flagsEnum1)), ((ValueComparer)flagsEnum2.GetValueComparer()).Snapshot(source.GetCurrentValue(flagsEnum2)), source.GetCurrentValue(point) == null ? null : ((ValueComparer)point.GetValueComparer()).Snapshot(source.GetCurrentValue(point)), (IEnumerable)source.GetCurrentValue(refTypeArray) == null ? null : (IPAddress[])((ValueComparer>)refTypeArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(refTypeArray)), source.GetCurrentValue>(refTypeEnumerable) == null ? null : ((ValueComparer>)refTypeEnumerable.GetValueComparer()).Snapshot(source.GetCurrentValue>(refTypeEnumerable)), (IEnumerable)source.GetCurrentValue>(refTypeIList) == null ? null : (IList)((ValueComparer>)refTypeIList.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(refTypeIList)), (IEnumerable)source.GetCurrentValue>(refTypeList) == null ? null : (List)((ValueComparer>)refTypeList.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(refTypeList)), (IEnumerable)source.GetCurrentValue(valueTypeArray) == null ? null : (DateTime[])((ValueComparer>)valueTypeArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(valueTypeArray)), source.GetCurrentValue>(valueTypeEnumerable) == null ? null : ((ValueComparer>)valueTypeEnumerable.GetValueComparer()).Snapshot(source.GetCurrentValue>(valueTypeEnumerable)), (IEnumerable)source.GetCurrentValue>(valueTypeIList) == null ? null : (IList)((ValueComparer>)valueTypeIList.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeIList)), (IEnumerable)source.GetCurrentValue>(valueTypeList) == null ? null : (List)((ValueComparer>)valueTypeList.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeList))); + var entity8 = (CompiledModelTestBase.PrincipalBase)source.Entity; + return (ISnapshot)new Snapshot, Guid, CompiledModelTestBase.AnEnum, Nullable, CompiledModelTestBase.AFlagsEnum, CompiledModelTestBase.AFlagsEnum, Point, IPAddress[], IEnumerable, IList, List, DateTime[], IEnumerable, IList, List>(source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)((IProperty)id).GetValueComparer()).Snapshot(source.GetCurrentValue>(id)), ((ValueComparer)((IProperty)alternateId).GetValueComparer()).Snapshot(source.GetCurrentValue(alternateId)), ((ValueComparer)((IProperty)enum1).GetValueComparer()).Snapshot(source.GetCurrentValue(enum1)), source.GetCurrentValue>(enum2) == null ? null : ((ValueComparer>)((IProperty)enum2).GetValueComparer()).Snapshot(source.GetCurrentValue>(enum2)), ((ValueComparer)((IProperty)flagsEnum1).GetValueComparer()).Snapshot(source.GetCurrentValue(flagsEnum1)), ((ValueComparer)((IProperty)flagsEnum2).GetValueComparer()).Snapshot(source.GetCurrentValue(flagsEnum2)), source.GetCurrentValue(point) == null ? null : ((ValueComparer)((IProperty)point).GetValueComparer()).Snapshot(source.GetCurrentValue(point)), (object)source.GetCurrentValue(refTypeArray) == null ? null : (IPAddress[])((ValueComparer)((IProperty)refTypeArray).GetValueComparer()).Snapshot((object)source.GetCurrentValue(refTypeArray)), (object)source.GetCurrentValue>(refTypeEnumerable) == null ? null : (IEnumerable)((ValueComparer)((IProperty)refTypeEnumerable).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeEnumerable)), (object)source.GetCurrentValue>(refTypeIList) == null ? null : (IList)((ValueComparer)((IProperty)refTypeIList).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeIList)), (object)source.GetCurrentValue>(refTypeList) == null ? null : (List)((ValueComparer)((IProperty)refTypeList).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeList)), (IEnumerable)source.GetCurrentValue(valueTypeArray) == null ? null : (DateTime[])((ValueComparer>)((IProperty)valueTypeArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(valueTypeArray)), source.GetCurrentValue>(valueTypeEnumerable) == null ? null : ((ValueComparer>)((IProperty)valueTypeEnumerable).GetValueComparer()).Snapshot(source.GetCurrentValue>(valueTypeEnumerable)), (IEnumerable)source.GetCurrentValue>(valueTypeIList) == null ? null : (IList)((ValueComparer>)((IProperty)valueTypeIList).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeIList)), (IEnumerable)source.GetCurrentValue>(valueTypeList) == null ? null : (List)((ValueComparer>)((IProperty)valueTypeList).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeList))); }); runtimeEntityType.SetStoreGeneratedValuesFactory( - () => (ISnapshot)new Snapshot, Guid, Point>(default(Nullable) == null ? null : ((ValueComparer>)id.GetValueComparer()).Snapshot(default(Nullable)), ((ValueComparer)alternateId.GetValueComparer()).Snapshot(default(Guid)), default(Point) == null ? null : ((ValueComparer)point.GetValueComparer()).Snapshot(default(Point)))); + () => (ISnapshot)new Snapshot, Guid, Point>(default(Nullable) == null ? null : ((ValueComparer>)((IProperty)id).GetValueComparer()).Snapshot(default(Nullable)), ((ValueComparer)((IProperty)alternateId).GetValueComparer()).Snapshot(default(Guid)), default(Point) == null ? null : ((ValueComparer)((IProperty)point).GetValueComparer()).Snapshot(default(Point)))); runtimeEntityType.SetTemporaryValuesFactory( (InternalEntityEntry source) => (ISnapshot)new Snapshot, Guid, Point>(default(Nullable), default(Guid), default(Point))); runtimeEntityType.SetShadowValuesFactory( @@ -934,8 +934,8 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) runtimeEntityType.SetRelationshipSnapshotFactory( (InternalEntityEntry source) => { - var entity = (CompiledModelTestBase.PrincipalBase)source.Entity; - return (ISnapshot)new Snapshot, Guid, object, object>(source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)id.GetKeyValueComparer()).Snapshot(source.GetCurrentValue>(id)), ((ValueComparer)alternateId.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(alternateId)), UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalBase__ownedField(entity), null); + var entity8 = (CompiledModelTestBase.PrincipalBase)source.Entity; + return (ISnapshot)new Snapshot, Guid, object, object>(source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)((IProperty)id).GetKeyValueComparer()).Snapshot(source.GetCurrentValue>(id)), ((ValueComparer)((IProperty)alternateId).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(alternateId)), UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalBase__ownedField(entity8), null); }); runtimeEntityType.Counts = new PropertyCounts( propertyCount: 15, diff --git a/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/BigModel/PrincipalBasePrincipalDerivedDependentBasebyteEntityType.cs b/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/BigModel/PrincipalBasePrincipalDerivedDependentBasebyteEntityType.cs index a3fc99262a4..a3d011b003d 100644 --- a/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/BigModel/PrincipalBasePrincipalDerivedDependentBasebyteEntityType.cs +++ b/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/BigModel/PrincipalBasePrincipalDerivedDependentBasebyteEntityType.cs @@ -41,10 +41,10 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas propertyInfo: runtimeEntityType.FindIndexerPropertyInfo(), afterSaveBehavior: PropertySaveBehavior.Throw); derivedsId.SetGetter( - (Dictionary entity) => (entity.ContainsKey("DerivedsId") ? entity["DerivedsId"] : null) == null ? 0L : (long)(entity.ContainsKey("DerivedsId") ? entity["DerivedsId"] : null), - (Dictionary entity) => (entity.ContainsKey("DerivedsId") ? entity["DerivedsId"] : null) == null, - (Dictionary instance) => (instance.ContainsKey("DerivedsId") ? instance["DerivedsId"] : null) == null ? 0L : (long)(instance.ContainsKey("DerivedsId") ? instance["DerivedsId"] : null), - (Dictionary instance) => (instance.ContainsKey("DerivedsId") ? instance["DerivedsId"] : null) == null); + (Dictionary entity) => (((IDictionary)entity).ContainsKey("DerivedsId") ? entity["DerivedsId"] : null) == null ? 0L : (long)(((IDictionary)entity).ContainsKey("DerivedsId") ? entity["DerivedsId"] : null), + (Dictionary entity) => (((IDictionary)entity).ContainsKey("DerivedsId") ? entity["DerivedsId"] : null) == null, + (Dictionary instance) => (((IDictionary)instance).ContainsKey("DerivedsId") ? instance["DerivedsId"] : null) == null ? 0L : (long)(((IDictionary)instance).ContainsKey("DerivedsId") ? instance["DerivedsId"] : null), + (Dictionary instance) => (((IDictionary)instance).ContainsKey("DerivedsId") ? instance["DerivedsId"] : null) == null); derivedsId.SetSetter( (Dictionary entity, long value) => entity["DerivedsId"] = (object)value); derivedsId.SetMaterializationSetter( @@ -59,13 +59,13 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas else { { - if (entry.FlaggedAsTemporary(0) && (((Dictionary)entry.Entity).ContainsKey("DerivedsId") ? ((Dictionary)entry.Entity)["DerivedsId"] : null) == null) + if (entry.FlaggedAsTemporary(0) && (((IDictionary)(Dictionary)entry.Entity).ContainsKey("DerivedsId") ? ((Dictionary)entry.Entity)["DerivedsId"] : null) == null) { return entry.ReadTemporaryValue(0); } else { - var nullableValue = ((Dictionary)entry.Entity).ContainsKey("DerivedsId") ? ((Dictionary)entry.Entity)["DerivedsId"] : null; + var nullableValue = ((IDictionary)(Dictionary)entry.Entity).ContainsKey("DerivedsId") ? ((Dictionary)entry.Entity)["DerivedsId"] : null; return nullableValue == null ? default(long) : (long)nullableValue; } } @@ -73,7 +73,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas }, (InternalEntityEntry entry) => { - var nullableValue = ((Dictionary)entry.Entity).ContainsKey("DerivedsId") ? ((Dictionary)entry.Entity)["DerivedsId"] : null; + var nullableValue = ((IDictionary)(Dictionary)entry.Entity).ContainsKey("DerivedsId") ? ((Dictionary)entry.Entity)["DerivedsId"] : null; return nullableValue == null ? default(long) : (long)nullableValue; }, (InternalEntityEntry entry) => entry.ReadOriginalValue(derivedsId, 0), @@ -88,15 +88,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas derivedsId.TypeMapping = LongTypeMapping.Default.Clone( comparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), keyComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "INTEGER")); @@ -108,10 +108,10 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas propertyInfo: runtimeEntityType.FindIndexerPropertyInfo(), afterSaveBehavior: PropertySaveBehavior.Throw); derivedsAlternateId.SetGetter( - (Dictionary entity) => (entity.ContainsKey("DerivedsAlternateId") ? entity["DerivedsAlternateId"] : null) == null ? new Guid("00000000-0000-0000-0000-000000000000") : (Guid)(entity.ContainsKey("DerivedsAlternateId") ? entity["DerivedsAlternateId"] : null), - (Dictionary entity) => (entity.ContainsKey("DerivedsAlternateId") ? entity["DerivedsAlternateId"] : null) == null, - (Dictionary instance) => (instance.ContainsKey("DerivedsAlternateId") ? instance["DerivedsAlternateId"] : null) == null ? new Guid("00000000-0000-0000-0000-000000000000") : (Guid)(instance.ContainsKey("DerivedsAlternateId") ? instance["DerivedsAlternateId"] : null), - (Dictionary instance) => (instance.ContainsKey("DerivedsAlternateId") ? instance["DerivedsAlternateId"] : null) == null); + (Dictionary entity) => (((IDictionary)entity).ContainsKey("DerivedsAlternateId") ? entity["DerivedsAlternateId"] : null) == null ? new Guid("00000000-0000-0000-0000-000000000000") : (Guid)(((IDictionary)entity).ContainsKey("DerivedsAlternateId") ? entity["DerivedsAlternateId"] : null), + (Dictionary entity) => (((IDictionary)entity).ContainsKey("DerivedsAlternateId") ? entity["DerivedsAlternateId"] : null) == null, + (Dictionary instance) => (((IDictionary)instance).ContainsKey("DerivedsAlternateId") ? instance["DerivedsAlternateId"] : null) == null ? new Guid("00000000-0000-0000-0000-000000000000") : (Guid)(((IDictionary)instance).ContainsKey("DerivedsAlternateId") ? instance["DerivedsAlternateId"] : null), + (Dictionary instance) => (((IDictionary)instance).ContainsKey("DerivedsAlternateId") ? instance["DerivedsAlternateId"] : null) == null); derivedsAlternateId.SetSetter( (Dictionary entity, Guid value) => entity["DerivedsAlternateId"] = (object)value); derivedsAlternateId.SetMaterializationSetter( @@ -126,13 +126,13 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas else { { - if (entry.FlaggedAsTemporary(1) && (((Dictionary)entry.Entity).ContainsKey("DerivedsAlternateId") ? ((Dictionary)entry.Entity)["DerivedsAlternateId"] : null) == null) + if (entry.FlaggedAsTemporary(1) && (((IDictionary)(Dictionary)entry.Entity).ContainsKey("DerivedsAlternateId") ? ((Dictionary)entry.Entity)["DerivedsAlternateId"] : null) == null) { return entry.ReadTemporaryValue(1); } else { - var nullableValue = ((Dictionary)entry.Entity).ContainsKey("DerivedsAlternateId") ? ((Dictionary)entry.Entity)["DerivedsAlternateId"] : null; + var nullableValue = ((IDictionary)(Dictionary)entry.Entity).ContainsKey("DerivedsAlternateId") ? ((Dictionary)entry.Entity)["DerivedsAlternateId"] : null; return nullableValue == null ? default(Guid) : (Guid)nullableValue; } } @@ -140,7 +140,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas }, (InternalEntityEntry entry) => { - var nullableValue = ((Dictionary)entry.Entity).ContainsKey("DerivedsAlternateId") ? ((Dictionary)entry.Entity)["DerivedsAlternateId"] : null; + var nullableValue = ((IDictionary)(Dictionary)entry.Entity).ContainsKey("DerivedsAlternateId") ? ((Dictionary)entry.Entity)["DerivedsAlternateId"] : null; return nullableValue == null ? default(Guid) : (Guid)nullableValue; }, (InternalEntityEntry entry) => entry.ReadOriginalValue(derivedsAlternateId, 1), @@ -161,10 +161,10 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas propertyInfo: runtimeEntityType.FindIndexerPropertyInfo(), afterSaveBehavior: PropertySaveBehavior.Throw); principalsId.SetGetter( - (Dictionary entity) => (entity.ContainsKey("PrincipalsId") ? entity["PrincipalsId"] : null) == null ? 0L : (long)(entity.ContainsKey("PrincipalsId") ? entity["PrincipalsId"] : null), - (Dictionary entity) => (entity.ContainsKey("PrincipalsId") ? entity["PrincipalsId"] : null) == null, - (Dictionary instance) => (instance.ContainsKey("PrincipalsId") ? instance["PrincipalsId"] : null) == null ? 0L : (long)(instance.ContainsKey("PrincipalsId") ? instance["PrincipalsId"] : null), - (Dictionary instance) => (instance.ContainsKey("PrincipalsId") ? instance["PrincipalsId"] : null) == null); + (Dictionary entity) => (((IDictionary)entity).ContainsKey("PrincipalsId") ? entity["PrincipalsId"] : null) == null ? 0L : (long)(((IDictionary)entity).ContainsKey("PrincipalsId") ? entity["PrincipalsId"] : null), + (Dictionary entity) => (((IDictionary)entity).ContainsKey("PrincipalsId") ? entity["PrincipalsId"] : null) == null, + (Dictionary instance) => (((IDictionary)instance).ContainsKey("PrincipalsId") ? instance["PrincipalsId"] : null) == null ? 0L : (long)(((IDictionary)instance).ContainsKey("PrincipalsId") ? instance["PrincipalsId"] : null), + (Dictionary instance) => (((IDictionary)instance).ContainsKey("PrincipalsId") ? instance["PrincipalsId"] : null) == null); principalsId.SetSetter( (Dictionary entity, long value) => entity["PrincipalsId"] = (object)value); principalsId.SetMaterializationSetter( @@ -179,13 +179,13 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas else { { - if (entry.FlaggedAsTemporary(2) && (((Dictionary)entry.Entity).ContainsKey("PrincipalsId") ? ((Dictionary)entry.Entity)["PrincipalsId"] : null) == null) + if (entry.FlaggedAsTemporary(2) && (((IDictionary)(Dictionary)entry.Entity).ContainsKey("PrincipalsId") ? ((Dictionary)entry.Entity)["PrincipalsId"] : null) == null) { return entry.ReadTemporaryValue(2); } else { - var nullableValue = ((Dictionary)entry.Entity).ContainsKey("PrincipalsId") ? ((Dictionary)entry.Entity)["PrincipalsId"] : null; + var nullableValue = ((IDictionary)(Dictionary)entry.Entity).ContainsKey("PrincipalsId") ? ((Dictionary)entry.Entity)["PrincipalsId"] : null; return nullableValue == null ? default(long) : (long)nullableValue; } } @@ -193,7 +193,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas }, (InternalEntityEntry entry) => { - var nullableValue = ((Dictionary)entry.Entity).ContainsKey("PrincipalsId") ? ((Dictionary)entry.Entity)["PrincipalsId"] : null; + var nullableValue = ((IDictionary)(Dictionary)entry.Entity).ContainsKey("PrincipalsId") ? ((Dictionary)entry.Entity)["PrincipalsId"] : null; return nullableValue == null ? default(long) : (long)nullableValue; }, (InternalEntityEntry entry) => entry.ReadOriginalValue(principalsId, 2), @@ -208,15 +208,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas principalsId.TypeMapping = LongTypeMapping.Default.Clone( comparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), keyComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "INTEGER")); @@ -228,10 +228,10 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas propertyInfo: runtimeEntityType.FindIndexerPropertyInfo(), afterSaveBehavior: PropertySaveBehavior.Throw); principalsAlternateId.SetGetter( - (Dictionary entity) => (entity.ContainsKey("PrincipalsAlternateId") ? entity["PrincipalsAlternateId"] : null) == null ? new Guid("00000000-0000-0000-0000-000000000000") : (Guid)(entity.ContainsKey("PrincipalsAlternateId") ? entity["PrincipalsAlternateId"] : null), - (Dictionary entity) => (entity.ContainsKey("PrincipalsAlternateId") ? entity["PrincipalsAlternateId"] : null) == null, - (Dictionary instance) => (instance.ContainsKey("PrincipalsAlternateId") ? instance["PrincipalsAlternateId"] : null) == null ? new Guid("00000000-0000-0000-0000-000000000000") : (Guid)(instance.ContainsKey("PrincipalsAlternateId") ? instance["PrincipalsAlternateId"] : null), - (Dictionary instance) => (instance.ContainsKey("PrincipalsAlternateId") ? instance["PrincipalsAlternateId"] : null) == null); + (Dictionary entity) => (((IDictionary)entity).ContainsKey("PrincipalsAlternateId") ? entity["PrincipalsAlternateId"] : null) == null ? new Guid("00000000-0000-0000-0000-000000000000") : (Guid)(((IDictionary)entity).ContainsKey("PrincipalsAlternateId") ? entity["PrincipalsAlternateId"] : null), + (Dictionary entity) => (((IDictionary)entity).ContainsKey("PrincipalsAlternateId") ? entity["PrincipalsAlternateId"] : null) == null, + (Dictionary instance) => (((IDictionary)instance).ContainsKey("PrincipalsAlternateId") ? instance["PrincipalsAlternateId"] : null) == null ? new Guid("00000000-0000-0000-0000-000000000000") : (Guid)(((IDictionary)instance).ContainsKey("PrincipalsAlternateId") ? instance["PrincipalsAlternateId"] : null), + (Dictionary instance) => (((IDictionary)instance).ContainsKey("PrincipalsAlternateId") ? instance["PrincipalsAlternateId"] : null) == null); principalsAlternateId.SetSetter( (Dictionary entity, Guid value) => entity["PrincipalsAlternateId"] = (object)value); principalsAlternateId.SetMaterializationSetter( @@ -246,13 +246,13 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas else { { - if (entry.FlaggedAsTemporary(3) && (((Dictionary)entry.Entity).ContainsKey("PrincipalsAlternateId") ? ((Dictionary)entry.Entity)["PrincipalsAlternateId"] : null) == null) + if (entry.FlaggedAsTemporary(3) && (((IDictionary)(Dictionary)entry.Entity).ContainsKey("PrincipalsAlternateId") ? ((Dictionary)entry.Entity)["PrincipalsAlternateId"] : null) == null) { return entry.ReadTemporaryValue(3); } else { - var nullableValue = ((Dictionary)entry.Entity).ContainsKey("PrincipalsAlternateId") ? ((Dictionary)entry.Entity)["PrincipalsAlternateId"] : null; + var nullableValue = ((IDictionary)(Dictionary)entry.Entity).ContainsKey("PrincipalsAlternateId") ? ((Dictionary)entry.Entity)["PrincipalsAlternateId"] : null; return nullableValue == null ? default(Guid) : (Guid)nullableValue; } } @@ -260,7 +260,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas }, (InternalEntityEntry entry) => { - var nullableValue = ((Dictionary)entry.Entity).ContainsKey("PrincipalsAlternateId") ? ((Dictionary)entry.Entity)["PrincipalsAlternateId"] : null; + var nullableValue = ((IDictionary)(Dictionary)entry.Entity).ContainsKey("PrincipalsAlternateId") ? ((Dictionary)entry.Entity)["PrincipalsAlternateId"] : null; return nullableValue == null ? default(Guid) : (Guid)nullableValue; }, (InternalEntityEntry entry) => entry.ReadOriginalValue(principalsAlternateId, 3), @@ -285,17 +285,17 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas beforeSaveBehavior: PropertySaveBehavior.Ignore, afterSaveBehavior: PropertySaveBehavior.Ignore); rowid.SetGetter( - (Dictionary entity) => (entity.ContainsKey("rowid") ? entity["rowid"] : null) == null ? null : (byte[])(entity.ContainsKey("rowid") ? entity["rowid"] : null), - (Dictionary entity) => (entity.ContainsKey("rowid") ? entity["rowid"] : null) == null, - (Dictionary instance) => (instance.ContainsKey("rowid") ? instance["rowid"] : null) == null ? null : (byte[])(instance.ContainsKey("rowid") ? instance["rowid"] : null), - (Dictionary instance) => (instance.ContainsKey("rowid") ? instance["rowid"] : null) == null); + (Dictionary entity) => (((IDictionary)entity).ContainsKey("rowid") ? entity["rowid"] : null) == null ? null : (byte[])(((IDictionary)entity).ContainsKey("rowid") ? entity["rowid"] : null), + (Dictionary entity) => (((IDictionary)entity).ContainsKey("rowid") ? entity["rowid"] : null) == null, + (Dictionary instance) => (((IDictionary)instance).ContainsKey("rowid") ? instance["rowid"] : null) == null ? null : (byte[])(((IDictionary)instance).ContainsKey("rowid") ? instance["rowid"] : null), + (Dictionary instance) => (((IDictionary)instance).ContainsKey("rowid") ? instance["rowid"] : null) == null); rowid.SetSetter( (Dictionary entity, byte[] value) => entity["rowid"] = (object)value); rowid.SetMaterializationSetter( (Dictionary entity, byte[] value) => entity["rowid"] = (object)value); rowid.SetAccessors( - (InternalEntityEntry entry) => entry.FlaggedAsStoreGenerated(4) ? entry.ReadStoreGeneratedValue(4) : entry.FlaggedAsTemporary(4) && (((Dictionary)entry.Entity).ContainsKey("rowid") ? ((Dictionary)entry.Entity)["rowid"] : null) == null ? entry.ReadTemporaryValue(4) : (byte[])(((Dictionary)entry.Entity).ContainsKey("rowid") ? ((Dictionary)entry.Entity)["rowid"] : null), - (InternalEntityEntry entry) => (byte[])(((Dictionary)entry.Entity).ContainsKey("rowid") ? ((Dictionary)entry.Entity)["rowid"] : null), + (InternalEntityEntry entry) => entry.FlaggedAsStoreGenerated(4) ? entry.ReadStoreGeneratedValue(4) : entry.FlaggedAsTemporary(4) && (((IDictionary)(Dictionary)entry.Entity).ContainsKey("rowid") ? ((Dictionary)entry.Entity)["rowid"] : null) == null ? entry.ReadTemporaryValue(4) : (byte[])(((IDictionary)(Dictionary)entry.Entity).ContainsKey("rowid") ? ((Dictionary)entry.Entity)["rowid"] : null), + (InternalEntityEntry entry) => (byte[])(((IDictionary)(Dictionary)entry.Entity).ContainsKey("rowid") ? ((Dictionary)entry.Entity)["rowid"] : null), (InternalEntityEntry entry) => entry.ReadOriginalValue(rowid, 4), (InternalEntityEntry entry) => entry.GetCurrentValue(rowid), (ValueBuffer valueBuffer) => valueBuffer[4]); @@ -308,7 +308,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas rowid.TypeMapping = SqliteByteArrayTypeMapping.Default.Clone( comparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), - (byte[] v) => v.GetHashCode(), + (byte[] v) => ((object)v).GetHashCode(), (byte[] v) => v), keyComparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), @@ -361,11 +361,11 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) runtimeEntityType.SetOriginalValuesFactory( (InternalEntityEntry source) => { - var entity = (Dictionary)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)derivedsId.GetValueComparer()).Snapshot(source.GetCurrentValue(derivedsId)), ((ValueComparer)derivedsAlternateId.GetValueComparer()).Snapshot(source.GetCurrentValue(derivedsAlternateId)), ((ValueComparer)principalsId.GetValueComparer()).Snapshot(source.GetCurrentValue(principalsId)), ((ValueComparer)principalsAlternateId.GetValueComparer()).Snapshot(source.GetCurrentValue(principalsAlternateId)), source.GetCurrentValue(rowid) == null ? null : ((ValueComparer)rowid.GetValueComparer()).Snapshot(source.GetCurrentValue(rowid))); + var entity8 = (Dictionary)source.Entity; + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)derivedsId).GetValueComparer()).Snapshot(source.GetCurrentValue(derivedsId)), ((ValueComparer)((IProperty)derivedsAlternateId).GetValueComparer()).Snapshot(source.GetCurrentValue(derivedsAlternateId)), ((ValueComparer)((IProperty)principalsId).GetValueComparer()).Snapshot(source.GetCurrentValue(principalsId)), ((ValueComparer)((IProperty)principalsAlternateId).GetValueComparer()).Snapshot(source.GetCurrentValue(principalsAlternateId)), source.GetCurrentValue(rowid) == null ? null : ((ValueComparer)((IProperty)rowid).GetValueComparer()).Snapshot(source.GetCurrentValue(rowid))); }); runtimeEntityType.SetStoreGeneratedValuesFactory( - () => (ISnapshot)new Snapshot(((ValueComparer)derivedsId.GetValueComparer()).Snapshot(default(long)), ((ValueComparer)derivedsAlternateId.GetValueComparer()).Snapshot(default(Guid)), ((ValueComparer)principalsId.GetValueComparer()).Snapshot(default(long)), ((ValueComparer)principalsAlternateId.GetValueComparer()).Snapshot(default(Guid)), default(byte[]) == null ? null : ((ValueComparer)rowid.GetValueComparer()).Snapshot(default(byte[])))); + () => (ISnapshot)new Snapshot(((ValueComparer)((IProperty)derivedsId).GetValueComparer()).Snapshot(default(long)), ((ValueComparer)((IProperty)derivedsAlternateId).GetValueComparer()).Snapshot(default(Guid)), ((ValueComparer)((IProperty)principalsId).GetValueComparer()).Snapshot(default(long)), ((ValueComparer)((IProperty)principalsAlternateId).GetValueComparer()).Snapshot(default(Guid)), default(byte[]) == null ? null : ((ValueComparer)((IProperty)rowid).GetValueComparer()).Snapshot(default(byte[])))); runtimeEntityType.SetTemporaryValuesFactory( (InternalEntityEntry source) => (ISnapshot)new Snapshot(default(long), default(Guid), default(long), default(Guid), default(byte[]))); runtimeEntityType.SetShadowValuesFactory( @@ -375,8 +375,8 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) runtimeEntityType.SetRelationshipSnapshotFactory( (InternalEntityEntry source) => { - var entity = (Dictionary)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)derivedsId.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(derivedsId)), ((ValueComparer)derivedsAlternateId.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(derivedsAlternateId)), ((ValueComparer)principalsId.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalsId)), ((ValueComparer)principalsAlternateId.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalsAlternateId))); + var entity8 = (Dictionary)source.Entity; + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)derivedsId).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(derivedsId)), ((ValueComparer)((IProperty)derivedsAlternateId).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(derivedsAlternateId)), ((ValueComparer)((IProperty)principalsId).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalsId)), ((ValueComparer)((IProperty)principalsAlternateId).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalsAlternateId))); }); runtimeEntityType.Counts = new PropertyCounts( propertyCount: 5, diff --git a/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/BigModel/PrincipalDerivedEntityType.cs b/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/BigModel/PrincipalDerivedEntityType.cs index f60b1e56d41..2b8ac460079 100644 --- a/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/BigModel/PrincipalDerivedEntityType.cs +++ b/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/BigModel/PrincipalDerivedEntityType.cs @@ -124,11 +124,11 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) runtimeEntityType.SetOriginalValuesFactory( (InternalEntityEntry source) => { - var entity = (CompiledModelTestBase.PrincipalDerived>>)source.Entity; - return (ISnapshot)new Snapshot, Guid, CompiledModelTestBase.AnEnum, Nullable, CompiledModelTestBase.AFlagsEnum, CompiledModelTestBase.AFlagsEnum, Point, IPAddress[], IEnumerable, IList, List, DateTime[], IEnumerable, IList, List>(source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)id.GetValueComparer()).Snapshot(source.GetCurrentValue>(id)), ((ValueComparer)alternateId.GetValueComparer()).Snapshot(source.GetCurrentValue(alternateId)), ((ValueComparer)enum1.GetValueComparer()).Snapshot(source.GetCurrentValue(enum1)), source.GetCurrentValue>(enum2) == null ? null : ((ValueComparer>)enum2.GetValueComparer()).Snapshot(source.GetCurrentValue>(enum2)), ((ValueComparer)flagsEnum1.GetValueComparer()).Snapshot(source.GetCurrentValue(flagsEnum1)), ((ValueComparer)flagsEnum2.GetValueComparer()).Snapshot(source.GetCurrentValue(flagsEnum2)), source.GetCurrentValue(point) == null ? null : ((ValueComparer)point.GetValueComparer()).Snapshot(source.GetCurrentValue(point)), (IEnumerable)source.GetCurrentValue(refTypeArray) == null ? null : (IPAddress[])((ValueComparer>)refTypeArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(refTypeArray)), source.GetCurrentValue>(refTypeEnumerable) == null ? null : ((ValueComparer>)refTypeEnumerable.GetValueComparer()).Snapshot(source.GetCurrentValue>(refTypeEnumerable)), (IEnumerable)source.GetCurrentValue>(refTypeIList) == null ? null : (IList)((ValueComparer>)refTypeIList.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(refTypeIList)), (IEnumerable)source.GetCurrentValue>(refTypeList) == null ? null : (List)((ValueComparer>)refTypeList.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(refTypeList)), (IEnumerable)source.GetCurrentValue(valueTypeArray) == null ? null : (DateTime[])((ValueComparer>)valueTypeArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(valueTypeArray)), source.GetCurrentValue>(valueTypeEnumerable) == null ? null : ((ValueComparer>)valueTypeEnumerable.GetValueComparer()).Snapshot(source.GetCurrentValue>(valueTypeEnumerable)), (IEnumerable)source.GetCurrentValue>(valueTypeIList) == null ? null : (IList)((ValueComparer>)valueTypeIList.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeIList)), (IEnumerable)source.GetCurrentValue>(valueTypeList) == null ? null : (List)((ValueComparer>)valueTypeList.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeList))); + var entity8 = (CompiledModelTestBase.PrincipalDerived>>)source.Entity; + return (ISnapshot)new Snapshot, Guid, CompiledModelTestBase.AnEnum, Nullable, CompiledModelTestBase.AFlagsEnum, CompiledModelTestBase.AFlagsEnum, Point, IPAddress[], IEnumerable, IList, List, DateTime[], IEnumerable, IList, List>(source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)((IProperty)id).GetValueComparer()).Snapshot(source.GetCurrentValue>(id)), ((ValueComparer)((IProperty)alternateId).GetValueComparer()).Snapshot(source.GetCurrentValue(alternateId)), ((ValueComparer)((IProperty)enum1).GetValueComparer()).Snapshot(source.GetCurrentValue(enum1)), source.GetCurrentValue>(enum2) == null ? null : ((ValueComparer>)((IProperty)enum2).GetValueComparer()).Snapshot(source.GetCurrentValue>(enum2)), ((ValueComparer)((IProperty)flagsEnum1).GetValueComparer()).Snapshot(source.GetCurrentValue(flagsEnum1)), ((ValueComparer)((IProperty)flagsEnum2).GetValueComparer()).Snapshot(source.GetCurrentValue(flagsEnum2)), source.GetCurrentValue(point) == null ? null : ((ValueComparer)((IProperty)point).GetValueComparer()).Snapshot(source.GetCurrentValue(point)), (object)source.GetCurrentValue(refTypeArray) == null ? null : (IPAddress[])((ValueComparer)((IProperty)refTypeArray).GetValueComparer()).Snapshot((object)source.GetCurrentValue(refTypeArray)), (object)source.GetCurrentValue>(refTypeEnumerable) == null ? null : (IEnumerable)((ValueComparer)((IProperty)refTypeEnumerable).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeEnumerable)), (object)source.GetCurrentValue>(refTypeIList) == null ? null : (IList)((ValueComparer)((IProperty)refTypeIList).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeIList)), (object)source.GetCurrentValue>(refTypeList) == null ? null : (List)((ValueComparer)((IProperty)refTypeList).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeList)), (IEnumerable)source.GetCurrentValue(valueTypeArray) == null ? null : (DateTime[])((ValueComparer>)((IProperty)valueTypeArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(valueTypeArray)), source.GetCurrentValue>(valueTypeEnumerable) == null ? null : ((ValueComparer>)((IProperty)valueTypeEnumerable).GetValueComparer()).Snapshot(source.GetCurrentValue>(valueTypeEnumerable)), (IEnumerable)source.GetCurrentValue>(valueTypeIList) == null ? null : (IList)((ValueComparer>)((IProperty)valueTypeIList).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeIList)), (IEnumerable)source.GetCurrentValue>(valueTypeList) == null ? null : (List)((ValueComparer>)((IProperty)valueTypeList).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeList))); }); runtimeEntityType.SetStoreGeneratedValuesFactory( - () => (ISnapshot)new Snapshot, Guid, Point>(default(Nullable) == null ? null : ((ValueComparer>)id.GetValueComparer()).Snapshot(default(Nullable)), ((ValueComparer)alternateId.GetValueComparer()).Snapshot(default(Guid)), default(Point) == null ? null : ((ValueComparer)point.GetValueComparer()).Snapshot(default(Point)))); + () => (ISnapshot)new Snapshot, Guid, Point>(default(Nullable) == null ? null : ((ValueComparer>)((IProperty)id).GetValueComparer()).Snapshot(default(Nullable)), ((ValueComparer)((IProperty)alternateId).GetValueComparer()).Snapshot(default(Guid)), default(Point) == null ? null : ((ValueComparer)((IProperty)point).GetValueComparer()).Snapshot(default(Point)))); runtimeEntityType.SetTemporaryValuesFactory( (InternalEntityEntry source) => (ISnapshot)new Snapshot, Guid, Point>(default(Nullable), default(Guid), default(Point))); runtimeEntityType.SetShadowValuesFactory( @@ -138,8 +138,8 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) runtimeEntityType.SetRelationshipSnapshotFactory( (InternalEntityEntry source) => { - var entity = (CompiledModelTestBase.PrincipalDerived>>)source.Entity; - return (ISnapshot)new Snapshot, Guid, object, object, object, object, object>(source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)id.GetKeyValueComparer()).Snapshot(source.GetCurrentValue>(id)), ((ValueComparer)alternateId.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(alternateId)), PrincipalBaseEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalBase__ownedField(entity), null, UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalDerived1_Dependent(entity), SnapshotFactoryFactory.SnapshotCollection(UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalDerived1_ManyOwned(entity)), null); + var entity8 = (CompiledModelTestBase.PrincipalDerived>>)source.Entity; + return (ISnapshot)new Snapshot, Guid, object, object, object, object, object>(source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)((IProperty)id).GetKeyValueComparer()).Snapshot(source.GetCurrentValue>(id)), ((ValueComparer)((IProperty)alternateId).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(alternateId)), PrincipalBaseEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalBase__ownedField(entity8), null, UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalDerived1_Dependent(entity8), SnapshotFactoryFactory.SnapshotCollection(UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalDerived1_ManyOwned(entity8)), null); }); runtimeEntityType.Counts = new PropertyCounts( propertyCount: 15, diff --git a/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/BigModel_with_JSON_columns/DataEntityType.cs b/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/BigModel_with_JSON_columns/DataEntityType.cs index 6b201e76f34..58e274edf46 100644 --- a/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/BigModel_with_JSON_columns/DataEntityType.cs +++ b/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/BigModel_with_JSON_columns/DataEntityType.cs @@ -91,7 +91,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas blob.TypeMapping = SqliteByteArrayTypeMapping.Default.Clone( comparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), - (byte[] v) => v.GetHashCode(), + (byte[] v) => ((object)v).GetHashCode(), (byte[] v) => v), keyComparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), @@ -131,10 +131,10 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (CompiledModelTestBase.Data)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)id.GetValueComparer()).Snapshot(source.GetCurrentValue(id)), source.GetCurrentValue(blob) == null ? null : ((ValueComparer)blob.GetValueComparer()).Snapshot(source.GetCurrentValue(blob)), source.GetCurrentValue(point) == null ? null : ((ValueComparer)point.GetValueComparer()).Snapshot(source.GetCurrentValue(point))); + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetValueComparer()).Snapshot(source.GetCurrentValue(id)), source.GetCurrentValue(blob) == null ? null : ((ValueComparer)((IProperty)blob).GetValueComparer()).Snapshot(source.GetCurrentValue(blob)), source.GetCurrentValue(point) == null ? null : ((ValueComparer)((IProperty)point).GetValueComparer()).Snapshot(source.GetCurrentValue(point))); }); runtimeEntityType.SetStoreGeneratedValuesFactory( - () => (ISnapshot)new Snapshot(((ValueComparer)id.GetValueComparer()).Snapshot(default(int)))); + () => (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetValueComparer()).Snapshot(default(int)))); runtimeEntityType.SetTemporaryValuesFactory( (InternalEntityEntry source) => (ISnapshot)new Snapshot(default(int))); runtimeEntityType.SetShadowValuesFactory( @@ -145,7 +145,7 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (CompiledModelTestBase.Data)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)id.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(id))); + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(id))); }); runtimeEntityType.Counts = new PropertyCounts( propertyCount: 3, diff --git a/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/BigModel_with_JSON_columns/DbContextModelBuilder.cs b/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/BigModel_with_JSON_columns/DbContextModelBuilder.cs index a8f1714f216..adb08e8fde9 100644 --- a/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/BigModel_with_JSON_columns/DbContextModelBuilder.cs +++ b/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/BigModel_with_JSON_columns/DbContextModelBuilder.cs @@ -239,6 +239,8 @@ private IRelationalModel CreateRelationalModel() microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("Bool", boolColumnBase); var boolArrayColumnBase = new ColumnBase("BoolArray", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("BoolArray", boolArrayColumnBase); + var boolNestedCollectionColumnBase = new ColumnBase("BoolNestedCollection", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); + microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("BoolNestedCollection", boolNestedCollectionColumnBase); var boolToStringConverterPropertyColumnBase = new ColumnBase("BoolToStringConverterProperty", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("BoolToStringConverterProperty", boolToStringConverterPropertyColumnBase); var boolToTwoValuesConverterPropertyColumnBase = new ColumnBase("BoolToTwoValuesConverterProperty", "INTEGER", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); @@ -249,6 +251,8 @@ private IRelationalModel CreateRelationalModel() microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("Bytes", bytesColumnBase); var bytesArrayColumnBase = new ColumnBase("BytesArray", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("BytesArray", bytesArrayColumnBase); + var bytesNestedCollectionColumnBase = new ColumnBase("BytesNestedCollection", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); + microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("BytesNestedCollection", bytesNestedCollectionColumnBase); var bytesToStringConverterPropertyColumnBase = new ColumnBase("BytesToStringConverterProperty", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("BytesToStringConverterProperty", bytesToStringConverterPropertyColumnBase); var castingConverterPropertyColumnBase = new ColumnBase("CastingConverterProperty", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); @@ -257,6 +261,8 @@ private IRelationalModel CreateRelationalModel() microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("Char", charColumnBase); var charArrayColumnBase = new ColumnBase("CharArray", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("CharArray", charArrayColumnBase); + var charNestedCollectionColumnBase = new ColumnBase("CharNestedCollection", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); + microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("CharNestedCollection", charNestedCollectionColumnBase); var charToStringConverterPropertyColumnBase = new ColumnBase("CharToStringConverterProperty", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("CharToStringConverterProperty", charToStringConverterPropertyColumnBase); var dateOnlyColumnBase = new ColumnBase("DateOnly", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); @@ -321,6 +327,8 @@ private IRelationalModel CreateRelationalModel() microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("Enum32AsStringCollection", enum32AsStringCollectionColumnBase); var enum32CollectionColumnBase = new ColumnBase("Enum32Collection", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("Enum32Collection", enum32CollectionColumnBase); + var enum32NestedCollectionColumnBase = new ColumnBase("Enum32NestedCollection", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); + microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("Enum32NestedCollection", enum32NestedCollectionColumnBase); var enum64ColumnBase = new ColumnBase("Enum64", "INTEGER", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("Enum64", enum64ColumnBase); var enum64ArrayColumnBase = new ColumnBase("Enum64Array", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); @@ -345,6 +353,8 @@ private IRelationalModel CreateRelationalModel() microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("Enum8AsStringCollection", enum8AsStringCollectionColumnBase); var enum8CollectionColumnBase = new ColumnBase("Enum8Collection", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("Enum8Collection", enum8CollectionColumnBase); + var enum8NestedCollectionColumnBase = new ColumnBase("Enum8NestedCollection", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); + microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("Enum8NestedCollection", enum8NestedCollectionColumnBase); var enumToNumberConverterPropertyColumnBase = new ColumnBase("EnumToNumberConverterProperty", "INTEGER", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("EnumToNumberConverterProperty", enumToNumberConverterPropertyColumnBase); var enumToStringConverterPropertyColumnBase = new ColumnBase("EnumToStringConverterProperty", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); @@ -385,6 +395,8 @@ private IRelationalModel CreateRelationalModel() microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("EnumU64AsStringCollection", enumU64AsStringCollectionColumnBase); var enumU64CollectionColumnBase = new ColumnBase("EnumU64Collection", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("EnumU64Collection", enumU64CollectionColumnBase); + var enumU64NestedCollectionColumnBase = new ColumnBase("EnumU64NestedCollection", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); + microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("EnumU64NestedCollection", enumU64NestedCollectionColumnBase); var enumU8ColumnBase = new ColumnBase("EnumU8", "INTEGER", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("EnumU8", enumU8ColumnBase); var enumU8ArrayColumnBase = new ColumnBase("EnumU8Array", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); @@ -405,6 +417,8 @@ private IRelationalModel CreateRelationalModel() microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("Guid", guidColumnBase); var guidArrayColumnBase = new ColumnBase("GuidArray", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("GuidArray", guidArrayColumnBase); + var guidNestedCollectionColumnBase = new ColumnBase("GuidNestedCollection", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); + microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("GuidNestedCollection", guidNestedCollectionColumnBase); var guidToBytesConverterPropertyColumnBase = new ColumnBase("GuidToBytesConverterProperty", "BLOB", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("GuidToBytesConverterProperty", guidToBytesConverterPropertyColumnBase); var guidToStringConverterPropertyColumnBase = new ColumnBase("GuidToStringConverterProperty", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); @@ -427,14 +441,20 @@ private IRelationalModel CreateRelationalModel() microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("Int32", int32ColumnBase); var int32ArrayColumnBase = new ColumnBase("Int32Array", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("Int32Array", int32ArrayColumnBase); + var int32NestedCollectionColumnBase = new ColumnBase("Int32NestedCollection", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); + microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("Int32NestedCollection", int32NestedCollectionColumnBase); var int64ColumnBase = new ColumnBase("Int64", "INTEGER", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("Int64", int64ColumnBase); var int64ArrayColumnBase = new ColumnBase("Int64Array", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("Int64Array", int64ArrayColumnBase); + var int64NestedCollectionColumnBase = new ColumnBase("Int64NestedCollection", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); + microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("Int64NestedCollection", int64NestedCollectionColumnBase); var int8ColumnBase = new ColumnBase("Int8", "INTEGER", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("Int8", int8ColumnBase); var int8ArrayColumnBase = new ColumnBase("Int8Array", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("Int8Array", int8ArrayColumnBase); + var int8NestedCollectionColumnBase = new ColumnBase("Int8NestedCollection", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); + microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("Int8NestedCollection", int8NestedCollectionColumnBase); var intNumberToBytesConverterPropertyColumnBase = new ColumnBase("IntNumberToBytesConverterProperty", "BLOB", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("IntNumberToBytesConverterProperty", intNumberToBytesConverterPropertyColumnBase); var intNumberToStringConverterPropertyColumnBase = new ColumnBase("IntNumberToStringConverterProperty", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); @@ -458,6 +478,8 @@ private IRelationalModel CreateRelationalModel() microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("NullableBytes", nullableBytesColumnBase); var nullableBytesArrayColumnBase = new ColumnBase("NullableBytesArray", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("NullableBytesArray", nullableBytesArrayColumnBase); + var nullableBytesNestedCollectionColumnBase = new ColumnBase("NullableBytesNestedCollection", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); + microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("NullableBytesNestedCollection", nullableBytesNestedCollectionColumnBase); var nullableCharColumnBase = new ColumnBase("NullableChar", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase) { IsNullable = true @@ -529,6 +551,8 @@ private IRelationalModel CreateRelationalModel() microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("NullableEnum32AsStringCollection", nullableEnum32AsStringCollectionColumnBase); var nullableEnum32CollectionColumnBase = new ColumnBase("NullableEnum32Collection", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("NullableEnum32Collection", nullableEnum32CollectionColumnBase); + var nullableEnum32NestedCollectionColumnBase = new ColumnBase("NullableEnum32NestedCollection", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); + microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("NullableEnum32NestedCollection", nullableEnum32NestedCollectionColumnBase); var nullableEnum64ColumnBase = new ColumnBase("NullableEnum64", "INTEGER", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase) { IsNullable = true @@ -565,6 +589,8 @@ private IRelationalModel CreateRelationalModel() microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("NullableEnum8AsStringCollection", nullableEnum8AsStringCollectionColumnBase); var nullableEnum8CollectionColumnBase = new ColumnBase("NullableEnum8Collection", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("NullableEnum8Collection", nullableEnum8CollectionColumnBase); + var nullableEnum8NestedCollectionColumnBase = new ColumnBase("NullableEnum8NestedCollection", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); + microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("NullableEnum8NestedCollection", nullableEnum8NestedCollectionColumnBase); var nullableEnumU16ColumnBase = new ColumnBase("NullableEnumU16", "INTEGER", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase) { IsNullable = true @@ -619,6 +645,8 @@ private IRelationalModel CreateRelationalModel() microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("NullableEnumU64AsStringCollection", nullableEnumU64AsStringCollectionColumnBase); var nullableEnumU64CollectionColumnBase = new ColumnBase("NullableEnumU64Collection", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("NullableEnumU64Collection", nullableEnumU64CollectionColumnBase); + var nullableEnumU64NestedCollectionColumnBase = new ColumnBase("NullableEnumU64NestedCollection", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); + microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("NullableEnumU64NestedCollection", nullableEnumU64NestedCollectionColumnBase); var nullableEnumU8ColumnBase = new ColumnBase("NullableEnumU8", "INTEGER", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase) { IsNullable = true @@ -651,6 +679,8 @@ private IRelationalModel CreateRelationalModel() microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("NullableGuid", nullableGuidColumnBase); var nullableGuidArrayColumnBase = new ColumnBase("NullableGuidArray", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("NullableGuidArray", nullableGuidArrayColumnBase); + var nullableGuidNestedCollectionColumnBase = new ColumnBase("NullableGuidNestedCollection", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); + microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("NullableGuidNestedCollection", nullableGuidNestedCollectionColumnBase); var nullableIPAddressColumnBase = new ColumnBase("NullableIPAddress", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase) { IsNullable = true @@ -672,6 +702,8 @@ private IRelationalModel CreateRelationalModel() microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("NullableInt32", nullableInt32ColumnBase); var nullableInt32ArrayColumnBase = new ColumnBase("NullableInt32Array", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("NullableInt32Array", nullableInt32ArrayColumnBase); + var nullableInt32NestedCollectionColumnBase = new ColumnBase("NullableInt32NestedCollection", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); + microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("NullableInt32NestedCollection", nullableInt32NestedCollectionColumnBase); var nullableInt64ColumnBase = new ColumnBase("NullableInt64", "INTEGER", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase) { IsNullable = true @@ -679,6 +711,8 @@ private IRelationalModel CreateRelationalModel() microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("NullableInt64", nullableInt64ColumnBase); var nullableInt64ArrayColumnBase = new ColumnBase("NullableInt64Array", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("NullableInt64Array", nullableInt64ArrayColumnBase); + var nullableInt64NestedCollectionColumnBase = new ColumnBase("NullableInt64NestedCollection", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); + microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("NullableInt64NestedCollection", nullableInt64NestedCollectionColumnBase); var nullableInt8ColumnBase = new ColumnBase("NullableInt8", "INTEGER", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase) { IsNullable = true @@ -693,6 +727,8 @@ private IRelationalModel CreateRelationalModel() microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("NullablePhysicalAddress", nullablePhysicalAddressColumnBase); var nullablePhysicalAddressArrayColumnBase = new ColumnBase("NullablePhysicalAddressArray", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("NullablePhysicalAddressArray", nullablePhysicalAddressArrayColumnBase); + var nullablePhysicalAddressNestedCollectionColumnBase = new ColumnBase("NullablePhysicalAddressNestedCollection", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); + microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("NullablePhysicalAddressNestedCollection", nullablePhysicalAddressNestedCollectionColumnBase); var nullableStringColumnBase = new ColumnBase("NullableString", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase) { IsNullable = true @@ -700,6 +736,8 @@ private IRelationalModel CreateRelationalModel() microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("NullableString", nullableStringColumnBase); var nullableStringArrayColumnBase = new ColumnBase("NullableStringArray", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("NullableStringArray", nullableStringArrayColumnBase); + var nullableStringNestedCollectionColumnBase = new ColumnBase("NullableStringNestedCollection", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); + microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("NullableStringNestedCollection", nullableStringNestedCollectionColumnBase); var nullableTimeOnlyColumnBase = new ColumnBase("NullableTimeOnly", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase) { IsNullable = true @@ -742,6 +780,8 @@ private IRelationalModel CreateRelationalModel() microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("NullableUInt8", nullableUInt8ColumnBase); var nullableUInt8ArrayColumnBase = new ColumnBase("NullableUInt8Array", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("NullableUInt8Array", nullableUInt8ArrayColumnBase); + var nullableUInt8NestedCollectionColumnBase = new ColumnBase("NullableUInt8NestedCollection", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); + microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("NullableUInt8NestedCollection", nullableUInt8NestedCollectionColumnBase); var nullableUriColumnBase = new ColumnBase("NullableUri", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase) { IsNullable = true @@ -761,6 +801,8 @@ private IRelationalModel CreateRelationalModel() microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("String", stringColumnBase); var stringArrayColumnBase = new ColumnBase("StringArray", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("StringArray", stringArrayColumnBase); + var stringNestedCollectionColumnBase = new ColumnBase("StringNestedCollection", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); + microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("StringNestedCollection", stringNestedCollectionColumnBase); var stringToBoolConverterPropertyColumnBase = new ColumnBase("StringToBoolConverterProperty", "INTEGER", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("StringToBoolConverterProperty", stringToBoolConverterPropertyColumnBase); var stringToBytesConverterPropertyColumnBase = new ColumnBase("StringToBytesConverterProperty", "BLOB", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase) @@ -824,6 +866,8 @@ private IRelationalModel CreateRelationalModel() microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("UInt8", uInt8ColumnBase); var uInt8ArrayColumnBase = new ColumnBase("UInt8Array", "BLOB", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("UInt8Array", uInt8ArrayColumnBase); + var uInt8NestedCollectionColumnBase = new ColumnBase("UInt8NestedCollection", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); + microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("UInt8NestedCollection", uInt8NestedCollectionColumnBase); var uriColumnBase = new ColumnBase("Uri", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase.Columns.Add("Uri", uriColumnBase); var uriArrayColumnBase = new ColumnBase("UriArray", "TEXT", microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesTableBase); @@ -837,15 +881,18 @@ private IRelationalModel CreateRelationalModel() RelationalModel.CreateColumnMapping((ColumnBase)idColumnBase1, manyTypes.FindProperty("Id")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)boolColumnBase, manyTypes.FindProperty("Bool")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)boolArrayColumnBase, manyTypes.FindProperty("BoolArray")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)boolNestedCollectionColumnBase, manyTypes.FindProperty("BoolNestedCollection")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)boolToStringConverterPropertyColumnBase, manyTypes.FindProperty("BoolToStringConverterProperty")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)boolToTwoValuesConverterPropertyColumnBase, manyTypes.FindProperty("BoolToTwoValuesConverterProperty")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)boolToZeroOneConverterPropertyColumnBase, manyTypes.FindProperty("BoolToZeroOneConverterProperty")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)bytesColumnBase, manyTypes.FindProperty("Bytes")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)bytesArrayColumnBase, manyTypes.FindProperty("BytesArray")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)bytesNestedCollectionColumnBase, manyTypes.FindProperty("BytesNestedCollection")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)bytesToStringConverterPropertyColumnBase, manyTypes.FindProperty("BytesToStringConverterProperty")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)castingConverterPropertyColumnBase, manyTypes.FindProperty("CastingConverterProperty")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)charColumnBase, manyTypes.FindProperty("Char")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)charArrayColumnBase, manyTypes.FindProperty("CharArray")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)charNestedCollectionColumnBase, manyTypes.FindProperty("CharNestedCollection")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)charToStringConverterPropertyColumnBase, manyTypes.FindProperty("CharToStringConverterProperty")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)dateOnlyColumnBase, manyTypes.FindProperty("DateOnly")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)dateOnlyArrayColumnBase, manyTypes.FindProperty("DateOnlyArray")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); @@ -878,6 +925,7 @@ private IRelationalModel CreateRelationalModel() RelationalModel.CreateColumnMapping((ColumnBase)enum32AsStringArrayColumnBase, manyTypes.FindProperty("Enum32AsStringArray")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)enum32AsStringCollectionColumnBase, manyTypes.FindProperty("Enum32AsStringCollection")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)enum32CollectionColumnBase, manyTypes.FindProperty("Enum32Collection")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)enum32NestedCollectionColumnBase, manyTypes.FindProperty("Enum32NestedCollection")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)enum64ColumnBase, manyTypes.FindProperty("Enum64")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)enum64ArrayColumnBase, manyTypes.FindProperty("Enum64Array")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)enum64AsStringColumnBase, manyTypes.FindProperty("Enum64AsString")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); @@ -890,6 +938,7 @@ private IRelationalModel CreateRelationalModel() RelationalModel.CreateColumnMapping((ColumnBase)enum8AsStringArrayColumnBase, manyTypes.FindProperty("Enum8AsStringArray")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)enum8AsStringCollectionColumnBase, manyTypes.FindProperty("Enum8AsStringCollection")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)enum8CollectionColumnBase, manyTypes.FindProperty("Enum8Collection")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)enum8NestedCollectionColumnBase, manyTypes.FindProperty("Enum8NestedCollection")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)enumToNumberConverterPropertyColumnBase, manyTypes.FindProperty("EnumToNumberConverterProperty")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)enumToStringConverterPropertyColumnBase, manyTypes.FindProperty("EnumToStringConverterProperty")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)enumU16ColumnBase, manyTypes.FindProperty("EnumU16")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); @@ -910,6 +959,7 @@ private IRelationalModel CreateRelationalModel() RelationalModel.CreateColumnMapping((ColumnBase)enumU64AsStringArrayColumnBase, manyTypes.FindProperty("EnumU64AsStringArray")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)enumU64AsStringCollectionColumnBase, manyTypes.FindProperty("EnumU64AsStringCollection")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)enumU64CollectionColumnBase, manyTypes.FindProperty("EnumU64Collection")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)enumU64NestedCollectionColumnBase, manyTypes.FindProperty("EnumU64NestedCollection")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)enumU8ColumnBase, manyTypes.FindProperty("EnumU8")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)enumU8ArrayColumnBase, manyTypes.FindProperty("EnumU8Array")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)enumU8AsStringColumnBase, manyTypes.FindProperty("EnumU8AsString")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); @@ -920,6 +970,7 @@ private IRelationalModel CreateRelationalModel() RelationalModel.CreateColumnMapping((ColumnBase)floatArrayColumnBase, manyTypes.FindProperty("FloatArray")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)guidColumnBase, manyTypes.FindProperty("Guid")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)guidArrayColumnBase, manyTypes.FindProperty("GuidArray")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)guidNestedCollectionColumnBase, manyTypes.FindProperty("GuidNestedCollection")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)guidToBytesConverterPropertyColumnBase, manyTypes.FindProperty("GuidToBytesConverterProperty")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)guidToStringConverterPropertyColumnBase, manyTypes.FindProperty("GuidToStringConverterProperty")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)iPAddressColumnBase, manyTypes.FindProperty("IPAddress")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); @@ -930,10 +981,13 @@ private IRelationalModel CreateRelationalModel() RelationalModel.CreateColumnMapping((ColumnBase)int16ArrayColumnBase, manyTypes.FindProperty("Int16Array")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)int32ColumnBase, manyTypes.FindProperty("Int32")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)int32ArrayColumnBase, manyTypes.FindProperty("Int32Array")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)int32NestedCollectionColumnBase, manyTypes.FindProperty("Int32NestedCollection")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)int64ColumnBase, manyTypes.FindProperty("Int64")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)int64ArrayColumnBase, manyTypes.FindProperty("Int64Array")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)int64NestedCollectionColumnBase, manyTypes.FindProperty("Int64NestedCollection")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)int8ColumnBase, manyTypes.FindProperty("Int8")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)int8ArrayColumnBase, manyTypes.FindProperty("Int8Array")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)int8NestedCollectionColumnBase, manyTypes.FindProperty("Int8NestedCollection")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)intNumberToBytesConverterPropertyColumnBase, manyTypes.FindProperty("IntNumberToBytesConverterProperty")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)intNumberToStringConverterPropertyColumnBase, manyTypes.FindProperty("IntNumberToStringConverterProperty")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullIntToNullStringConverterPropertyColumnBase, manyTypes.FindProperty("NullIntToNullStringConverterProperty")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); @@ -941,6 +995,7 @@ private IRelationalModel CreateRelationalModel() RelationalModel.CreateColumnMapping((ColumnBase)nullableBoolArrayColumnBase, manyTypes.FindProperty("NullableBoolArray")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullableBytesColumnBase, manyTypes.FindProperty("NullableBytes")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullableBytesArrayColumnBase, manyTypes.FindProperty("NullableBytesArray")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nullableBytesNestedCollectionColumnBase, manyTypes.FindProperty("NullableBytesNestedCollection")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullableCharColumnBase, manyTypes.FindProperty("NullableChar")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullableCharArrayColumnBase, manyTypes.FindProperty("NullableCharArray")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullableDateOnlyColumnBase, manyTypes.FindProperty("NullableDateOnly")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); @@ -963,6 +1018,7 @@ private IRelationalModel CreateRelationalModel() RelationalModel.CreateColumnMapping((ColumnBase)nullableEnum32AsStringArrayColumnBase, manyTypes.FindProperty("NullableEnum32AsStringArray")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullableEnum32AsStringCollectionColumnBase, manyTypes.FindProperty("NullableEnum32AsStringCollection")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullableEnum32CollectionColumnBase, manyTypes.FindProperty("NullableEnum32Collection")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nullableEnum32NestedCollectionColumnBase, manyTypes.FindProperty("NullableEnum32NestedCollection")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullableEnum64ColumnBase, manyTypes.FindProperty("NullableEnum64")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullableEnum64ArrayColumnBase, manyTypes.FindProperty("NullableEnum64Array")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullableEnum64AsStringColumnBase, manyTypes.FindProperty("NullableEnum64AsString")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); @@ -975,6 +1031,7 @@ private IRelationalModel CreateRelationalModel() RelationalModel.CreateColumnMapping((ColumnBase)nullableEnum8AsStringArrayColumnBase, manyTypes.FindProperty("NullableEnum8AsStringArray")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullableEnum8AsStringCollectionColumnBase, manyTypes.FindProperty("NullableEnum8AsStringCollection")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullableEnum8CollectionColumnBase, manyTypes.FindProperty("NullableEnum8Collection")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nullableEnum8NestedCollectionColumnBase, manyTypes.FindProperty("NullableEnum8NestedCollection")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullableEnumU16ColumnBase, manyTypes.FindProperty("NullableEnumU16")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullableEnumU16ArrayColumnBase, manyTypes.FindProperty("NullableEnumU16Array")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullableEnumU16AsStringColumnBase, manyTypes.FindProperty("NullableEnumU16AsString")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); @@ -993,6 +1050,7 @@ private IRelationalModel CreateRelationalModel() RelationalModel.CreateColumnMapping((ColumnBase)nullableEnumU64AsStringArrayColumnBase, manyTypes.FindProperty("NullableEnumU64AsStringArray")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullableEnumU64AsStringCollectionColumnBase, manyTypes.FindProperty("NullableEnumU64AsStringCollection")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullableEnumU64CollectionColumnBase, manyTypes.FindProperty("NullableEnumU64Collection")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nullableEnumU64NestedCollectionColumnBase, manyTypes.FindProperty("NullableEnumU64NestedCollection")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullableEnumU8ColumnBase, manyTypes.FindProperty("NullableEnumU8")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullableEnumU8ArrayColumnBase, manyTypes.FindProperty("NullableEnumU8Array")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullableEnumU8AsStringColumnBase, manyTypes.FindProperty("NullableEnumU8AsString")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); @@ -1003,20 +1061,25 @@ private IRelationalModel CreateRelationalModel() RelationalModel.CreateColumnMapping((ColumnBase)nullableFloatArrayColumnBase, manyTypes.FindProperty("NullableFloatArray")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullableGuidColumnBase, manyTypes.FindProperty("NullableGuid")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullableGuidArrayColumnBase, manyTypes.FindProperty("NullableGuidArray")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nullableGuidNestedCollectionColumnBase, manyTypes.FindProperty("NullableGuidNestedCollection")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullableIPAddressColumnBase, manyTypes.FindProperty("NullableIPAddress")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullableIPAddressArrayColumnBase, manyTypes.FindProperty("NullableIPAddressArray")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullableInt16ColumnBase, manyTypes.FindProperty("NullableInt16")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullableInt16ArrayColumnBase, manyTypes.FindProperty("NullableInt16Array")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullableInt32ColumnBase, manyTypes.FindProperty("NullableInt32")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullableInt32ArrayColumnBase, manyTypes.FindProperty("NullableInt32Array")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nullableInt32NestedCollectionColumnBase, manyTypes.FindProperty("NullableInt32NestedCollection")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullableInt64ColumnBase, manyTypes.FindProperty("NullableInt64")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullableInt64ArrayColumnBase, manyTypes.FindProperty("NullableInt64Array")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nullableInt64NestedCollectionColumnBase, manyTypes.FindProperty("NullableInt64NestedCollection")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullableInt8ColumnBase, manyTypes.FindProperty("NullableInt8")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullableInt8ArrayColumnBase, manyTypes.FindProperty("NullableInt8Array")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullablePhysicalAddressColumnBase, manyTypes.FindProperty("NullablePhysicalAddress")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullablePhysicalAddressArrayColumnBase, manyTypes.FindProperty("NullablePhysicalAddressArray")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nullablePhysicalAddressNestedCollectionColumnBase, manyTypes.FindProperty("NullablePhysicalAddressNestedCollection")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullableStringColumnBase, manyTypes.FindProperty("NullableString")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullableStringArrayColumnBase, manyTypes.FindProperty("NullableStringArray")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nullableStringNestedCollectionColumnBase, manyTypes.FindProperty("NullableStringNestedCollection")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullableTimeOnlyColumnBase, manyTypes.FindProperty("NullableTimeOnly")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullableTimeOnlyArrayColumnBase, manyTypes.FindProperty("NullableTimeOnlyArray")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullableTimeSpanColumnBase, manyTypes.FindProperty("NullableTimeSpan")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); @@ -1029,6 +1092,7 @@ private IRelationalModel CreateRelationalModel() RelationalModel.CreateColumnMapping((ColumnBase)nullableUInt64ArrayColumnBase, manyTypes.FindProperty("NullableUInt64Array")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullableUInt8ColumnBase, manyTypes.FindProperty("NullableUInt8")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullableUInt8ArrayColumnBase, manyTypes.FindProperty("NullableUInt8Array")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)nullableUInt8NestedCollectionColumnBase, manyTypes.FindProperty("NullableUInt8NestedCollection")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullableUriColumnBase, manyTypes.FindProperty("NullableUri")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)nullableUriArrayColumnBase, manyTypes.FindProperty("NullableUriArray")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)physicalAddressColumnBase, manyTypes.FindProperty("PhysicalAddress")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); @@ -1037,6 +1101,7 @@ private IRelationalModel CreateRelationalModel() RelationalModel.CreateColumnMapping((ColumnBase)physicalAddressToStringConverterPropertyColumnBase, manyTypes.FindProperty("PhysicalAddressToStringConverterProperty")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)stringColumnBase, manyTypes.FindProperty("String")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)stringArrayColumnBase, manyTypes.FindProperty("StringArray")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)stringNestedCollectionColumnBase, manyTypes.FindProperty("StringNestedCollection")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)stringToBoolConverterPropertyColumnBase, manyTypes.FindProperty("StringToBoolConverterProperty")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)stringToBytesConverterPropertyColumnBase, manyTypes.FindProperty("StringToBytesConverterProperty")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)stringToCharConverterPropertyColumnBase, manyTypes.FindProperty("StringToCharConverterProperty")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); @@ -1067,6 +1132,7 @@ private IRelationalModel CreateRelationalModel() RelationalModel.CreateColumnMapping((ColumnBase)uInt64ArrayColumnBase, manyTypes.FindProperty("UInt64Array")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)uInt8ColumnBase, manyTypes.FindProperty("UInt8")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)uInt8ArrayColumnBase, manyTypes.FindProperty("UInt8Array")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); + RelationalModel.CreateColumnMapping((ColumnBase)uInt8NestedCollectionColumnBase, manyTypes.FindProperty("UInt8NestedCollection")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)uriColumnBase, manyTypes.FindProperty("Uri")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)uriArrayColumnBase, manyTypes.FindProperty("UriArray")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); RelationalModel.CreateColumnMapping((ColumnBase)uriToStringConverterPropertyColumnBase, manyTypes.FindProperty("UriToStringConverterProperty")!, microsoftEntityFrameworkCoreScaffoldingCompiledModelTestBaseManyTypesMappingBase); @@ -1080,6 +1146,8 @@ private IRelationalModel CreateRelationalModel() manyTypesTable.Columns.Add("Bool", boolColumn); var boolArrayColumn = new Column("BoolArray", "TEXT", manyTypesTable); manyTypesTable.Columns.Add("BoolArray", boolArrayColumn); + var boolNestedCollectionColumn = new Column("BoolNestedCollection", "TEXT", manyTypesTable); + manyTypesTable.Columns.Add("BoolNestedCollection", boolNestedCollectionColumn); var boolToStringConverterPropertyColumn = new Column("BoolToStringConverterProperty", "TEXT", manyTypesTable); manyTypesTable.Columns.Add("BoolToStringConverterProperty", boolToStringConverterPropertyColumn); var boolToTwoValuesConverterPropertyColumn = new Column("BoolToTwoValuesConverterProperty", "INTEGER", manyTypesTable); @@ -1090,6 +1158,8 @@ private IRelationalModel CreateRelationalModel() manyTypesTable.Columns.Add("Bytes", bytesColumn); var bytesArrayColumn = new Column("BytesArray", "TEXT", manyTypesTable); manyTypesTable.Columns.Add("BytesArray", bytesArrayColumn); + var bytesNestedCollectionColumn = new Column("BytesNestedCollection", "TEXT", manyTypesTable); + manyTypesTable.Columns.Add("BytesNestedCollection", bytesNestedCollectionColumn); var bytesToStringConverterPropertyColumn = new Column("BytesToStringConverterProperty", "TEXT", manyTypesTable); manyTypesTable.Columns.Add("BytesToStringConverterProperty", bytesToStringConverterPropertyColumn); var castingConverterPropertyColumn = new Column("CastingConverterProperty", "TEXT", manyTypesTable); @@ -1098,6 +1168,8 @@ private IRelationalModel CreateRelationalModel() manyTypesTable.Columns.Add("Char", charColumn); var charArrayColumn = new Column("CharArray", "TEXT", manyTypesTable); manyTypesTable.Columns.Add("CharArray", charArrayColumn); + var charNestedCollectionColumn = new Column("CharNestedCollection", "TEXT", manyTypesTable); + manyTypesTable.Columns.Add("CharNestedCollection", charNestedCollectionColumn); var charToStringConverterPropertyColumn = new Column("CharToStringConverterProperty", "TEXT", manyTypesTable); manyTypesTable.Columns.Add("CharToStringConverterProperty", charToStringConverterPropertyColumn); var dateOnlyColumn = new Column("DateOnly", "TEXT", manyTypesTable); @@ -1162,6 +1234,8 @@ private IRelationalModel CreateRelationalModel() manyTypesTable.Columns.Add("Enum32AsStringCollection", enum32AsStringCollectionColumn); var enum32CollectionColumn = new Column("Enum32Collection", "TEXT", manyTypesTable); manyTypesTable.Columns.Add("Enum32Collection", enum32CollectionColumn); + var enum32NestedCollectionColumn = new Column("Enum32NestedCollection", "TEXT", manyTypesTable); + manyTypesTable.Columns.Add("Enum32NestedCollection", enum32NestedCollectionColumn); var enum64Column = new Column("Enum64", "INTEGER", manyTypesTable); manyTypesTable.Columns.Add("Enum64", enum64Column); var enum64ArrayColumn = new Column("Enum64Array", "TEXT", manyTypesTable); @@ -1186,6 +1260,8 @@ private IRelationalModel CreateRelationalModel() manyTypesTable.Columns.Add("Enum8AsStringCollection", enum8AsStringCollectionColumn); var enum8CollectionColumn = new Column("Enum8Collection", "TEXT", manyTypesTable); manyTypesTable.Columns.Add("Enum8Collection", enum8CollectionColumn); + var enum8NestedCollectionColumn = new Column("Enum8NestedCollection", "TEXT", manyTypesTable); + manyTypesTable.Columns.Add("Enum8NestedCollection", enum8NestedCollectionColumn); var enumToNumberConverterPropertyColumn = new Column("EnumToNumberConverterProperty", "INTEGER", manyTypesTable); manyTypesTable.Columns.Add("EnumToNumberConverterProperty", enumToNumberConverterPropertyColumn); var enumToStringConverterPropertyColumn = new Column("EnumToStringConverterProperty", "TEXT", manyTypesTable); @@ -1226,6 +1302,8 @@ private IRelationalModel CreateRelationalModel() manyTypesTable.Columns.Add("EnumU64AsStringCollection", enumU64AsStringCollectionColumn); var enumU64CollectionColumn = new Column("EnumU64Collection", "TEXT", manyTypesTable); manyTypesTable.Columns.Add("EnumU64Collection", enumU64CollectionColumn); + var enumU64NestedCollectionColumn = new Column("EnumU64NestedCollection", "TEXT", manyTypesTable); + manyTypesTable.Columns.Add("EnumU64NestedCollection", enumU64NestedCollectionColumn); var enumU8Column = new Column("EnumU8", "INTEGER", manyTypesTable); manyTypesTable.Columns.Add("EnumU8", enumU8Column); var enumU8ArrayColumn = new Column("EnumU8Array", "TEXT", manyTypesTable); @@ -1246,6 +1324,8 @@ private IRelationalModel CreateRelationalModel() manyTypesTable.Columns.Add("Guid", guidColumn); var guidArrayColumn = new Column("GuidArray", "TEXT", manyTypesTable); manyTypesTable.Columns.Add("GuidArray", guidArrayColumn); + var guidNestedCollectionColumn = new Column("GuidNestedCollection", "TEXT", manyTypesTable); + manyTypesTable.Columns.Add("GuidNestedCollection", guidNestedCollectionColumn); var guidToBytesConverterPropertyColumn = new Column("GuidToBytesConverterProperty", "BLOB", manyTypesTable); manyTypesTable.Columns.Add("GuidToBytesConverterProperty", guidToBytesConverterPropertyColumn); var guidToStringConverterPropertyColumn = new Column("GuidToStringConverterProperty", "TEXT", manyTypesTable); @@ -1266,14 +1346,20 @@ private IRelationalModel CreateRelationalModel() manyTypesTable.Columns.Add("Int32", int32Column); var int32ArrayColumn = new Column("Int32Array", "TEXT", manyTypesTable); manyTypesTable.Columns.Add("Int32Array", int32ArrayColumn); + var int32NestedCollectionColumn = new Column("Int32NestedCollection", "TEXT", manyTypesTable); + manyTypesTable.Columns.Add("Int32NestedCollection", int32NestedCollectionColumn); var int64Column = new Column("Int64", "INTEGER", manyTypesTable); manyTypesTable.Columns.Add("Int64", int64Column); var int64ArrayColumn = new Column("Int64Array", "TEXT", manyTypesTable); manyTypesTable.Columns.Add("Int64Array", int64ArrayColumn); + var int64NestedCollectionColumn = new Column("Int64NestedCollection", "TEXT", manyTypesTable); + manyTypesTable.Columns.Add("Int64NestedCollection", int64NestedCollectionColumn); var int8Column = new Column("Int8", "INTEGER", manyTypesTable); manyTypesTable.Columns.Add("Int8", int8Column); var int8ArrayColumn = new Column("Int8Array", "TEXT", manyTypesTable); manyTypesTable.Columns.Add("Int8Array", int8ArrayColumn); + var int8NestedCollectionColumn = new Column("Int8NestedCollection", "TEXT", manyTypesTable); + manyTypesTable.Columns.Add("Int8NestedCollection", int8NestedCollectionColumn); var intNumberToBytesConverterPropertyColumn = new Column("IntNumberToBytesConverterProperty", "BLOB", manyTypesTable); manyTypesTable.Columns.Add("IntNumberToBytesConverterProperty", intNumberToBytesConverterPropertyColumn); var intNumberToStringConverterPropertyColumn = new Column("IntNumberToStringConverterProperty", "TEXT", manyTypesTable); @@ -1297,6 +1383,8 @@ private IRelationalModel CreateRelationalModel() manyTypesTable.Columns.Add("NullableBytes", nullableBytesColumn); var nullableBytesArrayColumn = new Column("NullableBytesArray", "TEXT", manyTypesTable); manyTypesTable.Columns.Add("NullableBytesArray", nullableBytesArrayColumn); + var nullableBytesNestedCollectionColumn = new Column("NullableBytesNestedCollection", "TEXT", manyTypesTable); + manyTypesTable.Columns.Add("NullableBytesNestedCollection", nullableBytesNestedCollectionColumn); var nullableCharColumn = new Column("NullableChar", "TEXT", manyTypesTable) { IsNullable = true @@ -1368,6 +1456,8 @@ private IRelationalModel CreateRelationalModel() manyTypesTable.Columns.Add("NullableEnum32AsStringCollection", nullableEnum32AsStringCollectionColumn); var nullableEnum32CollectionColumn = new Column("NullableEnum32Collection", "TEXT", manyTypesTable); manyTypesTable.Columns.Add("NullableEnum32Collection", nullableEnum32CollectionColumn); + var nullableEnum32NestedCollectionColumn = new Column("NullableEnum32NestedCollection", "TEXT", manyTypesTable); + manyTypesTable.Columns.Add("NullableEnum32NestedCollection", nullableEnum32NestedCollectionColumn); var nullableEnum64Column = new Column("NullableEnum64", "INTEGER", manyTypesTable) { IsNullable = true @@ -1404,6 +1494,8 @@ private IRelationalModel CreateRelationalModel() manyTypesTable.Columns.Add("NullableEnum8AsStringCollection", nullableEnum8AsStringCollectionColumn); var nullableEnum8CollectionColumn = new Column("NullableEnum8Collection", "TEXT", manyTypesTable); manyTypesTable.Columns.Add("NullableEnum8Collection", nullableEnum8CollectionColumn); + var nullableEnum8NestedCollectionColumn = new Column("NullableEnum8NestedCollection", "TEXT", manyTypesTable); + manyTypesTable.Columns.Add("NullableEnum8NestedCollection", nullableEnum8NestedCollectionColumn); var nullableEnumU16Column = new Column("NullableEnumU16", "INTEGER", manyTypesTable) { IsNullable = true @@ -1458,6 +1550,8 @@ private IRelationalModel CreateRelationalModel() manyTypesTable.Columns.Add("NullableEnumU64AsStringCollection", nullableEnumU64AsStringCollectionColumn); var nullableEnumU64CollectionColumn = new Column("NullableEnumU64Collection", "TEXT", manyTypesTable); manyTypesTable.Columns.Add("NullableEnumU64Collection", nullableEnumU64CollectionColumn); + var nullableEnumU64NestedCollectionColumn = new Column("NullableEnumU64NestedCollection", "TEXT", manyTypesTable); + manyTypesTable.Columns.Add("NullableEnumU64NestedCollection", nullableEnumU64NestedCollectionColumn); var nullableEnumU8Column = new Column("NullableEnumU8", "INTEGER", manyTypesTable) { IsNullable = true @@ -1490,6 +1584,8 @@ private IRelationalModel CreateRelationalModel() manyTypesTable.Columns.Add("NullableGuid", nullableGuidColumn); var nullableGuidArrayColumn = new Column("NullableGuidArray", "TEXT", manyTypesTable); manyTypesTable.Columns.Add("NullableGuidArray", nullableGuidArrayColumn); + var nullableGuidNestedCollectionColumn = new Column("NullableGuidNestedCollection", "TEXT", manyTypesTable); + manyTypesTable.Columns.Add("NullableGuidNestedCollection", nullableGuidNestedCollectionColumn); var nullableIPAddressColumn = new Column("NullableIPAddress", "TEXT", manyTypesTable) { IsNullable = true @@ -1511,6 +1607,8 @@ private IRelationalModel CreateRelationalModel() manyTypesTable.Columns.Add("NullableInt32", nullableInt32Column); var nullableInt32ArrayColumn = new Column("NullableInt32Array", "TEXT", manyTypesTable); manyTypesTable.Columns.Add("NullableInt32Array", nullableInt32ArrayColumn); + var nullableInt32NestedCollectionColumn = new Column("NullableInt32NestedCollection", "TEXT", manyTypesTable); + manyTypesTable.Columns.Add("NullableInt32NestedCollection", nullableInt32NestedCollectionColumn); var nullableInt64Column = new Column("NullableInt64", "INTEGER", manyTypesTable) { IsNullable = true @@ -1518,6 +1616,8 @@ private IRelationalModel CreateRelationalModel() manyTypesTable.Columns.Add("NullableInt64", nullableInt64Column); var nullableInt64ArrayColumn = new Column("NullableInt64Array", "TEXT", manyTypesTable); manyTypesTable.Columns.Add("NullableInt64Array", nullableInt64ArrayColumn); + var nullableInt64NestedCollectionColumn = new Column("NullableInt64NestedCollection", "TEXT", manyTypesTable); + manyTypesTable.Columns.Add("NullableInt64NestedCollection", nullableInt64NestedCollectionColumn); var nullableInt8Column = new Column("NullableInt8", "INTEGER", manyTypesTable) { IsNullable = true @@ -1532,6 +1632,8 @@ private IRelationalModel CreateRelationalModel() manyTypesTable.Columns.Add("NullablePhysicalAddress", nullablePhysicalAddressColumn); var nullablePhysicalAddressArrayColumn = new Column("NullablePhysicalAddressArray", "TEXT", manyTypesTable); manyTypesTable.Columns.Add("NullablePhysicalAddressArray", nullablePhysicalAddressArrayColumn); + var nullablePhysicalAddressNestedCollectionColumn = new Column("NullablePhysicalAddressNestedCollection", "TEXT", manyTypesTable); + manyTypesTable.Columns.Add("NullablePhysicalAddressNestedCollection", nullablePhysicalAddressNestedCollectionColumn); var nullableStringColumn = new Column("NullableString", "TEXT", manyTypesTable) { IsNullable = true @@ -1539,6 +1641,8 @@ private IRelationalModel CreateRelationalModel() manyTypesTable.Columns.Add("NullableString", nullableStringColumn); var nullableStringArrayColumn = new Column("NullableStringArray", "TEXT", manyTypesTable); manyTypesTable.Columns.Add("NullableStringArray", nullableStringArrayColumn); + var nullableStringNestedCollectionColumn = new Column("NullableStringNestedCollection", "TEXT", manyTypesTable); + manyTypesTable.Columns.Add("NullableStringNestedCollection", nullableStringNestedCollectionColumn); var nullableTimeOnlyColumn = new Column("NullableTimeOnly", "TEXT", manyTypesTable) { IsNullable = true @@ -1581,6 +1685,8 @@ private IRelationalModel CreateRelationalModel() manyTypesTable.Columns.Add("NullableUInt8", nullableUInt8Column); var nullableUInt8ArrayColumn = new Column("NullableUInt8Array", "TEXT", manyTypesTable); manyTypesTable.Columns.Add("NullableUInt8Array", nullableUInt8ArrayColumn); + var nullableUInt8NestedCollectionColumn = new Column("NullableUInt8NestedCollection", "TEXT", manyTypesTable); + manyTypesTable.Columns.Add("NullableUInt8NestedCollection", nullableUInt8NestedCollectionColumn); var nullableUriColumn = new Column("NullableUri", "TEXT", manyTypesTable) { IsNullable = true @@ -1600,6 +1706,8 @@ private IRelationalModel CreateRelationalModel() manyTypesTable.Columns.Add("String", stringColumn); var stringArrayColumn = new Column("StringArray", "TEXT", manyTypesTable); manyTypesTable.Columns.Add("StringArray", stringArrayColumn); + var stringNestedCollectionColumn = new Column("StringNestedCollection", "TEXT", manyTypesTable); + manyTypesTable.Columns.Add("StringNestedCollection", stringNestedCollectionColumn); var stringToBoolConverterPropertyColumn = new Column("StringToBoolConverterProperty", "INTEGER", manyTypesTable); manyTypesTable.Columns.Add("StringToBoolConverterProperty", stringToBoolConverterPropertyColumn); var stringToBytesConverterPropertyColumn = new Column("StringToBytesConverterProperty", "BLOB", manyTypesTable) @@ -1663,6 +1771,8 @@ private IRelationalModel CreateRelationalModel() manyTypesTable.Columns.Add("UInt8", uInt8Column); var uInt8ArrayColumn = new Column("UInt8Array", "BLOB", manyTypesTable); manyTypesTable.Columns.Add("UInt8Array", uInt8ArrayColumn); + var uInt8NestedCollectionColumn = new Column("UInt8NestedCollection", "TEXT", manyTypesTable); + manyTypesTable.Columns.Add("UInt8NestedCollection", uInt8NestedCollectionColumn); var uriColumn = new Column("Uri", "TEXT", manyTypesTable); manyTypesTable.Columns.Add("Uri", uriColumn); var uriArrayColumn = new Column("UriArray", "TEXT", manyTypesTable); @@ -1684,15 +1794,18 @@ private IRelationalModel CreateRelationalModel() RelationalModel.CreateColumnMapping(idColumn1, manyTypes.FindProperty("Id")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(boolColumn, manyTypes.FindProperty("Bool")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(boolArrayColumn, manyTypes.FindProperty("BoolArray")!, manyTypesTableMapping); + RelationalModel.CreateColumnMapping(boolNestedCollectionColumn, manyTypes.FindProperty("BoolNestedCollection")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(boolToStringConverterPropertyColumn, manyTypes.FindProperty("BoolToStringConverterProperty")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(boolToTwoValuesConverterPropertyColumn, manyTypes.FindProperty("BoolToTwoValuesConverterProperty")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(boolToZeroOneConverterPropertyColumn, manyTypes.FindProperty("BoolToZeroOneConverterProperty")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(bytesColumn, manyTypes.FindProperty("Bytes")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(bytesArrayColumn, manyTypes.FindProperty("BytesArray")!, manyTypesTableMapping); + RelationalModel.CreateColumnMapping(bytesNestedCollectionColumn, manyTypes.FindProperty("BytesNestedCollection")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(bytesToStringConverterPropertyColumn, manyTypes.FindProperty("BytesToStringConverterProperty")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(castingConverterPropertyColumn, manyTypes.FindProperty("CastingConverterProperty")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(charColumn, manyTypes.FindProperty("Char")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(charArrayColumn, manyTypes.FindProperty("CharArray")!, manyTypesTableMapping); + RelationalModel.CreateColumnMapping(charNestedCollectionColumn, manyTypes.FindProperty("CharNestedCollection")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(charToStringConverterPropertyColumn, manyTypes.FindProperty("CharToStringConverterProperty")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(dateOnlyColumn, manyTypes.FindProperty("DateOnly")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(dateOnlyArrayColumn, manyTypes.FindProperty("DateOnlyArray")!, manyTypesTableMapping); @@ -1725,6 +1838,7 @@ private IRelationalModel CreateRelationalModel() RelationalModel.CreateColumnMapping(enum32AsStringArrayColumn, manyTypes.FindProperty("Enum32AsStringArray")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(enum32AsStringCollectionColumn, manyTypes.FindProperty("Enum32AsStringCollection")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(enum32CollectionColumn, manyTypes.FindProperty("Enum32Collection")!, manyTypesTableMapping); + RelationalModel.CreateColumnMapping(enum32NestedCollectionColumn, manyTypes.FindProperty("Enum32NestedCollection")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(enum64Column, manyTypes.FindProperty("Enum64")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(enum64ArrayColumn, manyTypes.FindProperty("Enum64Array")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(enum64AsStringColumn, manyTypes.FindProperty("Enum64AsString")!, manyTypesTableMapping); @@ -1737,6 +1851,7 @@ private IRelationalModel CreateRelationalModel() RelationalModel.CreateColumnMapping(enum8AsStringArrayColumn, manyTypes.FindProperty("Enum8AsStringArray")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(enum8AsStringCollectionColumn, manyTypes.FindProperty("Enum8AsStringCollection")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(enum8CollectionColumn, manyTypes.FindProperty("Enum8Collection")!, manyTypesTableMapping); + RelationalModel.CreateColumnMapping(enum8NestedCollectionColumn, manyTypes.FindProperty("Enum8NestedCollection")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(enumToNumberConverterPropertyColumn, manyTypes.FindProperty("EnumToNumberConverterProperty")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(enumToStringConverterPropertyColumn, manyTypes.FindProperty("EnumToStringConverterProperty")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(enumU16Column, manyTypes.FindProperty("EnumU16")!, manyTypesTableMapping); @@ -1757,6 +1872,7 @@ private IRelationalModel CreateRelationalModel() RelationalModel.CreateColumnMapping(enumU64AsStringArrayColumn, manyTypes.FindProperty("EnumU64AsStringArray")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(enumU64AsStringCollectionColumn, manyTypes.FindProperty("EnumU64AsStringCollection")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(enumU64CollectionColumn, manyTypes.FindProperty("EnumU64Collection")!, manyTypesTableMapping); + RelationalModel.CreateColumnMapping(enumU64NestedCollectionColumn, manyTypes.FindProperty("EnumU64NestedCollection")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(enumU8Column, manyTypes.FindProperty("EnumU8")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(enumU8ArrayColumn, manyTypes.FindProperty("EnumU8Array")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(enumU8AsStringColumn, manyTypes.FindProperty("EnumU8AsString")!, manyTypesTableMapping); @@ -1767,6 +1883,7 @@ private IRelationalModel CreateRelationalModel() RelationalModel.CreateColumnMapping(floatArrayColumn, manyTypes.FindProperty("FloatArray")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(guidColumn, manyTypes.FindProperty("Guid")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(guidArrayColumn, manyTypes.FindProperty("GuidArray")!, manyTypesTableMapping); + RelationalModel.CreateColumnMapping(guidNestedCollectionColumn, manyTypes.FindProperty("GuidNestedCollection")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(guidToBytesConverterPropertyColumn, manyTypes.FindProperty("GuidToBytesConverterProperty")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(guidToStringConverterPropertyColumn, manyTypes.FindProperty("GuidToStringConverterProperty")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(iPAddressColumn, manyTypes.FindProperty("IPAddress")!, manyTypesTableMapping); @@ -1777,10 +1894,13 @@ private IRelationalModel CreateRelationalModel() RelationalModel.CreateColumnMapping(int16ArrayColumn, manyTypes.FindProperty("Int16Array")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(int32Column, manyTypes.FindProperty("Int32")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(int32ArrayColumn, manyTypes.FindProperty("Int32Array")!, manyTypesTableMapping); + RelationalModel.CreateColumnMapping(int32NestedCollectionColumn, manyTypes.FindProperty("Int32NestedCollection")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(int64Column, manyTypes.FindProperty("Int64")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(int64ArrayColumn, manyTypes.FindProperty("Int64Array")!, manyTypesTableMapping); + RelationalModel.CreateColumnMapping(int64NestedCollectionColumn, manyTypes.FindProperty("Int64NestedCollection")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(int8Column, manyTypes.FindProperty("Int8")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(int8ArrayColumn, manyTypes.FindProperty("Int8Array")!, manyTypesTableMapping); + RelationalModel.CreateColumnMapping(int8NestedCollectionColumn, manyTypes.FindProperty("Int8NestedCollection")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(intNumberToBytesConverterPropertyColumn, manyTypes.FindProperty("IntNumberToBytesConverterProperty")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(intNumberToStringConverterPropertyColumn, manyTypes.FindProperty("IntNumberToStringConverterProperty")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullIntToNullStringConverterPropertyColumn, manyTypes.FindProperty("NullIntToNullStringConverterProperty")!, manyTypesTableMapping); @@ -1788,6 +1908,7 @@ private IRelationalModel CreateRelationalModel() RelationalModel.CreateColumnMapping(nullableBoolArrayColumn, manyTypes.FindProperty("NullableBoolArray")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullableBytesColumn, manyTypes.FindProperty("NullableBytes")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullableBytesArrayColumn, manyTypes.FindProperty("NullableBytesArray")!, manyTypesTableMapping); + RelationalModel.CreateColumnMapping(nullableBytesNestedCollectionColumn, manyTypes.FindProperty("NullableBytesNestedCollection")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullableCharColumn, manyTypes.FindProperty("NullableChar")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullableCharArrayColumn, manyTypes.FindProperty("NullableCharArray")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullableDateOnlyColumn, manyTypes.FindProperty("NullableDateOnly")!, manyTypesTableMapping); @@ -1810,6 +1931,7 @@ private IRelationalModel CreateRelationalModel() RelationalModel.CreateColumnMapping(nullableEnum32AsStringArrayColumn, manyTypes.FindProperty("NullableEnum32AsStringArray")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullableEnum32AsStringCollectionColumn, manyTypes.FindProperty("NullableEnum32AsStringCollection")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullableEnum32CollectionColumn, manyTypes.FindProperty("NullableEnum32Collection")!, manyTypesTableMapping); + RelationalModel.CreateColumnMapping(nullableEnum32NestedCollectionColumn, manyTypes.FindProperty("NullableEnum32NestedCollection")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullableEnum64Column, manyTypes.FindProperty("NullableEnum64")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullableEnum64ArrayColumn, manyTypes.FindProperty("NullableEnum64Array")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullableEnum64AsStringColumn, manyTypes.FindProperty("NullableEnum64AsString")!, manyTypesTableMapping); @@ -1822,6 +1944,7 @@ private IRelationalModel CreateRelationalModel() RelationalModel.CreateColumnMapping(nullableEnum8AsStringArrayColumn, manyTypes.FindProperty("NullableEnum8AsStringArray")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullableEnum8AsStringCollectionColumn, manyTypes.FindProperty("NullableEnum8AsStringCollection")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullableEnum8CollectionColumn, manyTypes.FindProperty("NullableEnum8Collection")!, manyTypesTableMapping); + RelationalModel.CreateColumnMapping(nullableEnum8NestedCollectionColumn, manyTypes.FindProperty("NullableEnum8NestedCollection")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullableEnumU16Column, manyTypes.FindProperty("NullableEnumU16")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullableEnumU16ArrayColumn, manyTypes.FindProperty("NullableEnumU16Array")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullableEnumU16AsStringColumn, manyTypes.FindProperty("NullableEnumU16AsString")!, manyTypesTableMapping); @@ -1840,6 +1963,7 @@ private IRelationalModel CreateRelationalModel() RelationalModel.CreateColumnMapping(nullableEnumU64AsStringArrayColumn, manyTypes.FindProperty("NullableEnumU64AsStringArray")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullableEnumU64AsStringCollectionColumn, manyTypes.FindProperty("NullableEnumU64AsStringCollection")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullableEnumU64CollectionColumn, manyTypes.FindProperty("NullableEnumU64Collection")!, manyTypesTableMapping); + RelationalModel.CreateColumnMapping(nullableEnumU64NestedCollectionColumn, manyTypes.FindProperty("NullableEnumU64NestedCollection")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullableEnumU8Column, manyTypes.FindProperty("NullableEnumU8")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullableEnumU8ArrayColumn, manyTypes.FindProperty("NullableEnumU8Array")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullableEnumU8AsStringColumn, manyTypes.FindProperty("NullableEnumU8AsString")!, manyTypesTableMapping); @@ -1850,20 +1974,25 @@ private IRelationalModel CreateRelationalModel() RelationalModel.CreateColumnMapping(nullableFloatArrayColumn, manyTypes.FindProperty("NullableFloatArray")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullableGuidColumn, manyTypes.FindProperty("NullableGuid")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullableGuidArrayColumn, manyTypes.FindProperty("NullableGuidArray")!, manyTypesTableMapping); + RelationalModel.CreateColumnMapping(nullableGuidNestedCollectionColumn, manyTypes.FindProperty("NullableGuidNestedCollection")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullableIPAddressColumn, manyTypes.FindProperty("NullableIPAddress")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullableIPAddressArrayColumn, manyTypes.FindProperty("NullableIPAddressArray")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullableInt16Column, manyTypes.FindProperty("NullableInt16")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullableInt16ArrayColumn, manyTypes.FindProperty("NullableInt16Array")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullableInt32Column, manyTypes.FindProperty("NullableInt32")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullableInt32ArrayColumn, manyTypes.FindProperty("NullableInt32Array")!, manyTypesTableMapping); + RelationalModel.CreateColumnMapping(nullableInt32NestedCollectionColumn, manyTypes.FindProperty("NullableInt32NestedCollection")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullableInt64Column, manyTypes.FindProperty("NullableInt64")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullableInt64ArrayColumn, manyTypes.FindProperty("NullableInt64Array")!, manyTypesTableMapping); + RelationalModel.CreateColumnMapping(nullableInt64NestedCollectionColumn, manyTypes.FindProperty("NullableInt64NestedCollection")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullableInt8Column, manyTypes.FindProperty("NullableInt8")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullableInt8ArrayColumn, manyTypes.FindProperty("NullableInt8Array")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullablePhysicalAddressColumn, manyTypes.FindProperty("NullablePhysicalAddress")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullablePhysicalAddressArrayColumn, manyTypes.FindProperty("NullablePhysicalAddressArray")!, manyTypesTableMapping); + RelationalModel.CreateColumnMapping(nullablePhysicalAddressNestedCollectionColumn, manyTypes.FindProperty("NullablePhysicalAddressNestedCollection")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullableStringColumn, manyTypes.FindProperty("NullableString")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullableStringArrayColumn, manyTypes.FindProperty("NullableStringArray")!, manyTypesTableMapping); + RelationalModel.CreateColumnMapping(nullableStringNestedCollectionColumn, manyTypes.FindProperty("NullableStringNestedCollection")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullableTimeOnlyColumn, manyTypes.FindProperty("NullableTimeOnly")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullableTimeOnlyArrayColumn, manyTypes.FindProperty("NullableTimeOnlyArray")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullableTimeSpanColumn, manyTypes.FindProperty("NullableTimeSpan")!, manyTypesTableMapping); @@ -1876,6 +2005,7 @@ private IRelationalModel CreateRelationalModel() RelationalModel.CreateColumnMapping(nullableUInt64ArrayColumn, manyTypes.FindProperty("NullableUInt64Array")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullableUInt8Column, manyTypes.FindProperty("NullableUInt8")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullableUInt8ArrayColumn, manyTypes.FindProperty("NullableUInt8Array")!, manyTypesTableMapping); + RelationalModel.CreateColumnMapping(nullableUInt8NestedCollectionColumn, manyTypes.FindProperty("NullableUInt8NestedCollection")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullableUriColumn, manyTypes.FindProperty("NullableUri")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(nullableUriArrayColumn, manyTypes.FindProperty("NullableUriArray")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(physicalAddressColumn, manyTypes.FindProperty("PhysicalAddress")!, manyTypesTableMapping); @@ -1884,6 +2014,7 @@ private IRelationalModel CreateRelationalModel() RelationalModel.CreateColumnMapping(physicalAddressToStringConverterPropertyColumn, manyTypes.FindProperty("PhysicalAddressToStringConverterProperty")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(stringColumn, manyTypes.FindProperty("String")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(stringArrayColumn, manyTypes.FindProperty("StringArray")!, manyTypesTableMapping); + RelationalModel.CreateColumnMapping(stringNestedCollectionColumn, manyTypes.FindProperty("StringNestedCollection")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(stringToBoolConverterPropertyColumn, manyTypes.FindProperty("StringToBoolConverterProperty")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(stringToBytesConverterPropertyColumn, manyTypes.FindProperty("StringToBytesConverterProperty")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(stringToCharConverterPropertyColumn, manyTypes.FindProperty("StringToCharConverterProperty")!, manyTypesTableMapping); @@ -1914,6 +2045,7 @@ private IRelationalModel CreateRelationalModel() RelationalModel.CreateColumnMapping(uInt64ArrayColumn, manyTypes.FindProperty("UInt64Array")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(uInt8Column, manyTypes.FindProperty("UInt8")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(uInt8ArrayColumn, manyTypes.FindProperty("UInt8Array")!, manyTypesTableMapping); + RelationalModel.CreateColumnMapping(uInt8NestedCollectionColumn, manyTypes.FindProperty("UInt8NestedCollection")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(uriColumn, manyTypes.FindProperty("Uri")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(uriArrayColumn, manyTypes.FindProperty("UriArray")!, manyTypesTableMapping); RelationalModel.CreateColumnMapping(uriToStringConverterPropertyColumn, manyTypes.FindProperty("UriToStringConverterProperty")!, manyTypesTableMapping); diff --git a/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/BigModel_with_JSON_columns/DependentBaseEntityType.cs b/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/BigModel_with_JSON_columns/DependentBaseEntityType.cs index 18c333b6e91..7074b0d0b2f 100644 --- a/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/BigModel_with_JSON_columns/DependentBaseEntityType.cs +++ b/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/BigModel_with_JSON_columns/DependentBaseEntityType.cs @@ -53,15 +53,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas principalId.TypeMapping = LongTypeMapping.Default.Clone( comparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), keyComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "INTEGER")); @@ -95,11 +95,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumDiscriminator.TypeMapping = IntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum1 v1, CompiledModelTestBase.Enum1 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum1 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum1 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum1 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum1 v1, CompiledModelTestBase.Enum1 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum1 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum1 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum1 v) => v), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -265,10 +265,10 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (CompiledModelTestBase.DependentBase>)source.Entity; - return (ISnapshot)new Snapshot>(((ValueComparer)principalId.GetValueComparer()).Snapshot(source.GetCurrentValue(principalId)), ((ValueComparer)principalAlternateId.GetValueComparer()).Snapshot(source.GetCurrentValue(principalAlternateId)), ((ValueComparer)enumDiscriminator.GetValueComparer()).Snapshot(source.GetCurrentValue(enumDiscriminator)), source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)id.GetValueComparer()).Snapshot(source.GetCurrentValue>(id))); + return (ISnapshot)new Snapshot>(((ValueComparer)((IProperty)principalId).GetValueComparer()).Snapshot(source.GetCurrentValue(principalId)), ((ValueComparer)((IProperty)principalAlternateId).GetValueComparer()).Snapshot(source.GetCurrentValue(principalAlternateId)), ((ValueComparer)((IProperty)enumDiscriminator).GetValueComparer()).Snapshot(source.GetCurrentValue(enumDiscriminator)), source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)((IProperty)id).GetValueComparer()).Snapshot(source.GetCurrentValue>(id))); }); runtimeEntityType.SetStoreGeneratedValuesFactory( - () => (ISnapshot)new Snapshot(((ValueComparer)principalId.GetValueComparer()).Snapshot(default(long)), ((ValueComparer)principalAlternateId.GetValueComparer()).Snapshot(default(Guid)))); + () => (ISnapshot)new Snapshot(((ValueComparer)((IProperty)principalId).GetValueComparer()).Snapshot(default(long)), ((ValueComparer)((IProperty)principalAlternateId).GetValueComparer()).Snapshot(default(Guid)))); runtimeEntityType.SetTemporaryValuesFactory( (InternalEntityEntry source) => (ISnapshot)new Snapshot(default(long), default(Guid))); runtimeEntityType.SetShadowValuesFactory( @@ -279,7 +279,7 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (CompiledModelTestBase.DependentBase>)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)principalId.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalId)), ((ValueComparer)principalAlternateId.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalAlternateId)), UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_DependentBase1_Principal(entity)); + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)principalId).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalId)), ((ValueComparer)((IProperty)principalAlternateId).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalAlternateId)), UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_DependentBase1_Principal(entity)); }); runtimeEntityType.Counts = new PropertyCounts( propertyCount: 4, diff --git a/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/BigModel_with_JSON_columns/DependentDerivedEntityType.cs b/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/BigModel_with_JSON_columns/DependentDerivedEntityType.cs index bdcc8f7335a..024698d8e4a 100644 --- a/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/BigModel_with_JSON_columns/DependentDerivedEntityType.cs +++ b/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/BigModel_with_JSON_columns/DependentDerivedEntityType.cs @@ -92,11 +92,11 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) runtimeEntityType.SetOriginalValuesFactory( (InternalEntityEntry source) => { - var entity = (CompiledModelTestBase.DependentDerived>)source.Entity; - return (ISnapshot)new Snapshot, string, decimal>(((ValueComparer)principalId.GetValueComparer()).Snapshot(source.GetCurrentValue(principalId)), ((ValueComparer)principalAlternateId.GetValueComparer()).Snapshot(source.GetCurrentValue(principalAlternateId)), ((ValueComparer)enumDiscriminator.GetValueComparer()).Snapshot(source.GetCurrentValue(enumDiscriminator)), source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)id.GetValueComparer()).Snapshot(source.GetCurrentValue>(id)), source.GetCurrentValue(data) == null ? null : ((ValueComparer)data.GetValueComparer()).Snapshot(source.GetCurrentValue(data)), ((ValueComparer)money.GetValueComparer()).Snapshot(source.GetCurrentValue(money))); + var entity8 = (CompiledModelTestBase.DependentDerived>)source.Entity; + return (ISnapshot)new Snapshot, string, decimal>(((ValueComparer)((IProperty)principalId).GetValueComparer()).Snapshot(source.GetCurrentValue(principalId)), ((ValueComparer)((IProperty)principalAlternateId).GetValueComparer()).Snapshot(source.GetCurrentValue(principalAlternateId)), ((ValueComparer)((IProperty)enumDiscriminator).GetValueComparer()).Snapshot(source.GetCurrentValue(enumDiscriminator)), source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)((IProperty)id).GetValueComparer()).Snapshot(source.GetCurrentValue>(id)), source.GetCurrentValue(data) == null ? null : ((ValueComparer)((IProperty)data).GetValueComparer()).Snapshot(source.GetCurrentValue(data)), ((ValueComparer)((IProperty)money).GetValueComparer()).Snapshot(source.GetCurrentValue(money))); }); runtimeEntityType.SetStoreGeneratedValuesFactory( - () => (ISnapshot)new Snapshot(((ValueComparer)principalId.GetValueComparer()).Snapshot(default(long)), ((ValueComparer)principalAlternateId.GetValueComparer()).Snapshot(default(Guid)))); + () => (ISnapshot)new Snapshot(((ValueComparer)((IProperty)principalId).GetValueComparer()).Snapshot(default(long)), ((ValueComparer)((IProperty)principalAlternateId).GetValueComparer()).Snapshot(default(Guid)))); runtimeEntityType.SetTemporaryValuesFactory( (InternalEntityEntry source) => (ISnapshot)new Snapshot(default(long), default(Guid))); runtimeEntityType.SetShadowValuesFactory( @@ -106,8 +106,8 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) runtimeEntityType.SetRelationshipSnapshotFactory( (InternalEntityEntry source) => { - var entity = (CompiledModelTestBase.DependentDerived>)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)principalId.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalId)), ((ValueComparer)principalAlternateId.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalAlternateId)), DependentBaseEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_DependentBase1_Principal(entity)); + var entity8 = (CompiledModelTestBase.DependentDerived>)source.Entity; + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)principalId).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalId)), ((ValueComparer)((IProperty)principalAlternateId).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalAlternateId)), DependentBaseEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_DependentBase1_Principal(entity8)); }); runtimeEntityType.Counts = new PropertyCounts( propertyCount: 6, 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 cf357d74fd2..7e73cae1ba1 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 @@ -36,7 +36,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas "Microsoft.EntityFrameworkCore.Scaffolding.CompiledModelTestBase+ManyTypes", typeof(CompiledModelTestBase.ManyTypes), baseEntityType, - propertyCount: 236, + propertyCount: 258, keyCount: 1); var id = runtimeEntityType.AddProperty( @@ -71,11 +71,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas id.TypeMapping = IntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.ManyTypesId v1, CompiledModelTestBase.ManyTypesId v2) => v1.Equals(v2), - (CompiledModelTestBase.ManyTypesId v) => v.GetHashCode(), + (CompiledModelTestBase.ManyTypesId v) => ((object)v).GetHashCode(), (CompiledModelTestBase.ManyTypesId v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.ManyTypesId v1, CompiledModelTestBase.ManyTypesId v2) => v1.Equals(v2), - (CompiledModelTestBase.ManyTypesId v) => v.GetHashCode(), + (CompiledModelTestBase.ManyTypesId v) => ((object)v).GetHashCode(), (CompiledModelTestBase.ManyTypesId v) => v), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -125,15 +125,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas @bool.TypeMapping = BoolTypeMapping.Default.Clone( comparer: new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v), keyComparer: new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v), providerValueComparer: new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "INTEGER")); @@ -166,39 +166,118 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas relationshipIndex: -1, storeGenerationIndex: -1); boolArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer(new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer(new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( JsonBoolReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( JsonBoolReaderWriter.Instance), elementMapping: BoolTypeMapping.Default.Clone( comparer: new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v), keyComparer: new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v), providerValueComparer: new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "INTEGER"))); boolArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BoolArray", "TestNamespace") }); + var boolNestedCollection = runtimeEntityType.AddProperty( + "BoolNestedCollection", + typeof(bool[][]), + propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("BoolNestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + boolNestedCollection.SetGetter( + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BoolNestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BoolNestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BoolNestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BoolNestedCollection(instance) == null); + boolNestedCollection.SetSetter( + (CompiledModelTestBase.ManyTypes entity, bool[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BoolNestedCollection(entity) = value); + boolNestedCollection.SetMaterializationSetter( + (CompiledModelTestBase.ManyTypes entity, bool[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BoolNestedCollection(entity) = value); + boolNestedCollection.SetAccessors( + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BoolNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BoolNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => entry.ReadOriginalValue(boolNestedCollection, 3), + (InternalEntityEntry entry) => entry.GetCurrentValue(boolNestedCollection), + (ValueBuffer valueBuffer) => valueBuffer[3]); + boolNestedCollection.SetPropertyIndexes( + index: 3, + originalValueIndex: 3, + shadowIndex: -1, + relationshipIndex: -1, + storeGenerationIndex: -1); + boolNestedCollection.TypeMapping = SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfReferenceTypesComparer(new ListOfValueTypesComparer(new ValueComparer( + (bool v1, bool v2) => v1 == v2, + (bool v) => ((object)v).GetHashCode(), + (bool v) => v))), + keyComparer: new ListOfReferenceTypesComparer(new ListOfValueTypesComparer(new ValueComparer( + (bool v1, bool v2) => v1 == v2, + (bool v) => ((object)v).GetHashCode(), + (bool v) => v))), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfStructsReaderWriter( + JsonBoolReaderWriter.Instance))), + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfStructsReaderWriter( + JsonBoolReaderWriter.Instance)), + elementMapping: SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfValueTypesComparer(new ValueComparer( + (bool v1, bool v2) => v1 == v2, + (bool v) => ((object)v).GetHashCode(), + (bool v) => v)), + keyComparer: new ListOfValueTypesComparer(new ValueComparer( + (bool v1, bool v2) => v1 == v2, + (bool v) => ((object)v).GetHashCode(), + (bool v) => v)), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( + JsonBoolReaderWriter.Instance)), + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( + JsonBoolReaderWriter.Instance), + elementMapping: BoolTypeMapping.Default.Clone( + comparer: new ValueComparer( + (bool v1, bool v2) => v1 == v2, + (bool v) => ((object)v).GetHashCode(), + (bool v) => v), + keyComparer: new ValueComparer( + (bool v1, bool v2) => v1 == v2, + (bool v) => ((object)v).GetHashCode(), + (bool v) => v), + providerValueComparer: new ValueComparer( + (bool v1, bool v2) => v1 == v2, + (bool v) => ((object)v).GetHashCode(), + (bool v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "INTEGER")))); + boolNestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BoolNestedCollection", "TestNamespace") }); + var boolToStringConverterProperty = runtimeEntityType.AddProperty( "BoolToStringConverterProperty", typeof(bool), @@ -216,27 +295,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas boolToStringConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BoolToStringConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BoolToStringConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(boolToStringConverterProperty, 3), + (InternalEntityEntry entry) => entry.ReadOriginalValue(boolToStringConverterProperty, 4), (InternalEntityEntry entry) => entry.GetCurrentValue(boolToStringConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[3]); + (ValueBuffer valueBuffer) => valueBuffer[4]); boolToStringConverterProperty.SetPropertyIndexes( - index: 3, - originalValueIndex: 3, + index: 4, + originalValueIndex: 4, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); boolToStringConverterProperty.TypeMapping = SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v), keyComparer: new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( size: 1), @@ -268,23 +347,23 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas boolToTwoValuesConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BoolToTwoValuesConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BoolToTwoValuesConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(boolToTwoValuesConverterProperty, 4), + (InternalEntityEntry entry) => entry.ReadOriginalValue(boolToTwoValuesConverterProperty, 5), (InternalEntityEntry entry) => entry.GetCurrentValue(boolToTwoValuesConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[4]); + (ValueBuffer valueBuffer) => valueBuffer[5]); boolToTwoValuesConverterProperty.SetPropertyIndexes( - index: 4, - originalValueIndex: 4, + index: 5, + originalValueIndex: 5, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); boolToTwoValuesConverterProperty.TypeMapping = ByteTypeMapping.Default.Clone( comparer: new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v), keyComparer: new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v), providerValueComparer: new ValueComparer( (byte v1, byte v2) => v1 == v2, @@ -321,23 +400,23 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas boolToZeroOneConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BoolToZeroOneConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BoolToZeroOneConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(boolToZeroOneConverterProperty, 5), + (InternalEntityEntry entry) => entry.ReadOriginalValue(boolToZeroOneConverterProperty, 6), (InternalEntityEntry entry) => entry.GetCurrentValue(boolToZeroOneConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[5]); + (ValueBuffer valueBuffer) => valueBuffer[6]); boolToZeroOneConverterProperty.SetPropertyIndexes( - index: 5, - originalValueIndex: 5, + index: 6, + originalValueIndex: 6, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); boolToZeroOneConverterProperty.TypeMapping = ShortTypeMapping.Default.Clone( comparer: new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v), keyComparer: new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v), providerValueComparer: new ValueComparer( (short v1, short v2) => v1 == v2, @@ -373,19 +452,19 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas bytes.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Bytes((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Bytes((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(bytes, 6), + (InternalEntityEntry entry) => entry.ReadOriginalValue(bytes, 7), (InternalEntityEntry entry) => entry.GetCurrentValue(bytes), - (ValueBuffer valueBuffer) => valueBuffer[6]); + (ValueBuffer valueBuffer) => valueBuffer[7]); bytes.SetPropertyIndexes( - index: 6, - originalValueIndex: 6, + index: 7, + originalValueIndex: 7, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); bytes.TypeMapping = SqliteByteArrayTypeMapping.Default.Clone( comparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), - (byte[] v) => v.GetHashCode(), + (byte[] v) => ((object)v).GetHashCode(), (byte[] v) => v), keyComparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), @@ -414,36 +493,36 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas bytesArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BytesArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BytesArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(bytesArray, 7), + (InternalEntityEntry entry) => entry.ReadOriginalValue(bytesArray, 8), (InternalEntityEntry entry) => entry.GetCurrentValue(bytesArray), - (ValueBuffer valueBuffer) => valueBuffer[7]); + (ValueBuffer valueBuffer) => valueBuffer[8]); bytesArray.SetPropertyIndexes( - index: 7, - originalValueIndex: 7, + index: 8, + originalValueIndex: 8, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); bytesArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfReferenceTypesComparer(new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), - (byte[] v) => v.GetHashCode(), + (byte[] v) => ((object)v).GetHashCode(), (byte[] v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), - (byte[] v) => v.GetHashCode(), + (byte[] v) => ((object)v).GetHashCode(), (byte[] v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter( SqliteJsonByteArrayReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( SqliteJsonByteArrayReaderWriter.Instance), elementMapping: SqliteByteArrayTypeMapping.Default.Clone( comparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), - (byte[] v) => v.GetHashCode(), + (byte[] v) => ((object)v).GetHashCode(), (byte[] v) => v), keyComparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), @@ -455,6 +534,83 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (byte[] source) => source.ToArray()))); bytesArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BytesArray", "TestNamespace") }); + var bytesNestedCollection = runtimeEntityType.AddProperty( + "BytesNestedCollection", + typeof(byte[][][]), + propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("BytesNestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + bytesNestedCollection.SetGetter( + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BytesNestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BytesNestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BytesNestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BytesNestedCollection(instance) == null); + bytesNestedCollection.SetSetter( + (CompiledModelTestBase.ManyTypes entity, byte[][][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BytesNestedCollection(entity) = value); + bytesNestedCollection.SetMaterializationSetter( + (CompiledModelTestBase.ManyTypes entity, byte[][][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BytesNestedCollection(entity) = value); + bytesNestedCollection.SetAccessors( + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BytesNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BytesNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => entry.ReadOriginalValue(bytesNestedCollection, 9), + (InternalEntityEntry entry) => entry.GetCurrentValue(bytesNestedCollection), + (ValueBuffer valueBuffer) => valueBuffer[9]); + bytesNestedCollection.SetPropertyIndexes( + index: 9, + originalValueIndex: 9, + shadowIndex: -1, + relationshipIndex: -1, + storeGenerationIndex: -1); + bytesNestedCollection.TypeMapping = SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfReferenceTypesComparer(new ListOfReferenceTypesComparer(new ValueComparer( + (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), + (byte[] v) => ((object)v).GetHashCode(), + (byte[] v) => v))), + keyComparer: new ListOfReferenceTypesComparer(new ListOfReferenceTypesComparer(new ValueComparer( + (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), + (byte[] v) => ((object)v).GetHashCode(), + (byte[] v) => v))), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfReferencesReaderWriter( + SqliteJsonByteArrayReaderWriter.Instance))), + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfReferencesReaderWriter( + SqliteJsonByteArrayReaderWriter.Instance)), + elementMapping: SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfReferenceTypesComparer(new ValueComparer( + (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), + (byte[] v) => ((object)v).GetHashCode(), + (byte[] v) => v)), + keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( + (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), + (byte[] v) => ((object)v).GetHashCode(), + (byte[] v) => v)), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter( + SqliteJsonByteArrayReaderWriter.Instance)), + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( + SqliteJsonByteArrayReaderWriter.Instance), + elementMapping: SqliteByteArrayTypeMapping.Default.Clone( + comparer: new ValueComparer( + (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), + (byte[] v) => ((object)v).GetHashCode(), + (byte[] v) => v), + keyComparer: new ValueComparer( + (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), + (byte[] v) => StructuralComparisons.StructuralEqualityComparer.GetHashCode((object)v), + (byte[] source) => source.ToArray()), + providerValueComparer: new ValueComparer( + (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), + (byte[] v) => StructuralComparisons.StructuralEqualityComparer.GetHashCode((object)v), + (byte[] source) => source.ToArray())))); + bytesNestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BytesNestedCollection", "TestNamespace") }); + var bytesToStringConverterProperty = runtimeEntityType.AddProperty( "BytesToStringConverterProperty", typeof(byte[]), @@ -474,12 +630,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas bytesToStringConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BytesToStringConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BytesToStringConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(bytesToStringConverterProperty, 8), + (InternalEntityEntry entry) => entry.ReadOriginalValue(bytesToStringConverterProperty, 10), (InternalEntityEntry entry) => entry.GetCurrentValue(bytesToStringConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[8]); + (ValueBuffer valueBuffer) => valueBuffer[10]); bytesToStringConverterProperty.SetPropertyIndexes( - index: 8, - originalValueIndex: 8, + index: 10, + originalValueIndex: 10, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); @@ -494,7 +650,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (byte[] v) => v.ToArray()), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), converter: new ValueConverter( (byte[] v) => Convert.ToBase64String(v), @@ -524,12 +680,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas castingConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_CastingConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_CastingConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(castingConverterProperty, 9), + (InternalEntityEntry entry) => entry.ReadOriginalValue(castingConverterProperty, 11), (InternalEntityEntry entry) => entry.GetCurrentValue(castingConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[9]); + (ValueBuffer valueBuffer) => valueBuffer[11]); castingConverterProperty.SetPropertyIndexes( - index: 9, - originalValueIndex: 9, + index: 11, + originalValueIndex: 11, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); @@ -544,7 +700,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (int v) => v), providerValueComparer: new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v), converter: new ValueConverter( (int v) => (decimal)v, @@ -575,12 +731,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas @char.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Char((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Char((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(@char, 10), + (InternalEntityEntry entry) => entry.ReadOriginalValue(@char, 12), (InternalEntityEntry entry) => entry.GetCurrentValue(@char), - (ValueBuffer valueBuffer) => valueBuffer[10]); + (ValueBuffer valueBuffer) => valueBuffer[12]); @char.SetPropertyIndexes( - index: 10, - originalValueIndex: 10, + index: 12, + originalValueIndex: 12, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); @@ -618,31 +774,31 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas charArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_CharArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_CharArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(charArray, 11), + (InternalEntityEntry entry) => entry.ReadOriginalValue(charArray, 13), (InternalEntityEntry entry) => entry.GetCurrentValue(charArray), - (ValueBuffer valueBuffer) => valueBuffer[11]); + (ValueBuffer valueBuffer) => valueBuffer[13]); charArray.SetPropertyIndexes( - index: 11, - originalValueIndex: 11, + index: 13, + originalValueIndex: 13, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); charArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer(new ValueComparer( (char v1, char v2) => v1 == v2, (char v) => (int)v, (char v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer(new ValueComparer( (char v1, char v2) => v1 == v2, (char v) => (int)v, (char v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( JsonCharReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( JsonCharReaderWriter.Instance), elementMapping: CharTypeMapping.Default.Clone( comparer: new ValueComparer( @@ -661,6 +817,85 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas storeTypeName: "TEXT"))); charArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_CharArray", "TestNamespace") }); + var charNestedCollection = runtimeEntityType.AddProperty( + "CharNestedCollection", + typeof(char[][]), + propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("CharNestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + charNestedCollection.SetGetter( + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_CharNestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_CharNestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_CharNestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_CharNestedCollection(instance) == null); + charNestedCollection.SetSetter( + (CompiledModelTestBase.ManyTypes entity, char[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_CharNestedCollection(entity) = value); + charNestedCollection.SetMaterializationSetter( + (CompiledModelTestBase.ManyTypes entity, char[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_CharNestedCollection(entity) = value); + charNestedCollection.SetAccessors( + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_CharNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_CharNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => entry.ReadOriginalValue(charNestedCollection, 14), + (InternalEntityEntry entry) => entry.GetCurrentValue(charNestedCollection), + (ValueBuffer valueBuffer) => valueBuffer[14]); + charNestedCollection.SetPropertyIndexes( + index: 14, + originalValueIndex: 14, + shadowIndex: -1, + relationshipIndex: -1, + storeGenerationIndex: -1); + charNestedCollection.TypeMapping = SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfReferenceTypesComparer(new ListOfValueTypesComparer(new ValueComparer( + (char v1, char v2) => v1 == v2, + (char v) => (int)v, + (char v) => v))), + keyComparer: new ListOfReferenceTypesComparer(new ListOfValueTypesComparer(new ValueComparer( + (char v1, char v2) => v1 == v2, + (char v) => (int)v, + (char v) => v))), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfStructsReaderWriter( + JsonCharReaderWriter.Instance))), + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfStructsReaderWriter( + JsonCharReaderWriter.Instance)), + elementMapping: SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfValueTypesComparer(new ValueComparer( + (char v1, char v2) => v1 == v2, + (char v) => (int)v, + (char v) => v)), + keyComparer: new ListOfValueTypesComparer(new ValueComparer( + (char v1, char v2) => v1 == v2, + (char v) => (int)v, + (char v) => v)), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( + JsonCharReaderWriter.Instance)), + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( + JsonCharReaderWriter.Instance), + elementMapping: CharTypeMapping.Default.Clone( + comparer: new ValueComparer( + (char v1, char v2) => v1 == v2, + (char v) => (int)v, + (char v) => v), + keyComparer: new ValueComparer( + (char v1, char v2) => v1 == v2, + (char v) => (int)v, + (char v) => v), + providerValueComparer: new ValueComparer( + (char v1, char v2) => v1 == v2, + (char v) => (int)v, + (char v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "TEXT")))); + charNestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_CharNestedCollection", "TestNamespace") }); + var charToStringConverterProperty = runtimeEntityType.AddProperty( "CharToStringConverterProperty", typeof(char), @@ -679,12 +914,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas charToStringConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_CharToStringConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_CharToStringConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(charToStringConverterProperty, 12), + (InternalEntityEntry entry) => entry.ReadOriginalValue(charToStringConverterProperty, 15), (InternalEntityEntry entry) => entry.GetCurrentValue(charToStringConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[12]); + (ValueBuffer valueBuffer) => valueBuffer[15]); charToStringConverterProperty.SetPropertyIndexes( - index: 12, - originalValueIndex: 12, + index: 15, + originalValueIndex: 15, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); @@ -699,7 +934,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (char v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( size: 1), @@ -732,12 +967,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas dateOnly.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DateOnly((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DateOnly((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(dateOnly, 13), + (InternalEntityEntry entry) => entry.ReadOriginalValue(dateOnly, 16), (InternalEntityEntry entry) => entry.GetCurrentValue(dateOnly), - (ValueBuffer valueBuffer) => valueBuffer[13]); + (ValueBuffer valueBuffer) => valueBuffer[16]); dateOnly.SetPropertyIndexes( - index: 13, - originalValueIndex: 13, + index: 16, + originalValueIndex: 16, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); @@ -761,31 +996,31 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas dateOnlyArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DateOnlyArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DateOnlyArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(dateOnlyArray, 14), + (InternalEntityEntry entry) => entry.ReadOriginalValue(dateOnlyArray, 17), (InternalEntityEntry entry) => entry.GetCurrentValue(dateOnlyArray), - (ValueBuffer valueBuffer) => valueBuffer[14]); + (ValueBuffer valueBuffer) => valueBuffer[17]); dateOnlyArray.SetPropertyIndexes( - index: 14, - originalValueIndex: 14, + index: 17, + originalValueIndex: 17, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); dateOnlyArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer(new ValueComparer( (DateOnly v1, DateOnly v2) => v1.Equals(v2), - (DateOnly v) => v.GetHashCode(), + (DateOnly v) => ((object)v).GetHashCode(), (DateOnly v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer(new ValueComparer( (DateOnly v1, DateOnly v2) => v1.Equals(v2), - (DateOnly v) => v.GetHashCode(), + (DateOnly v) => ((object)v).GetHashCode(), (DateOnly v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( JsonDateOnlyReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( JsonDateOnlyReaderWriter.Instance), elementMapping: SqliteDateOnlyTypeMapping.Default); dateOnlyArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DateOnlyArray", "TestNamespace") }); @@ -808,27 +1043,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas dateOnlyToStringConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DateOnlyToStringConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DateOnlyToStringConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(dateOnlyToStringConverterProperty, 15), + (InternalEntityEntry entry) => entry.ReadOriginalValue(dateOnlyToStringConverterProperty, 18), (InternalEntityEntry entry) => entry.GetCurrentValue(dateOnlyToStringConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[15]); + (ValueBuffer valueBuffer) => valueBuffer[18]); dateOnlyToStringConverterProperty.SetPropertyIndexes( - index: 15, - originalValueIndex: 15, + index: 18, + originalValueIndex: 18, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); dateOnlyToStringConverterProperty.TypeMapping = SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (DateOnly v1, DateOnly v2) => v1.Equals(v2), - (DateOnly v) => v.GetHashCode(), + (DateOnly v) => ((object)v).GetHashCode(), (DateOnly v) => v), keyComparer: new ValueComparer( (DateOnly v1, DateOnly v2) => v1.Equals(v2), - (DateOnly v) => v.GetHashCode(), + (DateOnly v) => ((object)v).GetHashCode(), (DateOnly v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( size: 10), @@ -861,12 +1096,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas dateTime.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DateTime((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DateTime((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(dateTime, 16), + (InternalEntityEntry entry) => entry.ReadOriginalValue(dateTime, 19), (InternalEntityEntry entry) => entry.GetCurrentValue(dateTime), - (ValueBuffer valueBuffer) => valueBuffer[16]); + (ValueBuffer valueBuffer) => valueBuffer[19]); dateTime.SetPropertyIndexes( - index: 16, - originalValueIndex: 16, + index: 19, + originalValueIndex: 19, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); @@ -890,31 +1125,31 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas dateTimeArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DateTimeArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DateTimeArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(dateTimeArray, 17), + (InternalEntityEntry entry) => entry.ReadOriginalValue(dateTimeArray, 20), (InternalEntityEntry entry) => entry.GetCurrentValue(dateTimeArray), - (ValueBuffer valueBuffer) => valueBuffer[17]); + (ValueBuffer valueBuffer) => valueBuffer[20]); dateTimeArray.SetPropertyIndexes( - index: 17, - originalValueIndex: 17, + index: 20, + originalValueIndex: 20, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); dateTimeArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer(new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer(new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( SqliteJsonDateTimeReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( SqliteJsonDateTimeReaderWriter.Instance), elementMapping: SqliteDateTimeTypeMapping.Default); dateTimeArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DateTimeArray", "TestNamespace") }); @@ -937,27 +1172,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas dateTimeOffsetToBinaryConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DateTimeOffsetToBinaryConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DateTimeOffsetToBinaryConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(dateTimeOffsetToBinaryConverterProperty, 18), + (InternalEntityEntry entry) => entry.ReadOriginalValue(dateTimeOffsetToBinaryConverterProperty, 21), (InternalEntityEntry entry) => entry.GetCurrentValue(dateTimeOffsetToBinaryConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[18]); + (ValueBuffer valueBuffer) => valueBuffer[21]); dateTimeOffsetToBinaryConverterProperty.SetPropertyIndexes( - index: 18, - originalValueIndex: 18, + index: 21, + originalValueIndex: 21, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); dateTimeOffsetToBinaryConverterProperty.TypeMapping = LongTypeMapping.Default.Clone( comparer: new ValueComparer( (DateTimeOffset v1, DateTimeOffset v2) => v1.EqualsExact(v2), - (DateTimeOffset v) => v.GetHashCode(), + (DateTimeOffset v) => ((object)v).GetHashCode(), (DateTimeOffset v) => v), keyComparer: new ValueComparer( (DateTimeOffset v1, DateTimeOffset v2) => v1.EqualsExact(v2), - (DateTimeOffset v) => v.GetHashCode(), + (DateTimeOffset v) => ((object)v).GetHashCode(), (DateTimeOffset v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "INTEGER"), @@ -990,23 +1225,23 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas dateTimeOffsetToBytesConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DateTimeOffsetToBytesConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DateTimeOffsetToBytesConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(dateTimeOffsetToBytesConverterProperty, 19), + (InternalEntityEntry entry) => entry.ReadOriginalValue(dateTimeOffsetToBytesConverterProperty, 22), (InternalEntityEntry entry) => entry.GetCurrentValue(dateTimeOffsetToBytesConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[19]); + (ValueBuffer valueBuffer) => valueBuffer[22]); dateTimeOffsetToBytesConverterProperty.SetPropertyIndexes( - index: 19, - originalValueIndex: 19, + index: 22, + originalValueIndex: 22, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); dateTimeOffsetToBytesConverterProperty.TypeMapping = SqliteByteArrayTypeMapping.Default.Clone( comparer: new ValueComparer( (DateTimeOffset v1, DateTimeOffset v2) => v1.EqualsExact(v2), - (DateTimeOffset v) => v.GetHashCode(), + (DateTimeOffset v) => ((object)v).GetHashCode(), (DateTimeOffset v) => v), keyComparer: new ValueComparer( (DateTimeOffset v1, DateTimeOffset v2) => v1.EqualsExact(v2), - (DateTimeOffset v) => v.GetHashCode(), + (DateTimeOffset v) => ((object)v).GetHashCode(), (DateTimeOffset v) => v), providerValueComparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), @@ -1043,27 +1278,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas dateTimeOffsetToStringConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DateTimeOffsetToStringConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DateTimeOffsetToStringConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(dateTimeOffsetToStringConverterProperty, 20), + (InternalEntityEntry entry) => entry.ReadOriginalValue(dateTimeOffsetToStringConverterProperty, 23), (InternalEntityEntry entry) => entry.GetCurrentValue(dateTimeOffsetToStringConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[20]); + (ValueBuffer valueBuffer) => valueBuffer[23]); dateTimeOffsetToStringConverterProperty.SetPropertyIndexes( - index: 20, - originalValueIndex: 20, + index: 23, + originalValueIndex: 23, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); dateTimeOffsetToStringConverterProperty.TypeMapping = SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (DateTimeOffset v1, DateTimeOffset v2) => v1.EqualsExact(v2), - (DateTimeOffset v) => v.GetHashCode(), + (DateTimeOffset v) => ((object)v).GetHashCode(), (DateTimeOffset v) => v), keyComparer: new ValueComparer( (DateTimeOffset v1, DateTimeOffset v2) => v1.EqualsExact(v2), - (DateTimeOffset v) => v.GetHashCode(), + (DateTimeOffset v) => ((object)v).GetHashCode(), (DateTimeOffset v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( size: 48), @@ -1096,27 +1331,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas dateTimeToBinaryConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DateTimeToBinaryConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DateTimeToBinaryConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(dateTimeToBinaryConverterProperty, 21), + (InternalEntityEntry entry) => entry.ReadOriginalValue(dateTimeToBinaryConverterProperty, 24), (InternalEntityEntry entry) => entry.GetCurrentValue(dateTimeToBinaryConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[21]); + (ValueBuffer valueBuffer) => valueBuffer[24]); dateTimeToBinaryConverterProperty.SetPropertyIndexes( - index: 21, - originalValueIndex: 21, + index: 24, + originalValueIndex: 24, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); dateTimeToBinaryConverterProperty.TypeMapping = LongTypeMapping.Default.Clone( comparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v), keyComparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "INTEGER"), @@ -1149,27 +1384,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas dateTimeToStringConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DateTimeToStringConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DateTimeToStringConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(dateTimeToStringConverterProperty, 22), + (InternalEntityEntry entry) => entry.ReadOriginalValue(dateTimeToStringConverterProperty, 25), (InternalEntityEntry entry) => entry.GetCurrentValue(dateTimeToStringConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[22]); + (ValueBuffer valueBuffer) => valueBuffer[25]); dateTimeToStringConverterProperty.SetPropertyIndexes( - index: 22, - originalValueIndex: 22, + index: 25, + originalValueIndex: 25, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); dateTimeToStringConverterProperty.TypeMapping = SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v), keyComparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( size: 48), @@ -1202,12 +1437,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas dateTimeToTicksConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DateTimeToTicksConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DateTimeToTicksConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(dateTimeToTicksConverterProperty, 23), + (InternalEntityEntry entry) => entry.ReadOriginalValue(dateTimeToTicksConverterProperty, 26), (InternalEntityEntry entry) => entry.GetCurrentValue(dateTimeToTicksConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[23]); + (ValueBuffer valueBuffer) => valueBuffer[26]); dateTimeToTicksConverterProperty.SetPropertyIndexes( - index: 23, - originalValueIndex: 23, + index: 26, + originalValueIndex: 26, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); @@ -1232,12 +1467,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas @decimal.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Decimal((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Decimal((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(@decimal, 24), + (InternalEntityEntry entry) => entry.ReadOriginalValue(@decimal, 27), (InternalEntityEntry entry) => entry.GetCurrentValue(@decimal), - (ValueBuffer valueBuffer) => valueBuffer[24]); + (ValueBuffer valueBuffer) => valueBuffer[27]); @decimal.SetPropertyIndexes( - index: 24, - originalValueIndex: 24, + index: 27, + originalValueIndex: 27, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); @@ -1261,31 +1496,31 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas decimalArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DecimalArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DecimalArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(decimalArray, 25), + (InternalEntityEntry entry) => entry.ReadOriginalValue(decimalArray, 28), (InternalEntityEntry entry) => entry.GetCurrentValue(decimalArray), - (ValueBuffer valueBuffer) => valueBuffer[25]); + (ValueBuffer valueBuffer) => valueBuffer[28]); decimalArray.SetPropertyIndexes( - index: 25, - originalValueIndex: 25, + index: 28, + originalValueIndex: 28, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); decimalArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer(new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer(new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( SqliteJsonDecimalReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( SqliteJsonDecimalReaderWriter.Instance), elementMapping: SqliteDecimalTypeMapping.Default); decimalArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DecimalArray", "TestNamespace") }); @@ -1308,23 +1543,23 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas decimalNumberToBytesConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DecimalNumberToBytesConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DecimalNumberToBytesConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(decimalNumberToBytesConverterProperty, 26), + (InternalEntityEntry entry) => entry.ReadOriginalValue(decimalNumberToBytesConverterProperty, 29), (InternalEntityEntry entry) => entry.GetCurrentValue(decimalNumberToBytesConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[26]); + (ValueBuffer valueBuffer) => valueBuffer[29]); decimalNumberToBytesConverterProperty.SetPropertyIndexes( - index: 26, - originalValueIndex: 26, + index: 29, + originalValueIndex: 29, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); decimalNumberToBytesConverterProperty.TypeMapping = SqliteByteArrayTypeMapping.Default.Clone( comparer: new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v), keyComparer: new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v), providerValueComparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), @@ -1361,27 +1596,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas decimalNumberToStringConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DecimalNumberToStringConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DecimalNumberToStringConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(decimalNumberToStringConverterProperty, 27), + (InternalEntityEntry entry) => entry.ReadOriginalValue(decimalNumberToStringConverterProperty, 30), (InternalEntityEntry entry) => entry.GetCurrentValue(decimalNumberToStringConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[27]); + (ValueBuffer valueBuffer) => valueBuffer[30]); decimalNumberToStringConverterProperty.SetPropertyIndexes( - index: 27, - originalValueIndex: 27, + index: 30, + originalValueIndex: 30, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); decimalNumberToStringConverterProperty.TypeMapping = SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v), keyComparer: new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( size: 64), @@ -1414,27 +1649,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas @double.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Double((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Double((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(@double, 28), + (InternalEntityEntry entry) => entry.ReadOriginalValue(@double, 31), (InternalEntityEntry entry) => entry.GetCurrentValue(@double), - (ValueBuffer valueBuffer) => valueBuffer[28]); + (ValueBuffer valueBuffer) => valueBuffer[31]); @double.SetPropertyIndexes( - index: 28, - originalValueIndex: 28, + index: 31, + originalValueIndex: 31, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); @double.TypeMapping = DoubleTypeMapping.Default.Clone( comparer: new ValueComparer( (double v1, double v2) => v1.Equals(v2), - (double v) => v.GetHashCode(), + (double v) => ((object)v).GetHashCode(), (double v) => v), keyComparer: new ValueComparer( (double v1, double v2) => v1.Equals(v2), - (double v) => v.GetHashCode(), + (double v) => ((object)v).GetHashCode(), (double v) => v), providerValueComparer: new ValueComparer( (double v1, double v2) => v1.Equals(v2), - (double v) => v.GetHashCode(), + (double v) => ((object)v).GetHashCode(), (double v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "REAL")); @@ -1457,44 +1692,44 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas doubleArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DoubleArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DoubleArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(doubleArray, 29), + (InternalEntityEntry entry) => entry.ReadOriginalValue(doubleArray, 32), (InternalEntityEntry entry) => entry.GetCurrentValue(doubleArray), - (ValueBuffer valueBuffer) => valueBuffer[29]); + (ValueBuffer valueBuffer) => valueBuffer[32]); doubleArray.SetPropertyIndexes( - index: 29, - originalValueIndex: 29, + index: 32, + originalValueIndex: 32, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); doubleArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer(new ValueComparer( (double v1, double v2) => v1.Equals(v2), - (double v) => v.GetHashCode(), + (double v) => ((object)v).GetHashCode(), (double v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer(new ValueComparer( (double v1, double v2) => v1.Equals(v2), - (double v) => v.GetHashCode(), + (double v) => ((object)v).GetHashCode(), (double v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( JsonDoubleReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( JsonDoubleReaderWriter.Instance), elementMapping: DoubleTypeMapping.Default.Clone( comparer: new ValueComparer( (double v1, double v2) => v1.Equals(v2), - (double v) => v.GetHashCode(), + (double v) => ((object)v).GetHashCode(), (double v) => v), keyComparer: new ValueComparer( (double v1, double v2) => v1.Equals(v2), - (double v) => v.GetHashCode(), + (double v) => ((object)v).GetHashCode(), (double v) => v), providerValueComparer: new ValueComparer( (double v1, double v2) => v1.Equals(v2), - (double v) => v.GetHashCode(), + (double v) => ((object)v).GetHashCode(), (double v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "REAL"))); @@ -1518,23 +1753,23 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas doubleNumberToBytesConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DoubleNumberToBytesConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DoubleNumberToBytesConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(doubleNumberToBytesConverterProperty, 30), + (InternalEntityEntry entry) => entry.ReadOriginalValue(doubleNumberToBytesConverterProperty, 33), (InternalEntityEntry entry) => entry.GetCurrentValue(doubleNumberToBytesConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[30]); + (ValueBuffer valueBuffer) => valueBuffer[33]); doubleNumberToBytesConverterProperty.SetPropertyIndexes( - index: 30, - originalValueIndex: 30, + index: 33, + originalValueIndex: 33, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); doubleNumberToBytesConverterProperty.TypeMapping = SqliteByteArrayTypeMapping.Default.Clone( comparer: new ValueComparer( (double v1, double v2) => v1.Equals(v2), - (double v) => v.GetHashCode(), + (double v) => ((object)v).GetHashCode(), (double v) => v), keyComparer: new ValueComparer( (double v1, double v2) => v1.Equals(v2), - (double v) => v.GetHashCode(), + (double v) => ((object)v).GetHashCode(), (double v) => v), providerValueComparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), @@ -1571,27 +1806,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas doubleNumberToStringConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DoubleNumberToStringConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_DoubleNumberToStringConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(doubleNumberToStringConverterProperty, 31), + (InternalEntityEntry entry) => entry.ReadOriginalValue(doubleNumberToStringConverterProperty, 34), (InternalEntityEntry entry) => entry.GetCurrentValue(doubleNumberToStringConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[31]); + (ValueBuffer valueBuffer) => valueBuffer[34]); doubleNumberToStringConverterProperty.SetPropertyIndexes( - index: 31, - originalValueIndex: 31, + index: 34, + originalValueIndex: 34, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); doubleNumberToStringConverterProperty.TypeMapping = SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (double v1, double v2) => v1.Equals(v2), - (double v) => v.GetHashCode(), + (double v) => ((object)v).GetHashCode(), (double v) => v), keyComparer: new ValueComparer( (double v1, double v2) => v1.Equals(v2), - (double v) => v.GetHashCode(), + (double v) => ((object)v).GetHashCode(), (double v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( size: 64), @@ -1623,23 +1858,23 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum16.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum16((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum16((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(enum16, 32), + (InternalEntityEntry entry) => entry.ReadOriginalValue(enum16, 35), (InternalEntityEntry entry) => entry.GetCurrentValue(enum16), - (ValueBuffer valueBuffer) => valueBuffer[32]); + (ValueBuffer valueBuffer) => valueBuffer[35]); enum16.SetPropertyIndexes( - index: 32, - originalValueIndex: 32, + index: 35, + originalValueIndex: 35, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enum16.TypeMapping = ShortTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v), providerValueComparer: new ValueComparer( (short v1, short v2) => v1 == v2, @@ -1675,35 +1910,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum16Array.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum16Array((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum16Array((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(enum16Array, 33), + (InternalEntityEntry entry) => entry.ReadOriginalValue(enum16Array, 36), (InternalEntityEntry entry) => entry.GetCurrentValue(enum16Array), - (ValueBuffer valueBuffer) => valueBuffer[33]); + (ValueBuffer valueBuffer) => valueBuffer[36]); enum16Array.SetPropertyIndexes( - index: 33, - originalValueIndex: 33, + index: 36, + originalValueIndex: 36, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enum16Array.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonInt16ReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.Enum16 value) => (short)value, (short value) => (CompiledModelTestBase.Enum16)value)))), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonInt16ReaderWriter.Instance, new ValueConverter( @@ -1712,11 +1947,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: ShortTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v), providerValueComparer: new ValueComparer( (short v1, short v2) => v1 == v2, @@ -1752,35 +1987,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum16AsString.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum16AsString((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum16AsString((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(enum16AsString, 34), + (InternalEntityEntry entry) => entry.ReadOriginalValue(enum16AsString, 37), (InternalEntityEntry entry) => entry.GetCurrentValue(enum16AsString), - (ValueBuffer valueBuffer) => valueBuffer[34]); + (ValueBuffer valueBuffer) => valueBuffer[37]); enum16AsString.SetPropertyIndexes( - index: 34, - originalValueIndex: 34, + index: 37, + originalValueIndex: 37, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enum16AsString.TypeMapping = SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), converter: new ValueConverter( - (CompiledModelTestBase.Enum16 v) => v.ToString(), + (CompiledModelTestBase.Enum16 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum16 v) => v.ToString(), + (CompiledModelTestBase.Enum16 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))); enum16AsString.SetSentinelFromProviderValue("Default"); enum16AsString.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum16AsString", "TestNamespace") }); @@ -1802,60 +2037,60 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum16AsStringArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum16AsStringArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum16AsStringArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(enum16AsStringArray, 35), + (InternalEntityEntry entry) => entry.ReadOriginalValue(enum16AsStringArray, 38), (InternalEntityEntry entry) => entry.GetCurrentValue(enum16AsStringArray), - (ValueBuffer valueBuffer) => valueBuffer[35]); + (ValueBuffer valueBuffer) => valueBuffer[38]); enum16AsStringArray.SetPropertyIndexes( - index: 35, - originalValueIndex: 35, + index: 38, + originalValueIndex: 38, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enum16AsStringArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum16 v) => v.ToString(), + (CompiledModelTestBase.Enum16 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum16 v) => v.ToString(), + (CompiledModelTestBase.Enum16 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))), elementMapping: SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), converter: new ValueConverter( - (CompiledModelTestBase.Enum16 v) => v.ToString(), + (CompiledModelTestBase.Enum16 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum16 v) => v.ToString(), + (CompiledModelTestBase.Enum16 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))); enum16AsStringArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum16AsStringArray", "TestNamespace") }); @@ -1876,60 +2111,60 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum16AsStringCollection.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum16AsStringCollection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum16AsStringCollection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(enum16AsStringCollection, 36), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(enum16AsStringCollection, 39), (InternalEntityEntry entry) => entry.GetCurrentValue>(enum16AsStringCollection), - (ValueBuffer valueBuffer) => valueBuffer[36]); + (ValueBuffer valueBuffer) => valueBuffer[39]); enum16AsStringCollection.SetPropertyIndexes( - index: 36, - originalValueIndex: 36, + index: 39, + originalValueIndex: 39, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enum16AsStringCollection.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer, CompiledModelTestBase.Enum16>(new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer, CompiledModelTestBase.Enum16>(new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, CompiledModelTestBase.Enum16>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.Enum16>( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum16 v) => v.ToString(), + (CompiledModelTestBase.Enum16 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, CompiledModelTestBase.Enum16>( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.Enum16>( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum16 v) => v.ToString(), + (CompiledModelTestBase.Enum16 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))), elementMapping: SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), converter: new ValueConverter( - (CompiledModelTestBase.Enum16 v) => v.ToString(), + (CompiledModelTestBase.Enum16 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum16 v) => v.ToString(), + (CompiledModelTestBase.Enum16 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))); enum16AsStringCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum16AsStringCollection", "TestNamespace") }); @@ -1950,35 +2185,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum16Collection.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum16Collection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum16Collection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(enum16Collection, 37), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(enum16Collection, 40), (InternalEntityEntry entry) => entry.GetCurrentValue>(enum16Collection), - (ValueBuffer valueBuffer) => valueBuffer[37]); + (ValueBuffer valueBuffer) => valueBuffer[40]); enum16Collection.SetPropertyIndexes( - index: 37, - originalValueIndex: 37, + index: 40, + originalValueIndex: 40, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enum16Collection.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer, CompiledModelTestBase.Enum16>(new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer, CompiledModelTestBase.Enum16>(new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, CompiledModelTestBase.Enum16>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.Enum16>( new JsonConvertedValueReaderWriter( JsonInt16ReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.Enum16 value) => (short)value, (short value) => (CompiledModelTestBase.Enum16)value)))), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, CompiledModelTestBase.Enum16>( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.Enum16>( new JsonConvertedValueReaderWriter( JsonInt16ReaderWriter.Instance, new ValueConverter( @@ -1987,11 +2222,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: ShortTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v), providerValueComparer: new ValueComparer( (short v1, short v2) => v1 == v2, @@ -2026,23 +2261,23 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum32.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum32((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum32((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(enum32, 38), + (InternalEntityEntry entry) => entry.ReadOriginalValue(enum32, 41), (InternalEntityEntry entry) => entry.GetCurrentValue(enum32), - (ValueBuffer valueBuffer) => valueBuffer[38]); + (ValueBuffer valueBuffer) => valueBuffer[41]); enum32.SetPropertyIndexes( - index: 38, - originalValueIndex: 38, + index: 41, + originalValueIndex: 41, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enum32.TypeMapping = IntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -2078,35 +2313,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum32Array.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum32Array((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum32Array((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(enum32Array, 39), + (InternalEntityEntry entry) => entry.ReadOriginalValue(enum32Array, 42), (InternalEntityEntry entry) => entry.GetCurrentValue(enum32Array), - (ValueBuffer valueBuffer) => valueBuffer[39]); + (ValueBuffer valueBuffer) => valueBuffer[42]); enum32Array.SetPropertyIndexes( - index: 39, - originalValueIndex: 39, + index: 42, + originalValueIndex: 42, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enum32Array.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonInt32ReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.Enum32 value) => (int)value, (int value) => (CompiledModelTestBase.Enum32)value)))), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonInt32ReaderWriter.Instance, new ValueConverter( @@ -2115,11 +2350,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: IntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -2155,35 +2390,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum32AsString.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum32AsString((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum32AsString((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(enum32AsString, 40), + (InternalEntityEntry entry) => entry.ReadOriginalValue(enum32AsString, 43), (InternalEntityEntry entry) => entry.GetCurrentValue(enum32AsString), - (ValueBuffer valueBuffer) => valueBuffer[40]); + (ValueBuffer valueBuffer) => valueBuffer[43]); enum32AsString.SetPropertyIndexes( - index: 40, - originalValueIndex: 40, + index: 43, + originalValueIndex: 43, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enum32AsString.TypeMapping = SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), converter: new ValueConverter( - (CompiledModelTestBase.Enum32 v) => v.ToString(), + (CompiledModelTestBase.Enum32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum32 v) => v.ToString(), + (CompiledModelTestBase.Enum32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))); enum32AsString.SetSentinelFromProviderValue("Default"); enum32AsString.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum32AsString", "TestNamespace") }); @@ -2205,60 +2440,60 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum32AsStringArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum32AsStringArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum32AsStringArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(enum32AsStringArray, 41), + (InternalEntityEntry entry) => entry.ReadOriginalValue(enum32AsStringArray, 44), (InternalEntityEntry entry) => entry.GetCurrentValue(enum32AsStringArray), - (ValueBuffer valueBuffer) => valueBuffer[41]); + (ValueBuffer valueBuffer) => valueBuffer[44]); enum32AsStringArray.SetPropertyIndexes( - index: 41, - originalValueIndex: 41, + index: 44, + originalValueIndex: 44, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enum32AsStringArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum32 v) => v.ToString(), + (CompiledModelTestBase.Enum32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum32 v) => v.ToString(), + (CompiledModelTestBase.Enum32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))), elementMapping: SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), converter: new ValueConverter( - (CompiledModelTestBase.Enum32 v) => v.ToString(), + (CompiledModelTestBase.Enum32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum32 v) => v.ToString(), + (CompiledModelTestBase.Enum32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))); enum32AsStringArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum32AsStringArray", "TestNamespace") }); @@ -2279,60 +2514,60 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum32AsStringCollection.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum32AsStringCollection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum32AsStringCollection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(enum32AsStringCollection, 42), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(enum32AsStringCollection, 45), (InternalEntityEntry entry) => entry.GetCurrentValue>(enum32AsStringCollection), - (ValueBuffer valueBuffer) => valueBuffer[42]); + (ValueBuffer valueBuffer) => valueBuffer[45]); enum32AsStringCollection.SetPropertyIndexes( - index: 42, - originalValueIndex: 42, + index: 45, + originalValueIndex: 45, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enum32AsStringCollection.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer, CompiledModelTestBase.Enum32>(new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer, CompiledModelTestBase.Enum32>(new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, CompiledModelTestBase.Enum32>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.Enum32>( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum32 v) => v.ToString(), + (CompiledModelTestBase.Enum32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, CompiledModelTestBase.Enum32>( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.Enum32>( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum32 v) => v.ToString(), + (CompiledModelTestBase.Enum32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))), elementMapping: SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), converter: new ValueConverter( - (CompiledModelTestBase.Enum32 v) => v.ToString(), + (CompiledModelTestBase.Enum32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum32 v) => v.ToString(), + (CompiledModelTestBase.Enum32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))); enum32AsStringCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum32AsStringCollection", "TestNamespace") }); @@ -2353,35 +2588,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum32Collection.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum32Collection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum32Collection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(enum32Collection, 43), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(enum32Collection, 46), (InternalEntityEntry entry) => entry.GetCurrentValue>(enum32Collection), - (ValueBuffer valueBuffer) => valueBuffer[43]); + (ValueBuffer valueBuffer) => valueBuffer[46]); enum32Collection.SetPropertyIndexes( - index: 43, - originalValueIndex: 43, + index: 46, + originalValueIndex: 46, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enum32Collection.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer, CompiledModelTestBase.Enum32>(new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer, CompiledModelTestBase.Enum32>(new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, CompiledModelTestBase.Enum32>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.Enum32>( new JsonConvertedValueReaderWriter( JsonInt32ReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.Enum32 value) => (int)value, (int value) => (CompiledModelTestBase.Enum32)value)))), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, CompiledModelTestBase.Enum32>( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.Enum32>( new JsonConvertedValueReaderWriter( JsonInt32ReaderWriter.Instance, new ValueConverter( @@ -2390,11 +2625,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: IntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -2412,6 +2647,138 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (int value) => (CompiledModelTestBase.Enum32)value)))); enum32Collection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum32Collection", "TestNamespace") }); + var enum32NestedCollection = runtimeEntityType.AddProperty( + "Enum32NestedCollection", + typeof(List[][]), + propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("Enum32NestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + enum32NestedCollection.SetGetter( + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum32NestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum32NestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum32NestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum32NestedCollection(instance) == null); + enum32NestedCollection.SetSetter( + (CompiledModelTestBase.ManyTypes entity, List[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum32NestedCollection(entity) = value); + enum32NestedCollection.SetMaterializationSetter( + (CompiledModelTestBase.ManyTypes entity, List[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum32NestedCollection(entity) = value); + enum32NestedCollection.SetAccessors( + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum32NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum32NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => entry.ReadOriginalValue[][]>(enum32NestedCollection, 47), + (InternalEntityEntry entry) => entry.GetCurrentValue[][]>(enum32NestedCollection), + (ValueBuffer valueBuffer) => valueBuffer[47]); + enum32NestedCollection.SetPropertyIndexes( + index: 47, + originalValueIndex: 47, + shadowIndex: -1, + relationshipIndex: -1, + storeGenerationIndex: -1); + enum32NestedCollection.TypeMapping = SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfReferenceTypesComparer[][], List[]>(new ListOfReferenceTypesComparer[], List>(new ListOfValueTypesComparer, CompiledModelTestBase.Enum32>(new ValueComparer( + (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), + (CompiledModelTestBase.Enum32 v) => v)))), + keyComparer: new ListOfReferenceTypesComparer[][], List[]>(new ListOfReferenceTypesComparer[], List>(new ListOfValueTypesComparer, CompiledModelTestBase.Enum32>(new ValueComparer( + (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), + (CompiledModelTestBase.Enum32 v) => v)))), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter[]>(new JsonCollectionOfReferencesReaderWriter[][], List[]>( + new JsonCollectionOfReferencesReaderWriter[], List>( + new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.Enum32>( + new JsonConvertedValueReaderWriter( + JsonInt32ReaderWriter.Instance, + new ValueConverter( + (CompiledModelTestBase.Enum32 value) => (int)value, + (int value) => (CompiledModelTestBase.Enum32)value)))))), + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter[][], List[]>( + new JsonCollectionOfReferencesReaderWriter[], List>( + new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.Enum32>( + new JsonConvertedValueReaderWriter( + JsonInt32ReaderWriter.Instance, + new ValueConverter( + (CompiledModelTestBase.Enum32 value) => (int)value, + (int value) => (CompiledModelTestBase.Enum32)value))))), + elementMapping: SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfReferenceTypesComparer[], List>(new ListOfValueTypesComparer, CompiledModelTestBase.Enum32>(new ValueComparer( + (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), + (CompiledModelTestBase.Enum32 v) => v))), + keyComparer: new ListOfReferenceTypesComparer[], List>(new ListOfValueTypesComparer, CompiledModelTestBase.Enum32>(new ValueComparer( + (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), + (CompiledModelTestBase.Enum32 v) => v))), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter>(new JsonCollectionOfReferencesReaderWriter[], List>( + new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.Enum32>( + new JsonConvertedValueReaderWriter( + JsonInt32ReaderWriter.Instance, + new ValueConverter( + (CompiledModelTestBase.Enum32 value) => (int)value, + (int value) => (CompiledModelTestBase.Enum32)value))))), + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter[], List>( + new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.Enum32>( + new JsonConvertedValueReaderWriter( + JsonInt32ReaderWriter.Instance, + new ValueConverter( + (CompiledModelTestBase.Enum32 value) => (int)value, + (int value) => (CompiledModelTestBase.Enum32)value)))), + elementMapping: SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfValueTypesComparer, CompiledModelTestBase.Enum32>(new ValueComparer( + (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), + (CompiledModelTestBase.Enum32 v) => v)), + keyComparer: new ListOfValueTypesComparer, CompiledModelTestBase.Enum32>(new ValueComparer( + (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), + (CompiledModelTestBase.Enum32 v) => v)), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.Enum32>( + new JsonConvertedValueReaderWriter( + JsonInt32ReaderWriter.Instance, + new ValueConverter( + (CompiledModelTestBase.Enum32 value) => (int)value, + (int value) => (CompiledModelTestBase.Enum32)value)))), + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.Enum32>( + new JsonConvertedValueReaderWriter( + JsonInt32ReaderWriter.Instance, + new ValueConverter( + (CompiledModelTestBase.Enum32 value) => (int)value, + (int value) => (CompiledModelTestBase.Enum32)value))), + elementMapping: IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), + (CompiledModelTestBase.Enum32 v) => v), + keyComparer: new ValueComparer( + (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), + (CompiledModelTestBase.Enum32 v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "INTEGER"), + converter: new ValueConverter( + (CompiledModelTestBase.Enum32 value) => (int)value, + (int value) => (CompiledModelTestBase.Enum32)value), + jsonValueReaderWriter: new JsonConvertedValueReaderWriter( + JsonInt32ReaderWriter.Instance, + new ValueConverter( + (CompiledModelTestBase.Enum32 value) => (int)value, + (int value) => (CompiledModelTestBase.Enum32)value)))))); + enum32NestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum32NestedCollection", "TestNamespace") }); + var enum64 = runtimeEntityType.AddProperty( "Enum64", typeof(CompiledModelTestBase.Enum64), @@ -2429,27 +2796,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum64.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum64((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum64((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(enum64, 44), + (InternalEntityEntry entry) => entry.ReadOriginalValue(enum64, 48), (InternalEntityEntry entry) => entry.GetCurrentValue(enum64), - (ValueBuffer valueBuffer) => valueBuffer[44]); + (ValueBuffer valueBuffer) => valueBuffer[48]); enum64.SetPropertyIndexes( - index: 44, - originalValueIndex: 44, + index: 48, + originalValueIndex: 48, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enum64.TypeMapping = LongTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "INTEGER"), @@ -2481,35 +2848,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum64Array.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum64Array((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum64Array((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(enum64Array, 45), + (InternalEntityEntry entry) => entry.ReadOriginalValue(enum64Array, 49), (InternalEntityEntry entry) => entry.GetCurrentValue(enum64Array), - (ValueBuffer valueBuffer) => valueBuffer[45]); + (ValueBuffer valueBuffer) => valueBuffer[49]); enum64Array.SetPropertyIndexes( - index: 45, - originalValueIndex: 45, + index: 49, + originalValueIndex: 49, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enum64Array.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonInt64ReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.Enum64 value) => (long)value, (long value) => (CompiledModelTestBase.Enum64)value)))), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonInt64ReaderWriter.Instance, new ValueConverter( @@ -2518,15 +2885,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: LongTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "INTEGER"), @@ -2558,35 +2925,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum64AsString.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum64AsString((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum64AsString((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(enum64AsString, 46), + (InternalEntityEntry entry) => entry.ReadOriginalValue(enum64AsString, 50), (InternalEntityEntry entry) => entry.GetCurrentValue(enum64AsString), - (ValueBuffer valueBuffer) => valueBuffer[46]); + (ValueBuffer valueBuffer) => valueBuffer[50]); enum64AsString.SetPropertyIndexes( - index: 46, - originalValueIndex: 46, + index: 50, + originalValueIndex: 50, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enum64AsString.TypeMapping = SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), converter: new ValueConverter( - (CompiledModelTestBase.Enum64 v) => v.ToString(), + (CompiledModelTestBase.Enum64 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum64 v) => v.ToString(), + (CompiledModelTestBase.Enum64 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))); enum64AsString.SetSentinelFromProviderValue("Default"); enum64AsString.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum64AsString", "TestNamespace") }); @@ -2608,60 +2975,60 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum64AsStringArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum64AsStringArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum64AsStringArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(enum64AsStringArray, 47), + (InternalEntityEntry entry) => entry.ReadOriginalValue(enum64AsStringArray, 51), (InternalEntityEntry entry) => entry.GetCurrentValue(enum64AsStringArray), - (ValueBuffer valueBuffer) => valueBuffer[47]); + (ValueBuffer valueBuffer) => valueBuffer[51]); enum64AsStringArray.SetPropertyIndexes( - index: 47, - originalValueIndex: 47, + index: 51, + originalValueIndex: 51, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enum64AsStringArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum64 v) => v.ToString(), + (CompiledModelTestBase.Enum64 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum64 v) => v.ToString(), + (CompiledModelTestBase.Enum64 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))), elementMapping: SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), converter: new ValueConverter( - (CompiledModelTestBase.Enum64 v) => v.ToString(), + (CompiledModelTestBase.Enum64 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum64 v) => v.ToString(), + (CompiledModelTestBase.Enum64 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))); enum64AsStringArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum64AsStringArray", "TestNamespace") }); @@ -2682,60 +3049,60 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum64AsStringCollection.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum64AsStringCollection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum64AsStringCollection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(enum64AsStringCollection, 48), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(enum64AsStringCollection, 52), (InternalEntityEntry entry) => entry.GetCurrentValue>(enum64AsStringCollection), - (ValueBuffer valueBuffer) => valueBuffer[48]); + (ValueBuffer valueBuffer) => valueBuffer[52]); enum64AsStringCollection.SetPropertyIndexes( - index: 48, - originalValueIndex: 48, + index: 52, + originalValueIndex: 52, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enum64AsStringCollection.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer, CompiledModelTestBase.Enum64>(new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer, CompiledModelTestBase.Enum64>(new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, CompiledModelTestBase.Enum64>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.Enum64>( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum64 v) => v.ToString(), + (CompiledModelTestBase.Enum64 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, CompiledModelTestBase.Enum64>( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.Enum64>( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum64 v) => v.ToString(), + (CompiledModelTestBase.Enum64 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))), elementMapping: SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), converter: new ValueConverter( - (CompiledModelTestBase.Enum64 v) => v.ToString(), + (CompiledModelTestBase.Enum64 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum64 v) => v.ToString(), + (CompiledModelTestBase.Enum64 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))); enum64AsStringCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum64AsStringCollection", "TestNamespace") }); @@ -2756,35 +3123,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum64Collection.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum64Collection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum64Collection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(enum64Collection, 49), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(enum64Collection, 53), (InternalEntityEntry entry) => entry.GetCurrentValue>(enum64Collection), - (ValueBuffer valueBuffer) => valueBuffer[49]); + (ValueBuffer valueBuffer) => valueBuffer[53]); enum64Collection.SetPropertyIndexes( - index: 49, - originalValueIndex: 49, + index: 53, + originalValueIndex: 53, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enum64Collection.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer, CompiledModelTestBase.Enum64>(new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer, CompiledModelTestBase.Enum64>(new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, CompiledModelTestBase.Enum64>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.Enum64>( new JsonConvertedValueReaderWriter( JsonInt64ReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.Enum64 value) => (long)value, (long value) => (CompiledModelTestBase.Enum64)value)))), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, CompiledModelTestBase.Enum64>( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.Enum64>( new JsonConvertedValueReaderWriter( JsonInt64ReaderWriter.Instance, new ValueConverter( @@ -2793,15 +3160,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: LongTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "INTEGER"), @@ -2832,23 +3199,23 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum8.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum8((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum8((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(enum8, 50), + (InternalEntityEntry entry) => entry.ReadOriginalValue(enum8, 54), (InternalEntityEntry entry) => entry.GetCurrentValue(enum8), - (ValueBuffer valueBuffer) => valueBuffer[50]); + (ValueBuffer valueBuffer) => valueBuffer[54]); enum8.SetPropertyIndexes( - index: 50, - originalValueIndex: 50, + index: 54, + originalValueIndex: 54, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enum8.TypeMapping = SByteTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), providerValueComparer: new ValueComparer( (sbyte v1, sbyte v2) => v1 == v2, @@ -2884,35 +3251,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum8Array.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum8Array((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum8Array((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(enum8Array, 51), + (InternalEntityEntry entry) => entry.ReadOriginalValue(enum8Array, 55), (InternalEntityEntry entry) => entry.GetCurrentValue(enum8Array), - (ValueBuffer valueBuffer) => valueBuffer[51]); + (ValueBuffer valueBuffer) => valueBuffer[55]); enum8Array.SetPropertyIndexes( - index: 51, - originalValueIndex: 51, + index: 55, + originalValueIndex: 55, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enum8Array.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonSByteReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.Enum8 value) => (sbyte)value, (sbyte value) => (CompiledModelTestBase.Enum8)value)))), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonSByteReaderWriter.Instance, new ValueConverter( @@ -2921,11 +3288,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SByteTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), providerValueComparer: new ValueComparer( (sbyte v1, sbyte v2) => v1 == v2, @@ -2961,35 +3328,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum8AsString.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum8AsString((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum8AsString((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(enum8AsString, 52), + (InternalEntityEntry entry) => entry.ReadOriginalValue(enum8AsString, 56), (InternalEntityEntry entry) => entry.GetCurrentValue(enum8AsString), - (ValueBuffer valueBuffer) => valueBuffer[52]); + (ValueBuffer valueBuffer) => valueBuffer[56]); enum8AsString.SetPropertyIndexes( - index: 52, - originalValueIndex: 52, + index: 56, + originalValueIndex: 56, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enum8AsString.TypeMapping = SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), converter: new ValueConverter( - (CompiledModelTestBase.Enum8 v) => v.ToString(), + (CompiledModelTestBase.Enum8 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum8 v) => v.ToString(), + (CompiledModelTestBase.Enum8 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))); enum8AsString.SetSentinelFromProviderValue("Default"); enum8AsString.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum8AsString", "TestNamespace") }); @@ -3011,60 +3378,60 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum8AsStringArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum8AsStringArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum8AsStringArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(enum8AsStringArray, 53), + (InternalEntityEntry entry) => entry.ReadOriginalValue(enum8AsStringArray, 57), (InternalEntityEntry entry) => entry.GetCurrentValue(enum8AsStringArray), - (ValueBuffer valueBuffer) => valueBuffer[53]); + (ValueBuffer valueBuffer) => valueBuffer[57]); enum8AsStringArray.SetPropertyIndexes( - index: 53, - originalValueIndex: 53, + index: 57, + originalValueIndex: 57, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enum8AsStringArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum8 v) => v.ToString(), + (CompiledModelTestBase.Enum8 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum8 v) => v.ToString(), + (CompiledModelTestBase.Enum8 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))), elementMapping: SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), converter: new ValueConverter( - (CompiledModelTestBase.Enum8 v) => v.ToString(), + (CompiledModelTestBase.Enum8 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum8 v) => v.ToString(), + (CompiledModelTestBase.Enum8 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))); enum8AsStringArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum8AsStringArray", "TestNamespace") }); @@ -3085,60 +3452,60 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum8AsStringCollection.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum8AsStringCollection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum8AsStringCollection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(enum8AsStringCollection, 54), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(enum8AsStringCollection, 58), (InternalEntityEntry entry) => entry.GetCurrentValue>(enum8AsStringCollection), - (ValueBuffer valueBuffer) => valueBuffer[54]); + (ValueBuffer valueBuffer) => valueBuffer[58]); enum8AsStringCollection.SetPropertyIndexes( - index: 54, - originalValueIndex: 54, + index: 58, + originalValueIndex: 58, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enum8AsStringCollection.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer, CompiledModelTestBase.Enum8>(new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer, CompiledModelTestBase.Enum8>(new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, CompiledModelTestBase.Enum8>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.Enum8>( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum8 v) => v.ToString(), + (CompiledModelTestBase.Enum8 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, CompiledModelTestBase.Enum8>( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.Enum8>( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum8 v) => v.ToString(), + (CompiledModelTestBase.Enum8 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))), elementMapping: SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), converter: new ValueConverter( - (CompiledModelTestBase.Enum8 v) => v.ToString(), + (CompiledModelTestBase.Enum8 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum8 v) => v.ToString(), + (CompiledModelTestBase.Enum8 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))); enum8AsStringCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum8AsStringCollection", "TestNamespace") }); @@ -3159,35 +3526,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum8Collection.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum8Collection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum8Collection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(enum8Collection, 55), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(enum8Collection, 59), (InternalEntityEntry entry) => entry.GetCurrentValue>(enum8Collection), - (ValueBuffer valueBuffer) => valueBuffer[55]); + (ValueBuffer valueBuffer) => valueBuffer[59]); enum8Collection.SetPropertyIndexes( - index: 55, - originalValueIndex: 55, + index: 59, + originalValueIndex: 59, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enum8Collection.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer, CompiledModelTestBase.Enum8>(new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer, CompiledModelTestBase.Enum8>(new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, CompiledModelTestBase.Enum8>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.Enum8>( new JsonConvertedValueReaderWriter( JsonSByteReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.Enum8 value) => (sbyte)value, (sbyte value) => (CompiledModelTestBase.Enum8)value)))), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, CompiledModelTestBase.Enum8>( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.Enum8>( new JsonConvertedValueReaderWriter( JsonSByteReaderWriter.Instance, new ValueConverter( @@ -3196,11 +3563,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SByteTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), providerValueComparer: new ValueComparer( (sbyte v1, sbyte v2) => v1 == v2, @@ -3218,6 +3585,109 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (sbyte value) => (CompiledModelTestBase.Enum8)value)))); enum8Collection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum8Collection", "TestNamespace") }); + var enum8NestedCollection = runtimeEntityType.AddProperty( + "Enum8NestedCollection", + typeof(CompiledModelTestBase.Enum8[][]), + propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("Enum8NestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + enum8NestedCollection.SetGetter( + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum8NestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum8NestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum8NestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum8NestedCollection(instance) == null); + enum8NestedCollection.SetSetter( + (CompiledModelTestBase.ManyTypes entity, CompiledModelTestBase.Enum8[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum8NestedCollection(entity) = value); + enum8NestedCollection.SetMaterializationSetter( + (CompiledModelTestBase.ManyTypes entity, CompiledModelTestBase.Enum8[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum8NestedCollection(entity) = value); + enum8NestedCollection.SetAccessors( + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum8NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum8NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => entry.ReadOriginalValue(enum8NestedCollection, 60), + (InternalEntityEntry entry) => entry.GetCurrentValue(enum8NestedCollection), + (ValueBuffer valueBuffer) => valueBuffer[60]); + enum8NestedCollection.SetPropertyIndexes( + index: 60, + originalValueIndex: 60, + shadowIndex: -1, + relationshipIndex: -1, + storeGenerationIndex: -1); + enum8NestedCollection.TypeMapping = SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfReferenceTypesComparer(new ListOfValueTypesComparer(new ValueComparer( + (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), + (CompiledModelTestBase.Enum8 v) => v))), + keyComparer: new ListOfReferenceTypesComparer(new ListOfValueTypesComparer(new ValueComparer( + (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), + (CompiledModelTestBase.Enum8 v) => v))), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfStructsReaderWriter( + new JsonConvertedValueReaderWriter( + JsonSByteReaderWriter.Instance, + new ValueConverter( + (CompiledModelTestBase.Enum8 value) => (sbyte)value, + (sbyte value) => (CompiledModelTestBase.Enum8)value))))), + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfStructsReaderWriter( + new JsonConvertedValueReaderWriter( + JsonSByteReaderWriter.Instance, + new ValueConverter( + (CompiledModelTestBase.Enum8 value) => (sbyte)value, + (sbyte value) => (CompiledModelTestBase.Enum8)value)))), + elementMapping: SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfValueTypesComparer(new ValueComparer( + (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), + (CompiledModelTestBase.Enum8 v) => v)), + keyComparer: new ListOfValueTypesComparer(new ValueComparer( + (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), + (CompiledModelTestBase.Enum8 v) => v)), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( + new JsonConvertedValueReaderWriter( + JsonSByteReaderWriter.Instance, + new ValueConverter( + (CompiledModelTestBase.Enum8 value) => (sbyte)value, + (sbyte value) => (CompiledModelTestBase.Enum8)value)))), + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( + new JsonConvertedValueReaderWriter( + JsonSByteReaderWriter.Instance, + new ValueConverter( + (CompiledModelTestBase.Enum8 value) => (sbyte)value, + (sbyte value) => (CompiledModelTestBase.Enum8)value))), + elementMapping: SByteTypeMapping.Default.Clone( + comparer: new ValueComparer( + (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), + (CompiledModelTestBase.Enum8 v) => v), + keyComparer: new ValueComparer( + (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), + (CompiledModelTestBase.Enum8 v) => v), + providerValueComparer: new ValueComparer( + (sbyte v1, sbyte v2) => v1 == v2, + (sbyte v) => (int)v, + (sbyte v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "INTEGER"), + converter: new ValueConverter( + (CompiledModelTestBase.Enum8 value) => (sbyte)value, + (sbyte value) => (CompiledModelTestBase.Enum8)value), + jsonValueReaderWriter: new JsonConvertedValueReaderWriter( + JsonSByteReaderWriter.Instance, + new ValueConverter( + (CompiledModelTestBase.Enum8 value) => (sbyte)value, + (sbyte value) => (CompiledModelTestBase.Enum8)value))))); + enum8NestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum8NestedCollection", "TestNamespace") }); + var enumToNumberConverterProperty = runtimeEntityType.AddProperty( "EnumToNumberConverterProperty", typeof(CompiledModelTestBase.Enum32), @@ -3236,23 +3706,23 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumToNumberConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumToNumberConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumToNumberConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(enumToNumberConverterProperty, 56), + (InternalEntityEntry entry) => entry.ReadOriginalValue(enumToNumberConverterProperty, 61), (InternalEntityEntry entry) => entry.GetCurrentValue(enumToNumberConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[56]); + (ValueBuffer valueBuffer) => valueBuffer[61]); enumToNumberConverterProperty.SetPropertyIndexes( - index: 56, - originalValueIndex: 56, + index: 61, + originalValueIndex: 61, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enumToNumberConverterProperty.TypeMapping = IntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -3289,35 +3759,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumToStringConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumToStringConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumToStringConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(enumToStringConverterProperty, 57), + (InternalEntityEntry entry) => entry.ReadOriginalValue(enumToStringConverterProperty, 62), (InternalEntityEntry entry) => entry.GetCurrentValue(enumToStringConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[57]); + (ValueBuffer valueBuffer) => valueBuffer[62]); enumToStringConverterProperty.SetPropertyIndexes( - index: 57, - originalValueIndex: 57, + index: 62, + originalValueIndex: 62, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enumToStringConverterProperty.TypeMapping = SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), converter: new ValueConverter( - (CompiledModelTestBase.Enum32 v) => v.ToString(), + (CompiledModelTestBase.Enum32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.Enum32 v) => v.ToString(), + (CompiledModelTestBase.Enum32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))); enumToStringConverterProperty.SetSentinelFromProviderValue("Default"); enumToStringConverterProperty.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumToStringConverterProperty", "TestNamespace") }); @@ -3339,23 +3809,23 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU16.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU16((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU16((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(enumU16, 58), + (InternalEntityEntry entry) => entry.ReadOriginalValue(enumU16, 63), (InternalEntityEntry entry) => entry.GetCurrentValue(enumU16), - (ValueBuffer valueBuffer) => valueBuffer[58]); + (ValueBuffer valueBuffer) => valueBuffer[63]); enumU16.SetPropertyIndexes( - index: 58, - originalValueIndex: 58, + index: 63, + originalValueIndex: 63, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enumU16.TypeMapping = UShortTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v), providerValueComparer: new ValueComparer( (ushort v1, ushort v2) => v1 == v2, @@ -3391,35 +3861,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU16Array.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU16Array((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU16Array((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(enumU16Array, 59), + (InternalEntityEntry entry) => entry.ReadOriginalValue(enumU16Array, 64), (InternalEntityEntry entry) => entry.GetCurrentValue(enumU16Array), - (ValueBuffer valueBuffer) => valueBuffer[59]); + (ValueBuffer valueBuffer) => valueBuffer[64]); enumU16Array.SetPropertyIndexes( - index: 59, - originalValueIndex: 59, + index: 64, + originalValueIndex: 64, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enumU16Array.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonUInt16ReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.EnumU16 value) => (ushort)value, (ushort value) => (CompiledModelTestBase.EnumU16)value)))), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonUInt16ReaderWriter.Instance, new ValueConverter( @@ -3428,11 +3898,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: UShortTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v), providerValueComparer: new ValueComparer( (ushort v1, ushort v2) => v1 == v2, @@ -3468,35 +3938,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU16AsString.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU16AsString((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU16AsString((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(enumU16AsString, 60), + (InternalEntityEntry entry) => entry.ReadOriginalValue(enumU16AsString, 65), (InternalEntityEntry entry) => entry.GetCurrentValue(enumU16AsString), - (ValueBuffer valueBuffer) => valueBuffer[60]); + (ValueBuffer valueBuffer) => valueBuffer[65]); enumU16AsString.SetPropertyIndexes( - index: 60, - originalValueIndex: 60, + index: 65, + originalValueIndex: 65, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enumU16AsString.TypeMapping = SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), converter: new ValueConverter( - (CompiledModelTestBase.EnumU16 v) => v.ToString(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU16 v) => v.ToString(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))); enumU16AsString.SetSentinelFromProviderValue("Min"); enumU16AsString.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU16AsString", "TestNamespace") }); @@ -3518,60 +3988,60 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU16AsStringArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU16AsStringArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU16AsStringArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(enumU16AsStringArray, 61), + (InternalEntityEntry entry) => entry.ReadOriginalValue(enumU16AsStringArray, 66), (InternalEntityEntry entry) => entry.GetCurrentValue(enumU16AsStringArray), - (ValueBuffer valueBuffer) => valueBuffer[61]); + (ValueBuffer valueBuffer) => valueBuffer[66]); enumU16AsStringArray.SetPropertyIndexes( - index: 61, - originalValueIndex: 61, + index: 66, + originalValueIndex: 66, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enumU16AsStringArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU16 v) => v.ToString(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU16 v) => v.ToString(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))), elementMapping: SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), converter: new ValueConverter( - (CompiledModelTestBase.EnumU16 v) => v.ToString(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU16 v) => v.ToString(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))); enumU16AsStringArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU16AsStringArray", "TestNamespace") }); @@ -3592,60 +4062,60 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU16AsStringCollection.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU16AsStringCollection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU16AsStringCollection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(enumU16AsStringCollection, 62), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(enumU16AsStringCollection, 67), (InternalEntityEntry entry) => entry.GetCurrentValue>(enumU16AsStringCollection), - (ValueBuffer valueBuffer) => valueBuffer[62]); + (ValueBuffer valueBuffer) => valueBuffer[67]); enumU16AsStringCollection.SetPropertyIndexes( - index: 62, - originalValueIndex: 62, + index: 67, + originalValueIndex: 67, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enumU16AsStringCollection.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer, CompiledModelTestBase.EnumU16>(new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer, CompiledModelTestBase.EnumU16>(new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, CompiledModelTestBase.EnumU16>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.EnumU16>( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU16 v) => v.ToString(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, CompiledModelTestBase.EnumU16>( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.EnumU16>( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU16 v) => v.ToString(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))), elementMapping: SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), converter: new ValueConverter( - (CompiledModelTestBase.EnumU16 v) => v.ToString(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU16 v) => v.ToString(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))); enumU16AsStringCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU16AsStringCollection", "TestNamespace") }); @@ -3666,35 +4136,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU16Collection.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU16Collection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU16Collection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(enumU16Collection, 63), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(enumU16Collection, 68), (InternalEntityEntry entry) => entry.GetCurrentValue>(enumU16Collection), - (ValueBuffer valueBuffer) => valueBuffer[63]); + (ValueBuffer valueBuffer) => valueBuffer[68]); enumU16Collection.SetPropertyIndexes( - index: 63, - originalValueIndex: 63, + index: 68, + originalValueIndex: 68, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enumU16Collection.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer, CompiledModelTestBase.EnumU16>(new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer, CompiledModelTestBase.EnumU16>(new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, CompiledModelTestBase.EnumU16>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.EnumU16>( new JsonConvertedValueReaderWriter( JsonUInt16ReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.EnumU16 value) => (ushort)value, (ushort value) => (CompiledModelTestBase.EnumU16)value)))), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, CompiledModelTestBase.EnumU16>( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.EnumU16>( new JsonConvertedValueReaderWriter( JsonUInt16ReaderWriter.Instance, new ValueConverter( @@ -3703,11 +4173,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: UShortTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v), providerValueComparer: new ValueComparer( (ushort v1, ushort v2) => v1 == v2, @@ -3742,23 +4212,23 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU32.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU32((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU32((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(enumU32, 64), + (InternalEntityEntry entry) => entry.ReadOriginalValue(enumU32, 69), (InternalEntityEntry entry) => entry.GetCurrentValue(enumU32), - (ValueBuffer valueBuffer) => valueBuffer[64]); + (ValueBuffer valueBuffer) => valueBuffer[69]); enumU32.SetPropertyIndexes( - index: 64, - originalValueIndex: 64, + index: 69, + originalValueIndex: 69, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enumU32.TypeMapping = UIntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v), providerValueComparer: new ValueComparer( (uint v1, uint v2) => v1 == v2, @@ -3794,35 +4264,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU32Array.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU32Array((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU32Array((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(enumU32Array, 65), + (InternalEntityEntry entry) => entry.ReadOriginalValue(enumU32Array, 70), (InternalEntityEntry entry) => entry.GetCurrentValue(enumU32Array), - (ValueBuffer valueBuffer) => valueBuffer[65]); + (ValueBuffer valueBuffer) => valueBuffer[70]); enumU32Array.SetPropertyIndexes( - index: 65, - originalValueIndex: 65, + index: 70, + originalValueIndex: 70, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enumU32Array.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonUInt32ReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.EnumU32 value) => (uint)value, (uint value) => (CompiledModelTestBase.EnumU32)value)))), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonUInt32ReaderWriter.Instance, new ValueConverter( @@ -3831,11 +4301,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: UIntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v), providerValueComparer: new ValueComparer( (uint v1, uint v2) => v1 == v2, @@ -3871,35 +4341,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU32AsString.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU32AsString((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU32AsString((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(enumU32AsString, 66), + (InternalEntityEntry entry) => entry.ReadOriginalValue(enumU32AsString, 71), (InternalEntityEntry entry) => entry.GetCurrentValue(enumU32AsString), - (ValueBuffer valueBuffer) => valueBuffer[66]); + (ValueBuffer valueBuffer) => valueBuffer[71]); enumU32AsString.SetPropertyIndexes( - index: 66, - originalValueIndex: 66, + index: 71, + originalValueIndex: 71, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enumU32AsString.TypeMapping = SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), converter: new ValueConverter( - (CompiledModelTestBase.EnumU32 v) => v.ToString(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU32 v) => v.ToString(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))); enumU32AsString.SetSentinelFromProviderValue("Min"); enumU32AsString.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU32AsString", "TestNamespace") }); @@ -3921,60 +4391,60 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU32AsStringArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU32AsStringArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU32AsStringArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(enumU32AsStringArray, 67), + (InternalEntityEntry entry) => entry.ReadOriginalValue(enumU32AsStringArray, 72), (InternalEntityEntry entry) => entry.GetCurrentValue(enumU32AsStringArray), - (ValueBuffer valueBuffer) => valueBuffer[67]); + (ValueBuffer valueBuffer) => valueBuffer[72]); enumU32AsStringArray.SetPropertyIndexes( - index: 67, - originalValueIndex: 67, + index: 72, + originalValueIndex: 72, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enumU32AsStringArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU32 v) => v.ToString(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU32 v) => v.ToString(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))), elementMapping: SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), converter: new ValueConverter( - (CompiledModelTestBase.EnumU32 v) => v.ToString(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU32 v) => v.ToString(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))); enumU32AsStringArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU32AsStringArray", "TestNamespace") }); @@ -3995,60 +4465,60 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU32AsStringCollection.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU32AsStringCollection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU32AsStringCollection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(enumU32AsStringCollection, 68), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(enumU32AsStringCollection, 73), (InternalEntityEntry entry) => entry.GetCurrentValue>(enumU32AsStringCollection), - (ValueBuffer valueBuffer) => valueBuffer[68]); + (ValueBuffer valueBuffer) => valueBuffer[73]); enumU32AsStringCollection.SetPropertyIndexes( - index: 68, - originalValueIndex: 68, + index: 73, + originalValueIndex: 73, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enumU32AsStringCollection.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer, CompiledModelTestBase.EnumU32>(new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer, CompiledModelTestBase.EnumU32>(new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, CompiledModelTestBase.EnumU32>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.EnumU32>( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU32 v) => v.ToString(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, CompiledModelTestBase.EnumU32>( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.EnumU32>( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU32 v) => v.ToString(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))), elementMapping: SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), converter: new ValueConverter( - (CompiledModelTestBase.EnumU32 v) => v.ToString(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU32 v) => v.ToString(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))); enumU32AsStringCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU32AsStringCollection", "TestNamespace") }); @@ -4069,35 +4539,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU32Collection.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU32Collection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU32Collection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(enumU32Collection, 69), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(enumU32Collection, 74), (InternalEntityEntry entry) => entry.GetCurrentValue>(enumU32Collection), - (ValueBuffer valueBuffer) => valueBuffer[69]); + (ValueBuffer valueBuffer) => valueBuffer[74]); enumU32Collection.SetPropertyIndexes( - index: 69, - originalValueIndex: 69, + index: 74, + originalValueIndex: 74, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enumU32Collection.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer, CompiledModelTestBase.EnumU32>(new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer, CompiledModelTestBase.EnumU32>(new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, CompiledModelTestBase.EnumU32>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.EnumU32>( new JsonConvertedValueReaderWriter( JsonUInt32ReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.EnumU32 value) => (uint)value, (uint value) => (CompiledModelTestBase.EnumU32)value)))), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, CompiledModelTestBase.EnumU32>( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.EnumU32>( new JsonConvertedValueReaderWriter( JsonUInt32ReaderWriter.Instance, new ValueConverter( @@ -4106,11 +4576,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: UIntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v), providerValueComparer: new ValueComparer( (uint v1, uint v2) => v1 == v2, @@ -4145,27 +4615,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU64.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU64((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU64((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(enumU64, 70), + (InternalEntityEntry entry) => entry.ReadOriginalValue(enumU64, 75), (InternalEntityEntry entry) => entry.GetCurrentValue(enumU64), - (ValueBuffer valueBuffer) => valueBuffer[70]); + (ValueBuffer valueBuffer) => valueBuffer[75]); enumU64.SetPropertyIndexes( - index: 70, - originalValueIndex: 70, + index: 75, + originalValueIndex: 75, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enumU64.TypeMapping = SqliteULongTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), providerValueComparer: new ValueComparer( (ulong v1, ulong v2) => v1 == v2, - (ulong v) => v.GetHashCode(), + (ulong v) => ((object)v).GetHashCode(), (ulong v) => v), converter: new ValueConverter( (CompiledModelTestBase.EnumU64 value) => (ulong)value, @@ -4195,35 +4665,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU64Array.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU64Array((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU64Array((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(enumU64Array, 71), + (InternalEntityEntry entry) => entry.ReadOriginalValue(enumU64Array, 76), (InternalEntityEntry entry) => entry.GetCurrentValue(enumU64Array), - (ValueBuffer valueBuffer) => valueBuffer[71]); + (ValueBuffer valueBuffer) => valueBuffer[76]); enumU64Array.SetPropertyIndexes( - index: 71, - originalValueIndex: 71, + index: 76, + originalValueIndex: 76, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enumU64Array.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonUInt64ReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.EnumU64 value) => (ulong)value, (ulong value) => (CompiledModelTestBase.EnumU64)value)))), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonUInt64ReaderWriter.Instance, new ValueConverter( @@ -4232,15 +4702,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqliteULongTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), providerValueComparer: new ValueComparer( (ulong v1, ulong v2) => v1 == v2, - (ulong v) => v.GetHashCode(), + (ulong v) => ((object)v).GetHashCode(), (ulong v) => v), converter: new ValueConverter( (CompiledModelTestBase.EnumU64 value) => (ulong)value, @@ -4270,35 +4740,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU64AsString.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU64AsString((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU64AsString((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(enumU64AsString, 72), + (InternalEntityEntry entry) => entry.ReadOriginalValue(enumU64AsString, 77), (InternalEntityEntry entry) => entry.GetCurrentValue(enumU64AsString), - (ValueBuffer valueBuffer) => valueBuffer[72]); + (ValueBuffer valueBuffer) => valueBuffer[77]); enumU64AsString.SetPropertyIndexes( - index: 72, - originalValueIndex: 72, + index: 77, + originalValueIndex: 77, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enumU64AsString.TypeMapping = SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), converter: new ValueConverter( - (CompiledModelTestBase.EnumU64 v) => v.ToString(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU64 v) => v.ToString(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))); enumU64AsString.SetSentinelFromProviderValue("Min"); enumU64AsString.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU64AsString", "TestNamespace") }); @@ -4320,60 +4790,60 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU64AsStringArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU64AsStringArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU64AsStringArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(enumU64AsStringArray, 73), + (InternalEntityEntry entry) => entry.ReadOriginalValue(enumU64AsStringArray, 78), (InternalEntityEntry entry) => entry.GetCurrentValue(enumU64AsStringArray), - (ValueBuffer valueBuffer) => valueBuffer[73]); + (ValueBuffer valueBuffer) => valueBuffer[78]); enumU64AsStringArray.SetPropertyIndexes( - index: 73, - originalValueIndex: 73, + index: 78, + originalValueIndex: 78, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enumU64AsStringArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU64 v) => v.ToString(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU64 v) => v.ToString(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))), elementMapping: SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), converter: new ValueConverter( - (CompiledModelTestBase.EnumU64 v) => v.ToString(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU64 v) => v.ToString(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))); enumU64AsStringArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU64AsStringArray", "TestNamespace") }); @@ -4394,60 +4864,60 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU64AsStringCollection.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU64AsStringCollection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU64AsStringCollection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(enumU64AsStringCollection, 74), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(enumU64AsStringCollection, 79), (InternalEntityEntry entry) => entry.GetCurrentValue>(enumU64AsStringCollection), - (ValueBuffer valueBuffer) => valueBuffer[74]); + (ValueBuffer valueBuffer) => valueBuffer[79]); enumU64AsStringCollection.SetPropertyIndexes( - index: 74, - originalValueIndex: 74, + index: 79, + originalValueIndex: 79, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enumU64AsStringCollection.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer, CompiledModelTestBase.EnumU64>(new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer, CompiledModelTestBase.EnumU64>(new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, CompiledModelTestBase.EnumU64>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.EnumU64>( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU64 v) => v.ToString(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, CompiledModelTestBase.EnumU64>( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.EnumU64>( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU64 v) => v.ToString(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))), elementMapping: SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), converter: new ValueConverter( - (CompiledModelTestBase.EnumU64 v) => v.ToString(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU64 v) => v.ToString(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))); enumU64AsStringCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU64AsStringCollection", "TestNamespace") }); @@ -4468,35 +4938,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU64Collection.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU64Collection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU64Collection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(enumU64Collection, 75), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(enumU64Collection, 80), (InternalEntityEntry entry) => entry.GetCurrentValue>(enumU64Collection), - (ValueBuffer valueBuffer) => valueBuffer[75]); + (ValueBuffer valueBuffer) => valueBuffer[80]); enumU64Collection.SetPropertyIndexes( - index: 75, - originalValueIndex: 75, + index: 80, + originalValueIndex: 80, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enumU64Collection.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer, CompiledModelTestBase.EnumU64>(new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer, CompiledModelTestBase.EnumU64>(new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, CompiledModelTestBase.EnumU64>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.EnumU64>( new JsonConvertedValueReaderWriter( JsonUInt64ReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.EnumU64 value) => (ulong)value, (ulong value) => (CompiledModelTestBase.EnumU64)value)))), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, CompiledModelTestBase.EnumU64>( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.EnumU64>( new JsonConvertedValueReaderWriter( JsonUInt64ReaderWriter.Instance, new ValueConverter( @@ -4505,15 +4975,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqliteULongTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), providerValueComparer: new ValueComparer( (ulong v1, ulong v2) => v1 == v2, - (ulong v) => v.GetHashCode(), + (ulong v) => ((object)v).GetHashCode(), (ulong v) => v), converter: new ValueConverter( (CompiledModelTestBase.EnumU64 value) => (ulong)value, @@ -4525,6 +4995,107 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (ulong value) => (CompiledModelTestBase.EnumU64)value)))); enumU64Collection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU64Collection", "TestNamespace") }); + var enumU64NestedCollection = runtimeEntityType.AddProperty( + "EnumU64NestedCollection", + typeof(CompiledModelTestBase.EnumU64[][]), + propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("EnumU64NestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + enumU64NestedCollection.SetGetter( + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU64NestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU64NestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU64NestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU64NestedCollection(instance) == null); + enumU64NestedCollection.SetSetter( + (CompiledModelTestBase.ManyTypes entity, CompiledModelTestBase.EnumU64[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU64NestedCollection(entity) = value); + enumU64NestedCollection.SetMaterializationSetter( + (CompiledModelTestBase.ManyTypes entity, CompiledModelTestBase.EnumU64[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU64NestedCollection(entity) = value); + enumU64NestedCollection.SetAccessors( + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU64NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU64NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => entry.ReadOriginalValue(enumU64NestedCollection, 81), + (InternalEntityEntry entry) => entry.GetCurrentValue(enumU64NestedCollection), + (ValueBuffer valueBuffer) => valueBuffer[81]); + enumU64NestedCollection.SetPropertyIndexes( + index: 81, + originalValueIndex: 81, + shadowIndex: -1, + relationshipIndex: -1, + storeGenerationIndex: -1); + enumU64NestedCollection.TypeMapping = SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfReferenceTypesComparer(new ListOfValueTypesComparer(new ValueComparer( + (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => v))), + keyComparer: new ListOfReferenceTypesComparer(new ListOfValueTypesComparer(new ValueComparer( + (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => v))), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfStructsReaderWriter( + new JsonConvertedValueReaderWriter( + JsonUInt64ReaderWriter.Instance, + new ValueConverter( + (CompiledModelTestBase.EnumU64 value) => (ulong)value, + (ulong value) => (CompiledModelTestBase.EnumU64)value))))), + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfStructsReaderWriter( + new JsonConvertedValueReaderWriter( + JsonUInt64ReaderWriter.Instance, + new ValueConverter( + (CompiledModelTestBase.EnumU64 value) => (ulong)value, + (ulong value) => (CompiledModelTestBase.EnumU64)value)))), + elementMapping: SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfValueTypesComparer(new ValueComparer( + (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => v)), + keyComparer: new ListOfValueTypesComparer(new ValueComparer( + (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => v)), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( + new JsonConvertedValueReaderWriter( + JsonUInt64ReaderWriter.Instance, + new ValueConverter( + (CompiledModelTestBase.EnumU64 value) => (ulong)value, + (ulong value) => (CompiledModelTestBase.EnumU64)value)))), + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( + new JsonConvertedValueReaderWriter( + JsonUInt64ReaderWriter.Instance, + new ValueConverter( + (CompiledModelTestBase.EnumU64 value) => (ulong)value, + (ulong value) => (CompiledModelTestBase.EnumU64)value))), + elementMapping: SqliteULongTypeMapping.Default.Clone( + comparer: new ValueComparer( + (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => v), + keyComparer: new ValueComparer( + (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => v), + providerValueComparer: new ValueComparer( + (ulong v1, ulong v2) => v1 == v2, + (ulong v) => ((object)v).GetHashCode(), + (ulong v) => v), + converter: new ValueConverter( + (CompiledModelTestBase.EnumU64 value) => (ulong)value, + (ulong value) => (CompiledModelTestBase.EnumU64)value), + jsonValueReaderWriter: new JsonConvertedValueReaderWriter( + JsonUInt64ReaderWriter.Instance, + new ValueConverter( + (CompiledModelTestBase.EnumU64 value) => (ulong)value, + (ulong value) => (CompiledModelTestBase.EnumU64)value))))); + enumU64NestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU64NestedCollection", "TestNamespace") }); + var enumU8 = runtimeEntityType.AddProperty( "EnumU8", typeof(CompiledModelTestBase.EnumU8), @@ -4542,23 +5113,23 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU8.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU8((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU8((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(enumU8, 76), + (InternalEntityEntry entry) => entry.ReadOriginalValue(enumU8, 82), (InternalEntityEntry entry) => entry.GetCurrentValue(enumU8), - (ValueBuffer valueBuffer) => valueBuffer[76]); + (ValueBuffer valueBuffer) => valueBuffer[82]); enumU8.SetPropertyIndexes( - index: 76, - originalValueIndex: 76, + index: 82, + originalValueIndex: 82, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enumU8.TypeMapping = ByteTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v), providerValueComparer: new ValueComparer( (byte v1, byte v2) => v1 == v2, @@ -4594,35 +5165,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU8Array.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU8Array((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU8Array((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(enumU8Array, 77), + (InternalEntityEntry entry) => entry.ReadOriginalValue(enumU8Array, 83), (InternalEntityEntry entry) => entry.GetCurrentValue(enumU8Array), - (ValueBuffer valueBuffer) => valueBuffer[77]); + (ValueBuffer valueBuffer) => valueBuffer[83]); enumU8Array.SetPropertyIndexes( - index: 77, - originalValueIndex: 77, + index: 83, + originalValueIndex: 83, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enumU8Array.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonByteReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.EnumU8 value) => (byte)value, (byte value) => (CompiledModelTestBase.EnumU8)value)))), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonByteReaderWriter.Instance, new ValueConverter( @@ -4631,11 +5202,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: ByteTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v), providerValueComparer: new ValueComparer( (byte v1, byte v2) => v1 == v2, @@ -4671,35 +5242,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU8AsString.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU8AsString((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU8AsString((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(enumU8AsString, 78), + (InternalEntityEntry entry) => entry.ReadOriginalValue(enumU8AsString, 84), (InternalEntityEntry entry) => entry.GetCurrentValue(enumU8AsString), - (ValueBuffer valueBuffer) => valueBuffer[78]); + (ValueBuffer valueBuffer) => valueBuffer[84]); enumU8AsString.SetPropertyIndexes( - index: 78, - originalValueIndex: 78, + index: 84, + originalValueIndex: 84, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enumU8AsString.TypeMapping = SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), converter: new ValueConverter( - (CompiledModelTestBase.EnumU8 v) => v.ToString(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU8 v) => v.ToString(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))); enumU8AsString.SetSentinelFromProviderValue("Min"); enumU8AsString.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU8AsString", "TestNamespace") }); @@ -4721,60 +5292,60 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU8AsStringArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU8AsStringArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU8AsStringArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(enumU8AsStringArray, 79), + (InternalEntityEntry entry) => entry.ReadOriginalValue(enumU8AsStringArray, 85), (InternalEntityEntry entry) => entry.GetCurrentValue(enumU8AsStringArray), - (ValueBuffer valueBuffer) => valueBuffer[79]); + (ValueBuffer valueBuffer) => valueBuffer[85]); enumU8AsStringArray.SetPropertyIndexes( - index: 79, - originalValueIndex: 79, + index: 85, + originalValueIndex: 85, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enumU8AsStringArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer(new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU8 v) => v.ToString(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU8 v) => v.ToString(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))), elementMapping: SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), converter: new ValueConverter( - (CompiledModelTestBase.EnumU8 v) => v.ToString(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU8 v) => v.ToString(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))); enumU8AsStringArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU8AsStringArray", "TestNamespace") }); @@ -4795,60 +5366,60 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU8AsStringCollection.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU8AsStringCollection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU8AsStringCollection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(enumU8AsStringCollection, 80), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(enumU8AsStringCollection, 86), (InternalEntityEntry entry) => entry.GetCurrentValue>(enumU8AsStringCollection), - (ValueBuffer valueBuffer) => valueBuffer[80]); + (ValueBuffer valueBuffer) => valueBuffer[86]); enumU8AsStringCollection.SetPropertyIndexes( - index: 80, - originalValueIndex: 80, + index: 86, + originalValueIndex: 86, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enumU8AsStringCollection.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer, CompiledModelTestBase.EnumU8>(new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer, CompiledModelTestBase.EnumU8>(new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, CompiledModelTestBase.EnumU8>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.EnumU8>( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU8 v) => v.ToString(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, CompiledModelTestBase.EnumU8>( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.EnumU8>( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU8 v) => v.ToString(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)))), elementMapping: SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), converter: new ValueConverter( - (CompiledModelTestBase.EnumU8 v) => v.ToString(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (CompiledModelTestBase.EnumU8 v) => v.ToString(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).ToString(), (string v) => StringEnumConverter.ConvertToEnum(v))))); enumU8AsStringCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU8AsStringCollection", "TestNamespace") }); @@ -4869,35 +5440,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enumU8Collection.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU8Collection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU8Collection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(enumU8Collection, 81), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(enumU8Collection, 87), (InternalEntityEntry entry) => entry.GetCurrentValue>(enumU8Collection), - (ValueBuffer valueBuffer) => valueBuffer[81]); + (ValueBuffer valueBuffer) => valueBuffer[87]); enumU8Collection.SetPropertyIndexes( - index: 81, - originalValueIndex: 81, + index: 87, + originalValueIndex: 87, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); enumU8Collection.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer, CompiledModelTestBase.EnumU8>(new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer, CompiledModelTestBase.EnumU8>(new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, CompiledModelTestBase.EnumU8>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.EnumU8>( new JsonConvertedValueReaderWriter( JsonByteReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.EnumU8 value) => (byte)value, (byte value) => (CompiledModelTestBase.EnumU8)value)))), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, CompiledModelTestBase.EnumU8>( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, CompiledModelTestBase.EnumU8>( new JsonConvertedValueReaderWriter( JsonByteReaderWriter.Instance, new ValueConverter( @@ -4906,11 +5477,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: ByteTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v), providerValueComparer: new ValueComparer( (byte v1, byte v2) => v1 == v2, @@ -4946,27 +5517,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas @float.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Float((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Float((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(@float, 82), + (InternalEntityEntry entry) => entry.ReadOriginalValue(@float, 88), (InternalEntityEntry entry) => entry.GetCurrentValue(@float), - (ValueBuffer valueBuffer) => valueBuffer[82]); + (ValueBuffer valueBuffer) => valueBuffer[88]); @float.SetPropertyIndexes( - index: 82, - originalValueIndex: 82, + index: 88, + originalValueIndex: 88, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); @float.TypeMapping = FloatTypeMapping.Default.Clone( comparer: new ValueComparer( (float v1, float v2) => v1.Equals(v2), - (float v) => v.GetHashCode(), + (float v) => ((object)v).GetHashCode(), (float v) => v), keyComparer: new ValueComparer( (float v1, float v2) => v1.Equals(v2), - (float v) => v.GetHashCode(), + (float v) => ((object)v).GetHashCode(), (float v) => v), providerValueComparer: new ValueComparer( (float v1, float v2) => v1.Equals(v2), - (float v) => v.GetHashCode(), + (float v) => ((object)v).GetHashCode(), (float v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "REAL")); @@ -4989,44 +5560,44 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas floatArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_FloatArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_FloatArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(floatArray, 83), + (InternalEntityEntry entry) => entry.ReadOriginalValue(floatArray, 89), (InternalEntityEntry entry) => entry.GetCurrentValue(floatArray), - (ValueBuffer valueBuffer) => valueBuffer[83]); + (ValueBuffer valueBuffer) => valueBuffer[89]); floatArray.SetPropertyIndexes( - index: 83, - originalValueIndex: 83, + index: 89, + originalValueIndex: 89, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); floatArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer(new ValueComparer( (float v1, float v2) => v1.Equals(v2), - (float v) => v.GetHashCode(), + (float v) => ((object)v).GetHashCode(), (float v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer(new ValueComparer( (float v1, float v2) => v1.Equals(v2), - (float v) => v.GetHashCode(), + (float v) => ((object)v).GetHashCode(), (float v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( JsonFloatReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( JsonFloatReaderWriter.Instance), elementMapping: FloatTypeMapping.Default.Clone( comparer: new ValueComparer( (float v1, float v2) => v1.Equals(v2), - (float v) => v.GetHashCode(), + (float v) => ((object)v).GetHashCode(), (float v) => v), keyComparer: new ValueComparer( (float v1, float v2) => v1.Equals(v2), - (float v) => v.GetHashCode(), + (float v) => ((object)v).GetHashCode(), (float v) => v), providerValueComparer: new ValueComparer( (float v1, float v2) => v1.Equals(v2), - (float v) => v.GetHashCode(), + (float v) => ((object)v).GetHashCode(), (float v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "REAL"))); @@ -5050,12 +5621,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas guid.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Guid((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Guid((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(guid, 84), + (InternalEntityEntry entry) => entry.ReadOriginalValue(guid, 90), (InternalEntityEntry entry) => entry.GetCurrentValue(guid), - (ValueBuffer valueBuffer) => valueBuffer[84]); + (ValueBuffer valueBuffer) => valueBuffer[90]); guid.SetPropertyIndexes( - index: 84, - originalValueIndex: 84, + index: 90, + originalValueIndex: 90, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); @@ -5079,35 +5650,121 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas guidArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_GuidArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_GuidArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(guidArray, 85), + (InternalEntityEntry entry) => entry.ReadOriginalValue(guidArray, 91), (InternalEntityEntry entry) => entry.GetCurrentValue(guidArray), - (ValueBuffer valueBuffer) => valueBuffer[85]); + (ValueBuffer valueBuffer) => valueBuffer[91]); guidArray.SetPropertyIndexes( - index: 85, - originalValueIndex: 85, + index: 91, + originalValueIndex: 91, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); guidArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer(new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer(new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( SqliteJsonGuidReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( SqliteJsonGuidReaderWriter.Instance), elementMapping: SqliteGuidTypeMapping.Default); guidArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_GuidArray", "TestNamespace") }); + var guidNestedCollection = runtimeEntityType.AddProperty( + "GuidNestedCollection", + typeof(ICollection), + propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("GuidNestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + guidNestedCollection.SetGetter( + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_GuidNestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_GuidNestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_GuidNestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_GuidNestedCollection(instance) == null); + guidNestedCollection.SetSetter( + (CompiledModelTestBase.ManyTypes entity, ICollection value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_GuidNestedCollection(entity) = value); + guidNestedCollection.SetMaterializationSetter( + (CompiledModelTestBase.ManyTypes entity, ICollection value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_GuidNestedCollection(entity) = value); + guidNestedCollection.SetAccessors( + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_GuidNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_GuidNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(guidNestedCollection, 92), + (InternalEntityEntry entry) => entry.GetCurrentValue>(guidNestedCollection), + (ValueBuffer valueBuffer) => valueBuffer[92]); + guidNestedCollection.SetPropertyIndexes( + index: 92, + originalValueIndex: 92, + shadowIndex: -1, + relationshipIndex: -1, + storeGenerationIndex: -1); + guidNestedCollection.TypeMapping = SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfReferenceTypesComparer, Guid[][]>(new ListOfReferenceTypesComparer(new ListOfValueTypesComparer(new ValueComparer( + (Guid v1, Guid v2) => v1 == v2, + (Guid v) => ((object)v).GetHashCode(), + (Guid v) => v)))), + keyComparer: new ListOfReferenceTypesComparer, Guid[][]>(new ListOfReferenceTypesComparer(new ListOfValueTypesComparer(new ValueComparer( + (Guid v1, Guid v2) => v1 == v2, + (Guid v) => ((object)v).GetHashCode(), + (Guid v) => v)))), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter, Guid[][]>( + new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfStructsReaderWriter( + SqliteJsonGuidReaderWriter.Instance)))), + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter, Guid[][]>( + new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfStructsReaderWriter( + SqliteJsonGuidReaderWriter.Instance))), + elementMapping: SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfReferenceTypesComparer(new ListOfValueTypesComparer(new ValueComparer( + (Guid v1, Guid v2) => v1 == v2, + (Guid v) => ((object)v).GetHashCode(), + (Guid v) => v))), + keyComparer: new ListOfReferenceTypesComparer(new ListOfValueTypesComparer(new ValueComparer( + (Guid v1, Guid v2) => v1 == v2, + (Guid v) => ((object)v).GetHashCode(), + (Guid v) => v))), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfStructsReaderWriter( + SqliteJsonGuidReaderWriter.Instance))), + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfStructsReaderWriter( + SqliteJsonGuidReaderWriter.Instance)), + elementMapping: SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfValueTypesComparer(new ValueComparer( + (Guid v1, Guid v2) => v1 == v2, + (Guid v) => ((object)v).GetHashCode(), + (Guid v) => v)), + keyComparer: new ListOfValueTypesComparer(new ValueComparer( + (Guid v1, Guid v2) => v1 == v2, + (Guid v) => ((object)v).GetHashCode(), + (Guid v) => v)), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( + SqliteJsonGuidReaderWriter.Instance)), + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( + SqliteJsonGuidReaderWriter.Instance), + elementMapping: SqliteGuidTypeMapping.Default))); + guidNestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_GuidNestedCollection", "TestNamespace") }); + var guidToBytesConverterProperty = runtimeEntityType.AddProperty( "GuidToBytesConverterProperty", typeof(Guid), @@ -5126,23 +5783,23 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas guidToBytesConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_GuidToBytesConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_GuidToBytesConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(guidToBytesConverterProperty, 86), + (InternalEntityEntry entry) => entry.ReadOriginalValue(guidToBytesConverterProperty, 93), (InternalEntityEntry entry) => entry.GetCurrentValue(guidToBytesConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[86]); + (ValueBuffer valueBuffer) => valueBuffer[93]); guidToBytesConverterProperty.SetPropertyIndexes( - index: 86, - originalValueIndex: 86, + index: 93, + originalValueIndex: 93, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); guidToBytesConverterProperty.TypeMapping = SqliteByteArrayTypeMapping.Default.Clone( comparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), keyComparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), providerValueComparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), @@ -5179,27 +5836,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas guidToStringConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_GuidToStringConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_GuidToStringConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(guidToStringConverterProperty, 87), + (InternalEntityEntry entry) => entry.ReadOriginalValue(guidToStringConverterProperty, 94), (InternalEntityEntry entry) => entry.GetCurrentValue(guidToStringConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[87]); + (ValueBuffer valueBuffer) => valueBuffer[94]); guidToStringConverterProperty.SetPropertyIndexes( - index: 87, - originalValueIndex: 87, + index: 94, + originalValueIndex: 94, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); guidToStringConverterProperty.TypeMapping = SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), keyComparer: new ValueComparer( (Guid v1, Guid v2) => v1 == v2, - (Guid v) => v.GetHashCode(), + (Guid v) => ((object)v).GetHashCode(), (Guid v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( size: 36), @@ -5231,37 +5888,37 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas iPAddress.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_IPAddress((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_IPAddress((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(iPAddress, 88), + (InternalEntityEntry entry) => entry.ReadOriginalValue(iPAddress, 95), (InternalEntityEntry entry) => entry.GetCurrentValue(iPAddress), - (ValueBuffer valueBuffer) => valueBuffer[88]); + (ValueBuffer valueBuffer) => valueBuffer[95]); iPAddress.SetPropertyIndexes( - index: 88, - originalValueIndex: 88, + index: 95, + originalValueIndex: 95, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); iPAddress.TypeMapping = SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), keyComparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( size: 45), converter: new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)))); iPAddress.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_IPAddress", "TestNamespace") }); @@ -5282,62 +5939,62 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas iPAddressArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_IPAddressArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_IPAddressArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(iPAddressArray, 89), + (InternalEntityEntry entry) => entry.ReadOriginalValue(iPAddressArray, 96), (InternalEntityEntry entry) => entry.GetCurrentValue(iPAddressArray), - (ValueBuffer valueBuffer) => valueBuffer[89]); + (ValueBuffer valueBuffer) => valueBuffer[96]); iPAddressArray.SetPropertyIndexes( - index: 89, - originalValueIndex: 89, + index: 96, + originalValueIndex: 96, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); iPAddressArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfReferenceTypesComparer(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)))), elementMapping: SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), keyComparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( size: 45), converter: new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))); iPAddressArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_IPAddressArray", "TestNamespace") }); @@ -5359,23 +6016,23 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas iPAddressToBytesConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_IPAddressToBytesConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_IPAddressToBytesConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(iPAddressToBytesConverterProperty, 90), + (InternalEntityEntry entry) => entry.ReadOriginalValue(iPAddressToBytesConverterProperty, 97), (InternalEntityEntry entry) => entry.GetCurrentValue(iPAddressToBytesConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[90]); + (ValueBuffer valueBuffer) => valueBuffer[97]); iPAddressToBytesConverterProperty.SetPropertyIndexes( - index: 90, - originalValueIndex: 90, + index: 97, + originalValueIndex: 97, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); iPAddressToBytesConverterProperty.TypeMapping = SqliteByteArrayTypeMapping.Default.Clone( comparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), keyComparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), providerValueComparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), @@ -5411,37 +6068,37 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas iPAddressToStringConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_IPAddressToStringConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_IPAddressToStringConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(iPAddressToStringConverterProperty, 91), + (InternalEntityEntry entry) => entry.ReadOriginalValue(iPAddressToStringConverterProperty, 98), (InternalEntityEntry entry) => entry.GetCurrentValue(iPAddressToStringConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[91]); + (ValueBuffer valueBuffer) => valueBuffer[98]); iPAddressToStringConverterProperty.SetPropertyIndexes( - index: 91, - originalValueIndex: 91, + index: 98, + originalValueIndex: 98, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); iPAddressToStringConverterProperty.TypeMapping = SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), keyComparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( size: 45), converter: new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)))); iPAddressToStringConverterProperty.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_IPAddressToStringConverterProperty", "TestNamespace") }); @@ -5463,12 +6120,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas int16.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int16((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int16((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(int16, 92), + (InternalEntityEntry entry) => entry.ReadOriginalValue(int16, 99), (InternalEntityEntry entry) => entry.GetCurrentValue(int16), - (ValueBuffer valueBuffer) => valueBuffer[92]); + (ValueBuffer valueBuffer) => valueBuffer[99]); int16.SetPropertyIndexes( - index: 92, - originalValueIndex: 92, + index: 99, + originalValueIndex: 99, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); @@ -5506,31 +6163,31 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas int16Array.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int16Array((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int16Array((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(int16Array, 93), + (InternalEntityEntry entry) => entry.ReadOriginalValue(int16Array, 100), (InternalEntityEntry entry) => entry.GetCurrentValue(int16Array), - (ValueBuffer valueBuffer) => valueBuffer[93]); + (ValueBuffer valueBuffer) => valueBuffer[100]); int16Array.SetPropertyIndexes( - index: 93, - originalValueIndex: 93, + index: 100, + originalValueIndex: 100, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); int16Array.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer(new ValueComparer( (short v1, short v2) => v1 == v2, (short v) => (int)v, (short v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer(new ValueComparer( (short v1, short v2) => v1 == v2, (short v) => (int)v, (short v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( JsonInt16ReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( JsonInt16ReaderWriter.Instance), elementMapping: ShortTypeMapping.Default.Clone( comparer: new ValueComparer( @@ -5567,12 +6224,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas int32.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int32((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int32((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(int32, 94), + (InternalEntityEntry entry) => entry.ReadOriginalValue(int32, 101), (InternalEntityEntry entry) => entry.GetCurrentValue(int32), - (ValueBuffer valueBuffer) => valueBuffer[94]); + (ValueBuffer valueBuffer) => valueBuffer[101]); int32.SetPropertyIndexes( - index: 94, - originalValueIndex: 94, + index: 101, + originalValueIndex: 101, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); @@ -5610,31 +6267,31 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas int32Array.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int32Array((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int32Array((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(int32Array, 95), + (InternalEntityEntry entry) => entry.ReadOriginalValue(int32Array, 102), (InternalEntityEntry entry) => entry.GetCurrentValue(int32Array), - (ValueBuffer valueBuffer) => valueBuffer[95]); + (ValueBuffer valueBuffer) => valueBuffer[102]); int32Array.SetPropertyIndexes( - index: 95, - originalValueIndex: 95, + index: 102, + originalValueIndex: 102, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); int32Array.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer(new ValueComparer( (int v1, int v2) => v1 == v2, (int v) => v, (int v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer(new ValueComparer( (int v1, int v2) => v1 == v2, (int v) => v, (int v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( JsonInt32ReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( JsonInt32ReaderWriter.Instance), elementMapping: IntTypeMapping.Default.Clone( comparer: new ValueComparer( @@ -5653,6 +6310,85 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas storeTypeName: "INTEGER"))); int32Array.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int32Array", "TestNamespace") }); + var int32NestedCollection = runtimeEntityType.AddProperty( + "Int32NestedCollection", + typeof(int[][]), + propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("Int32NestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + int32NestedCollection.SetGetter( + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int32NestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int32NestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int32NestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int32NestedCollection(instance) == null); + int32NestedCollection.SetSetter( + (CompiledModelTestBase.ManyTypes entity, int[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int32NestedCollection(entity) = value); + int32NestedCollection.SetMaterializationSetter( + (CompiledModelTestBase.ManyTypes entity, int[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int32NestedCollection(entity) = value); + int32NestedCollection.SetAccessors( + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int32NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int32NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => entry.ReadOriginalValue(int32NestedCollection, 103), + (InternalEntityEntry entry) => entry.GetCurrentValue(int32NestedCollection), + (ValueBuffer valueBuffer) => valueBuffer[103]); + int32NestedCollection.SetPropertyIndexes( + index: 103, + originalValueIndex: 103, + shadowIndex: -1, + relationshipIndex: -1, + storeGenerationIndex: -1); + int32NestedCollection.TypeMapping = SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfReferenceTypesComparer(new ListOfValueTypesComparer(new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v))), + keyComparer: new ListOfReferenceTypesComparer(new ListOfValueTypesComparer(new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v))), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfStructsReaderWriter( + JsonInt32ReaderWriter.Instance))), + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfStructsReaderWriter( + JsonInt32ReaderWriter.Instance)), + elementMapping: SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfValueTypesComparer(new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)), + keyComparer: new ListOfValueTypesComparer(new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v)), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( + JsonInt32ReaderWriter.Instance)), + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( + JsonInt32ReaderWriter.Instance), + elementMapping: IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "INTEGER")))); + int32NestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int32NestedCollection", "TestNamespace") }); + var int64 = runtimeEntityType.AddProperty( "Int64", typeof(long), @@ -5671,27 +6407,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas int64.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int64((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int64((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(int64, 96), + (InternalEntityEntry entry) => entry.ReadOriginalValue(int64, 104), (InternalEntityEntry entry) => entry.GetCurrentValue(int64), - (ValueBuffer valueBuffer) => valueBuffer[96]); + (ValueBuffer valueBuffer) => valueBuffer[104]); int64.SetPropertyIndexes( - index: 96, - originalValueIndex: 96, + index: 104, + originalValueIndex: 104, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); int64.TypeMapping = LongTypeMapping.Default.Clone( comparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), keyComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "INTEGER")); @@ -5714,49 +6450,149 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas int64Array.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int64Array((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int64Array((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(int64Array, 97), + (InternalEntityEntry entry) => entry.ReadOriginalValue(int64Array, 105), (InternalEntityEntry entry) => entry.GetCurrentValue(int64Array), - (ValueBuffer valueBuffer) => valueBuffer[97]); + (ValueBuffer valueBuffer) => valueBuffer[105]); int64Array.SetPropertyIndexes( - index: 97, - originalValueIndex: 97, + index: 105, + originalValueIndex: 105, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); int64Array.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer(new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer(new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( JsonInt64ReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( JsonInt64ReaderWriter.Instance), elementMapping: LongTypeMapping.Default.Clone( comparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), keyComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "INTEGER"))); int64Array.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int64Array", "TestNamespace") }); + var int64NestedCollection = runtimeEntityType.AddProperty( + "Int64NestedCollection", + typeof(IList[]), + propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("Int64NestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + int64NestedCollection.SetGetter( + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int64NestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int64NestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int64NestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int64NestedCollection(instance) == null); + int64NestedCollection.SetSetter( + (CompiledModelTestBase.ManyTypes entity, IList[] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int64NestedCollection(entity) = value); + int64NestedCollection.SetMaterializationSetter( + (CompiledModelTestBase.ManyTypes entity, IList[] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int64NestedCollection(entity) = value); + int64NestedCollection.SetAccessors( + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int64NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int64NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(int64NestedCollection, 106), + (InternalEntityEntry entry) => entry.GetCurrentValue[]>(int64NestedCollection), + (ValueBuffer valueBuffer) => valueBuffer[106]); + int64NestedCollection.SetPropertyIndexes( + index: 106, + originalValueIndex: 106, + shadowIndex: -1, + relationshipIndex: -1, + storeGenerationIndex: -1); + int64NestedCollection.TypeMapping = SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfReferenceTypesComparer[], IList>(new ListOfReferenceTypesComparer, long[]>(new ListOfValueTypesComparer(new ValueComparer( + (long v1, long v2) => v1 == v2, + (long v) => ((object)v).GetHashCode(), + (long v) => v)))), + keyComparer: new ListOfReferenceTypesComparer[], IList>(new ListOfReferenceTypesComparer, long[]>(new ListOfValueTypesComparer(new ValueComparer( + (long v1, long v2) => v1 == v2, + (long v) => ((object)v).GetHashCode(), + (long v) => v)))), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter>(new JsonCollectionOfReferencesReaderWriter[], IList>( + new JsonCollectionOfReferencesReaderWriter, long[]>( + new JsonCollectionOfStructsReaderWriter( + JsonInt64ReaderWriter.Instance)))), + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter[], IList>( + new JsonCollectionOfReferencesReaderWriter, long[]>( + new JsonCollectionOfStructsReaderWriter( + JsonInt64ReaderWriter.Instance))), + elementMapping: SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfReferenceTypesComparer, long[]>(new ListOfValueTypesComparer(new ValueComparer( + (long v1, long v2) => v1 == v2, + (long v) => ((object)v).GetHashCode(), + (long v) => v))), + keyComparer: new ListOfReferenceTypesComparer, long[]>(new ListOfValueTypesComparer(new ValueComparer( + (long v1, long v2) => v1 == v2, + (long v) => ((object)v).GetHashCode(), + (long v) => v))), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter, long[]>( + new JsonCollectionOfStructsReaderWriter( + JsonInt64ReaderWriter.Instance))), + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter, long[]>( + new JsonCollectionOfStructsReaderWriter( + JsonInt64ReaderWriter.Instance)), + elementMapping: SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfValueTypesComparer(new ValueComparer( + (long v1, long v2) => v1 == v2, + (long v) => ((object)v).GetHashCode(), + (long v) => v)), + keyComparer: new ListOfValueTypesComparer(new ValueComparer( + (long v1, long v2) => v1 == v2, + (long v) => ((object)v).GetHashCode(), + (long v) => v)), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( + JsonInt64ReaderWriter.Instance)), + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( + JsonInt64ReaderWriter.Instance), + elementMapping: LongTypeMapping.Default.Clone( + comparer: new ValueComparer( + (long v1, long v2) => v1 == v2, + (long v) => ((object)v).GetHashCode(), + (long v) => v), + keyComparer: new ValueComparer( + (long v1, long v2) => v1 == v2, + (long v) => ((object)v).GetHashCode(), + (long v) => v), + providerValueComparer: new ValueComparer( + (long v1, long v2) => v1 == v2, + (long v) => ((object)v).GetHashCode(), + (long v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "INTEGER"))))); + int64NestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int64NestedCollection", "TestNamespace") }); + var int8 = runtimeEntityType.AddProperty( "Int8", typeof(sbyte), @@ -5775,12 +6611,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas int8.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int8((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int8((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(int8, 98), + (InternalEntityEntry entry) => entry.ReadOriginalValue(int8, 107), (InternalEntityEntry entry) => entry.GetCurrentValue(int8), - (ValueBuffer valueBuffer) => valueBuffer[98]); + (ValueBuffer valueBuffer) => valueBuffer[107]); int8.SetPropertyIndexes( - index: 98, - originalValueIndex: 98, + index: 107, + originalValueIndex: 107, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); @@ -5818,31 +6654,31 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas int8Array.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int8Array((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int8Array((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(int8Array, 99), + (InternalEntityEntry entry) => entry.ReadOriginalValue(int8Array, 108), (InternalEntityEntry entry) => entry.GetCurrentValue(int8Array), - (ValueBuffer valueBuffer) => valueBuffer[99]); + (ValueBuffer valueBuffer) => valueBuffer[108]); int8Array.SetPropertyIndexes( - index: 99, - originalValueIndex: 99, + index: 108, + originalValueIndex: 108, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); int8Array.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer(new ValueComparer( (sbyte v1, sbyte v2) => v1 == v2, (sbyte v) => (int)v, (sbyte v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer(new ValueComparer( (sbyte v1, sbyte v2) => v1 == v2, (sbyte v) => (int)v, (sbyte v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( JsonSByteReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( JsonSByteReaderWriter.Instance), elementMapping: SByteTypeMapping.Default.Clone( comparer: new ValueComparer( @@ -5861,30 +6697,130 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas storeTypeName: "INTEGER"))); int8Array.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int8Array", "TestNamespace") }); - var intNumberToBytesConverterProperty = runtimeEntityType.AddProperty( - "IntNumberToBytesConverterProperty", - typeof(int), - propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("IntNumberToBytesConverterProperty", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), - fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), - valueConverter: new NumberToBytesConverter()); - intNumberToBytesConverterProperty.SetGetter( - (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_IntNumberToBytesConverterProperty(entity), - (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_IntNumberToBytesConverterProperty(entity) == 0, - (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_IntNumberToBytesConverterProperty(instance), - (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_IntNumberToBytesConverterProperty(instance) == 0); - intNumberToBytesConverterProperty.SetSetter( - (CompiledModelTestBase.ManyTypes entity, int value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_IntNumberToBytesConverterProperty(entity) = value); - intNumberToBytesConverterProperty.SetMaterializationSetter( - (CompiledModelTestBase.ManyTypes entity, int value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_IntNumberToBytesConverterProperty(entity) = value); - intNumberToBytesConverterProperty.SetAccessors( + var int8NestedCollection = runtimeEntityType.AddProperty( + "Int8NestedCollection", + typeof(sbyte[][][]), + propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("Int8NestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + int8NestedCollection.SetGetter( + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int8NestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int8NestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int8NestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int8NestedCollection(instance) == null); + int8NestedCollection.SetSetter( + (CompiledModelTestBase.ManyTypes entity, sbyte[][][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int8NestedCollection(entity) = value); + int8NestedCollection.SetMaterializationSetter( + (CompiledModelTestBase.ManyTypes entity, sbyte[][][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int8NestedCollection(entity) = value); + int8NestedCollection.SetAccessors( + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int8NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int8NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => entry.ReadOriginalValue(int8NestedCollection, 109), + (InternalEntityEntry entry) => entry.GetCurrentValue(int8NestedCollection), + (ValueBuffer valueBuffer) => valueBuffer[109]); + int8NestedCollection.SetPropertyIndexes( + index: 109, + originalValueIndex: 109, + shadowIndex: -1, + relationshipIndex: -1, + storeGenerationIndex: -1); + int8NestedCollection.TypeMapping = SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfReferenceTypesComparer(new ListOfReferenceTypesComparer(new ListOfValueTypesComparer(new ValueComparer( + (sbyte v1, sbyte v2) => v1 == v2, + (sbyte v) => (int)v, + (sbyte v) => v)))), + keyComparer: new ListOfReferenceTypesComparer(new ListOfReferenceTypesComparer(new ListOfValueTypesComparer(new ValueComparer( + (sbyte v1, sbyte v2) => v1 == v2, + (sbyte v) => (int)v, + (sbyte v) => v)))), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfStructsReaderWriter( + JsonSByteReaderWriter.Instance)))), + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfStructsReaderWriter( + JsonSByteReaderWriter.Instance))), + elementMapping: SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfReferenceTypesComparer(new ListOfValueTypesComparer(new ValueComparer( + (sbyte v1, sbyte v2) => v1 == v2, + (sbyte v) => (int)v, + (sbyte v) => v))), + keyComparer: new ListOfReferenceTypesComparer(new ListOfValueTypesComparer(new ValueComparer( + (sbyte v1, sbyte v2) => v1 == v2, + (sbyte v) => (int)v, + (sbyte v) => v))), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfStructsReaderWriter( + JsonSByteReaderWriter.Instance))), + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfStructsReaderWriter( + JsonSByteReaderWriter.Instance)), + elementMapping: SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfValueTypesComparer(new ValueComparer( + (sbyte v1, sbyte v2) => v1 == v2, + (sbyte v) => (int)v, + (sbyte v) => v)), + keyComparer: new ListOfValueTypesComparer(new ValueComparer( + (sbyte v1, sbyte v2) => v1 == v2, + (sbyte v) => (int)v, + (sbyte v) => v)), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( + JsonSByteReaderWriter.Instance)), + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( + JsonSByteReaderWriter.Instance), + elementMapping: SByteTypeMapping.Default.Clone( + comparer: new ValueComparer( + (sbyte v1, sbyte v2) => v1 == v2, + (sbyte v) => (int)v, + (sbyte v) => v), + keyComparer: new ValueComparer( + (sbyte v1, sbyte v2) => v1 == v2, + (sbyte v) => (int)v, + (sbyte v) => v), + providerValueComparer: new ValueComparer( + (sbyte v1, sbyte v2) => v1 == v2, + (sbyte v) => (int)v, + (sbyte v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "INTEGER"))))); + int8NestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int8NestedCollection", "TestNamespace") }); + + var intNumberToBytesConverterProperty = runtimeEntityType.AddProperty( + "IntNumberToBytesConverterProperty", + typeof(int), + propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("IntNumberToBytesConverterProperty", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly), + valueConverter: new NumberToBytesConverter()); + intNumberToBytesConverterProperty.SetGetter( + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_IntNumberToBytesConverterProperty(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_IntNumberToBytesConverterProperty(entity) == 0, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_IntNumberToBytesConverterProperty(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_IntNumberToBytesConverterProperty(instance) == 0); + intNumberToBytesConverterProperty.SetSetter( + (CompiledModelTestBase.ManyTypes entity, int value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_IntNumberToBytesConverterProperty(entity) = value); + intNumberToBytesConverterProperty.SetMaterializationSetter( + (CompiledModelTestBase.ManyTypes entity, int value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_IntNumberToBytesConverterProperty(entity) = value); + intNumberToBytesConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_IntNumberToBytesConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_IntNumberToBytesConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(intNumberToBytesConverterProperty, 100), + (InternalEntityEntry entry) => entry.ReadOriginalValue(intNumberToBytesConverterProperty, 110), (InternalEntityEntry entry) => entry.GetCurrentValue(intNumberToBytesConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[100]); + (ValueBuffer valueBuffer) => valueBuffer[110]); intNumberToBytesConverterProperty.SetPropertyIndexes( - index: 100, - originalValueIndex: 100, + index: 110, + originalValueIndex: 110, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); @@ -5932,12 +6868,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas intNumberToStringConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_IntNumberToStringConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_IntNumberToStringConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(intNumberToStringConverterProperty, 101), + (InternalEntityEntry entry) => entry.ReadOriginalValue(intNumberToStringConverterProperty, 111), (InternalEntityEntry entry) => entry.GetCurrentValue(intNumberToStringConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[101]); + (ValueBuffer valueBuffer) => valueBuffer[111]); intNumberToStringConverterProperty.SetPropertyIndexes( - index: 101, - originalValueIndex: 101, + index: 111, + originalValueIndex: 111, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); @@ -5952,7 +6888,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (int v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( size: 64), @@ -5986,12 +6922,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullIntToNullStringConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullIntToNullStringConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullIntToNullStringConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullIntToNullStringConverterProperty, 102), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullIntToNullStringConverterProperty, 112), (InternalEntityEntry entry) => entry.GetCurrentValue>(nullIntToNullStringConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[102]); + (ValueBuffer valueBuffer) => valueBuffer[112]); nullIntToNullStringConverterProperty.SetPropertyIndexes( - index: 102, - originalValueIndex: 102, + index: 112, + originalValueIndex: 112, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); @@ -6006,16 +6942,16 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (Nullable v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), converter: new ValueConverter( - (Nullable v) => v == null ? null : v.ToString(), + (Nullable v) => v == null ? null : ((object)v).ToString(), (string v) => v == null || v == "" ? null : (Nullable)int.Parse(v), convertsNulls: true), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (Nullable v) => v == null ? null : v.ToString(), + (Nullable v) => v == null ? null : ((object)v).ToString(), (string v) => v == null || v == "" ? null : (Nullable)int.Parse(v), convertsNulls: true))); nullIntToNullStringConverterProperty.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullIntToNullStringConverterProperty", "TestNamespace") }); @@ -6038,27 +6974,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableBool.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableBool((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableBool((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableBool, 103), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableBool, 113), (InternalEntityEntry entry) => entry.GetCurrentValue>(nullableBool), - (ValueBuffer valueBuffer) => valueBuffer[103]); + (ValueBuffer valueBuffer) => valueBuffer[113]); nullableBool.SetPropertyIndexes( - index: 103, - originalValueIndex: 103, + index: 113, + originalValueIndex: 113, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableBool.TypeMapping = BoolTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (bool)v1 == (bool)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((bool)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(bool)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(bool)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (bool)v1 == (bool)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((bool)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(bool)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(bool)v : default(Nullable)), providerValueComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (bool)v1 == (bool)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((bool)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(bool)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(bool)v : default(Nullable)), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "INTEGER")); @@ -6081,44 +7017,44 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableBoolArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableBoolArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableBoolArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableBoolArray, 104), + (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableBoolArray, 114), (InternalEntityEntry entry) => entry.GetCurrentValue[]>(nullableBoolArray), - (ValueBuffer valueBuffer) => valueBuffer[104]); + (ValueBuffer valueBuffer) => valueBuffer[114]); nullableBoolArray.SetPropertyIndexes( - index: 104, - originalValueIndex: 104, + index: 114, + originalValueIndex: 114, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableBoolArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (bool)v1 == (bool)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((bool)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(bool)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(bool)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (bool)v1 == (bool)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((bool)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(bool)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(bool)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter( JsonBoolReaderWriter.Instance)), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter( JsonBoolReaderWriter.Instance), elementMapping: BoolTypeMapping.Default.Clone( comparer: new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v), keyComparer: new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v), providerValueComparer: new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "INTEGER"))); @@ -6142,19 +7078,19 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableBytes.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableBytes((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableBytes((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(nullableBytes, 105), + (InternalEntityEntry entry) => entry.ReadOriginalValue(nullableBytes, 115), (InternalEntityEntry entry) => entry.GetCurrentValue(nullableBytes), - (ValueBuffer valueBuffer) => valueBuffer[105]); + (ValueBuffer valueBuffer) => valueBuffer[115]); nullableBytes.SetPropertyIndexes( - index: 105, - originalValueIndex: 105, + index: 115, + originalValueIndex: 115, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableBytes.TypeMapping = SqliteByteArrayTypeMapping.Default.Clone( comparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), - (byte[] v) => v.GetHashCode(), + (byte[] v) => ((object)v).GetHashCode(), (byte[] v) => v), keyComparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), @@ -6183,36 +7119,36 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableBytesArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableBytesArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableBytesArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(nullableBytesArray, 106), + (InternalEntityEntry entry) => entry.ReadOriginalValue(nullableBytesArray, 116), (InternalEntityEntry entry) => entry.GetCurrentValue(nullableBytesArray), - (ValueBuffer valueBuffer) => valueBuffer[106]); + (ValueBuffer valueBuffer) => valueBuffer[116]); nullableBytesArray.SetPropertyIndexes( - index: 106, - originalValueIndex: 106, + index: 116, + originalValueIndex: 116, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableBytesArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfReferenceTypesComparer(new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), - (byte[] v) => v.GetHashCode(), + (byte[] v) => ((object)v).GetHashCode(), (byte[] v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), - (byte[] v) => v.GetHashCode(), + (byte[] v) => ((object)v).GetHashCode(), (byte[] v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter( SqliteJsonByteArrayReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( SqliteJsonByteArrayReaderWriter.Instance), elementMapping: SqliteByteArrayTypeMapping.Default.Clone( comparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), - (byte[] v) => v.GetHashCode(), + (byte[] v) => ((object)v).GetHashCode(), (byte[] v) => v), keyComparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), @@ -6224,6 +7160,83 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (byte[] source) => source.ToArray()))); nullableBytesArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableBytesArray", "TestNamespace") }); + var nullableBytesNestedCollection = runtimeEntityType.AddProperty( + "NullableBytesNestedCollection", + typeof(byte[][][]), + propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("NullableBytesNestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + nullableBytesNestedCollection.SetGetter( + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableBytesNestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableBytesNestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableBytesNestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableBytesNestedCollection(instance) == null); + nullableBytesNestedCollection.SetSetter( + (CompiledModelTestBase.ManyTypes entity, byte[][][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableBytesNestedCollection(entity) = value); + nullableBytesNestedCollection.SetMaterializationSetter( + (CompiledModelTestBase.ManyTypes entity, byte[][][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableBytesNestedCollection(entity) = value); + nullableBytesNestedCollection.SetAccessors( + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableBytesNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableBytesNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => entry.ReadOriginalValue(nullableBytesNestedCollection, 117), + (InternalEntityEntry entry) => entry.GetCurrentValue(nullableBytesNestedCollection), + (ValueBuffer valueBuffer) => valueBuffer[117]); + nullableBytesNestedCollection.SetPropertyIndexes( + index: 117, + originalValueIndex: 117, + shadowIndex: -1, + relationshipIndex: -1, + storeGenerationIndex: -1); + nullableBytesNestedCollection.TypeMapping = SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfReferenceTypesComparer(new ListOfReferenceTypesComparer(new ValueComparer( + (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), + (byte[] v) => ((object)v).GetHashCode(), + (byte[] v) => v))), + keyComparer: new ListOfReferenceTypesComparer(new ListOfReferenceTypesComparer(new ValueComparer( + (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), + (byte[] v) => ((object)v).GetHashCode(), + (byte[] v) => v))), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfReferencesReaderWriter( + SqliteJsonByteArrayReaderWriter.Instance))), + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfReferencesReaderWriter( + SqliteJsonByteArrayReaderWriter.Instance)), + elementMapping: SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfReferenceTypesComparer(new ValueComparer( + (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), + (byte[] v) => ((object)v).GetHashCode(), + (byte[] v) => v)), + keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( + (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), + (byte[] v) => ((object)v).GetHashCode(), + (byte[] v) => v)), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter( + SqliteJsonByteArrayReaderWriter.Instance)), + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( + SqliteJsonByteArrayReaderWriter.Instance), + elementMapping: SqliteByteArrayTypeMapping.Default.Clone( + comparer: new ValueComparer( + (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), + (byte[] v) => ((object)v).GetHashCode(), + (byte[] v) => v), + keyComparer: new ValueComparer( + (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), + (byte[] v) => StructuralComparisons.StructuralEqualityComparer.GetHashCode((object)v), + (byte[] source) => source.ToArray()), + providerValueComparer: new ValueComparer( + (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), + (byte[] v) => StructuralComparisons.StructuralEqualityComparer.GetHashCode((object)v), + (byte[] source) => source.ToArray())))); + nullableBytesNestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableBytesNestedCollection", "TestNamespace") }); + var nullableChar = runtimeEntityType.AddProperty( "NullableChar", typeof(char?), @@ -6242,12 +7255,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableChar.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableChar((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableChar((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableChar, 107), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableChar, 118), (InternalEntityEntry entry) => entry.GetCurrentValue>(nullableChar), - (ValueBuffer valueBuffer) => valueBuffer[107]); + (ValueBuffer valueBuffer) => valueBuffer[118]); nullableChar.SetPropertyIndexes( - index: 107, - originalValueIndex: 107, + index: 118, + originalValueIndex: 118, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); @@ -6285,31 +7298,31 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableCharArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableCharArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableCharArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableCharArray, 108), + (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableCharArray, 119), (InternalEntityEntry entry) => entry.GetCurrentValue[]>(nullableCharArray), - (ValueBuffer valueBuffer) => valueBuffer[108]); + (ValueBuffer valueBuffer) => valueBuffer[119]); nullableCharArray.SetPropertyIndexes( - index: 108, - originalValueIndex: 108, + index: 119, + originalValueIndex: 119, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableCharArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (char)v1 == (char)v2 || !v1.HasValue && !v2.HasValue, (Nullable v) => v.HasValue ? (int)(char)v : 0, (Nullable v) => v.HasValue ? (Nullable)(char)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (char)v1 == (char)v2 || !v1.HasValue && !v2.HasValue, (Nullable v) => v.HasValue ? (int)(char)v : 0, (Nullable v) => v.HasValue ? (Nullable)(char)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter( JsonCharReaderWriter.Instance)), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter( JsonCharReaderWriter.Instance), elementMapping: CharTypeMapping.Default.Clone( comparer: new ValueComparer( @@ -6346,12 +7359,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableDateOnly.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableDateOnly((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableDateOnly((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableDateOnly, 109), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableDateOnly, 120), (InternalEntityEntry entry) => entry.GetCurrentValue>(nullableDateOnly), - (ValueBuffer valueBuffer) => valueBuffer[109]); + (ValueBuffer valueBuffer) => valueBuffer[120]); nullableDateOnly.SetPropertyIndexes( - index: 109, - originalValueIndex: 109, + index: 120, + originalValueIndex: 120, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); @@ -6375,31 +7388,31 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableDateOnlyArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableDateOnlyArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableDateOnlyArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableDateOnlyArray, 110), + (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableDateOnlyArray, 121), (InternalEntityEntry entry) => entry.GetCurrentValue[]>(nullableDateOnlyArray), - (ValueBuffer valueBuffer) => valueBuffer[110]); + (ValueBuffer valueBuffer) => valueBuffer[121]); nullableDateOnlyArray.SetPropertyIndexes( - index: 110, - originalValueIndex: 110, + index: 121, + originalValueIndex: 121, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableDateOnlyArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateOnly)v1 == (DateOnly)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((DateOnly)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(DateOnly)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(DateOnly)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateOnly)v1 == (DateOnly)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((DateOnly)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(DateOnly)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(DateOnly)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter( JsonDateOnlyReaderWriter.Instance)), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter( JsonDateOnlyReaderWriter.Instance), elementMapping: SqliteDateOnlyTypeMapping.Default); nullableDateOnlyArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableDateOnlyArray", "TestNamespace") }); @@ -6422,12 +7435,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableDateTime.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableDateTime((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableDateTime((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableDateTime, 111), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableDateTime, 122), (InternalEntityEntry entry) => entry.GetCurrentValue>(nullableDateTime), - (ValueBuffer valueBuffer) => valueBuffer[111]); + (ValueBuffer valueBuffer) => valueBuffer[122]); nullableDateTime.SetPropertyIndexes( - index: 111, - originalValueIndex: 111, + index: 122, + originalValueIndex: 122, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); @@ -6451,31 +7464,31 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableDateTimeArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableDateTimeArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableDateTimeArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableDateTimeArray, 112), + (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableDateTimeArray, 123), (InternalEntityEntry entry) => entry.GetCurrentValue[]>(nullableDateTimeArray), - (ValueBuffer valueBuffer) => valueBuffer[112]); + (ValueBuffer valueBuffer) => valueBuffer[123]); nullableDateTimeArray.SetPropertyIndexes( - index: 112, - originalValueIndex: 112, + index: 123, + originalValueIndex: 123, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableDateTimeArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(DateTime)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (DateTime)v1 == (DateTime)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((DateTime)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(DateTime)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(DateTime)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter( SqliteJsonDateTimeReaderWriter.Instance)), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter( SqliteJsonDateTimeReaderWriter.Instance), elementMapping: SqliteDateTimeTypeMapping.Default); nullableDateTimeArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableDateTimeArray", "TestNamespace") }); @@ -6498,12 +7511,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableDecimal.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableDecimal((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableDecimal((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableDecimal, 113), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableDecimal, 124), (InternalEntityEntry entry) => entry.GetCurrentValue>(nullableDecimal), - (ValueBuffer valueBuffer) => valueBuffer[113]); + (ValueBuffer valueBuffer) => valueBuffer[124]); nullableDecimal.SetPropertyIndexes( - index: 113, - originalValueIndex: 113, + index: 124, + originalValueIndex: 124, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); @@ -6527,31 +7540,31 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableDecimalArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableDecimalArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableDecimalArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableDecimalArray, 114), + (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableDecimalArray, 125), (InternalEntityEntry entry) => entry.GetCurrentValue[]>(nullableDecimalArray), - (ValueBuffer valueBuffer) => valueBuffer[114]); + (ValueBuffer valueBuffer) => valueBuffer[125]); nullableDecimalArray.SetPropertyIndexes( - index: 114, - originalValueIndex: 114, + index: 125, + originalValueIndex: 125, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableDecimalArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(decimal)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (decimal)v1 == (decimal)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((decimal)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(decimal)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(decimal)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter( SqliteJsonDecimalReaderWriter.Instance)), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter( SqliteJsonDecimalReaderWriter.Instance), elementMapping: SqliteDecimalTypeMapping.Default); nullableDecimalArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableDecimalArray", "TestNamespace") }); @@ -6574,27 +7587,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableDouble.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableDouble((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableDouble((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableDouble, 115), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableDouble, 126), (InternalEntityEntry entry) => entry.GetCurrentValue>(nullableDouble), - (ValueBuffer valueBuffer) => valueBuffer[115]); + (ValueBuffer valueBuffer) => valueBuffer[126]); nullableDouble.SetPropertyIndexes( - index: 115, - originalValueIndex: 115, + index: 126, + originalValueIndex: 126, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableDouble.TypeMapping = DoubleTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && ((double)v1).Equals((double)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((double)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(double)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(double)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && ((double)v1).Equals((double)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((double)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(double)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(double)v : default(Nullable)), providerValueComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && ((double)v1).Equals((double)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((double)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(double)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(double)v : default(Nullable)), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "REAL")); @@ -6617,44 +7630,44 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableDoubleArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableDoubleArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableDoubleArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableDoubleArray, 116), + (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableDoubleArray, 127), (InternalEntityEntry entry) => entry.GetCurrentValue[]>(nullableDoubleArray), - (ValueBuffer valueBuffer) => valueBuffer[116]); + (ValueBuffer valueBuffer) => valueBuffer[127]); nullableDoubleArray.SetPropertyIndexes( - index: 116, - originalValueIndex: 116, + index: 127, + originalValueIndex: 127, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableDoubleArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && ((double)v1).Equals((double)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((double)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(double)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(double)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && ((double)v1).Equals((double)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((double)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(double)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(double)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter( JsonDoubleReaderWriter.Instance)), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter( JsonDoubleReaderWriter.Instance), elementMapping: DoubleTypeMapping.Default.Clone( comparer: new ValueComparer( (double v1, double v2) => v1.Equals(v2), - (double v) => v.GetHashCode(), + (double v) => ((object)v).GetHashCode(), (double v) => v), keyComparer: new ValueComparer( (double v1, double v2) => v1.Equals(v2), - (double v) => v.GetHashCode(), + (double v) => ((object)v).GetHashCode(), (double v) => v), providerValueComparer: new ValueComparer( (double v1, double v2) => v1.Equals(v2), - (double v) => v.GetHashCode(), + (double v) => ((object)v).GetHashCode(), (double v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "REAL"))); @@ -6678,23 +7691,23 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum16.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum16((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum16((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableEnum16, 117), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableEnum16, 128), (InternalEntityEntry entry) => entry.GetCurrentValue>(nullableEnum16), - (ValueBuffer valueBuffer) => valueBuffer[117]); + (ValueBuffer valueBuffer) => valueBuffer[128]); nullableEnum16.SetPropertyIndexes( - index: 117, - originalValueIndex: 117, + index: 128, + originalValueIndex: 128, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnum16.TypeMapping = ShortTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum16)v1, (object)(CompiledModelTestBase.Enum16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum16)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum16)v1, (object)(CompiledModelTestBase.Enum16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum16)v : default(Nullable)), providerValueComparer: new ValueComparer( (short v1, short v2) => v1 == v2, @@ -6729,35 +7742,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum16Array.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum16Array((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum16Array((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableEnum16Array, 118), + (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableEnum16Array, 129), (InternalEntityEntry entry) => entry.GetCurrentValue[]>(nullableEnum16Array), - (ValueBuffer valueBuffer) => valueBuffer[118]); + (ValueBuffer valueBuffer) => valueBuffer[129]); nullableEnum16Array.SetPropertyIndexes( - index: 118, - originalValueIndex: 118, + index: 129, + originalValueIndex: 129, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnum16Array.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum16)v1, (object)(CompiledModelTestBase.Enum16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum16)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum16)v1, (object)(CompiledModelTestBase.Enum16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum16)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonInt16ReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.Enum16 value) => (short)value, (short value) => (CompiledModelTestBase.Enum16)value)))), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonInt16ReaderWriter.Instance, new ValueConverter( @@ -6766,11 +7779,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: ShortTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v), providerValueComparer: new ValueComparer( (short v1, short v2) => v1 == v2, @@ -6806,23 +7819,23 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum16AsString.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum16AsString((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum16AsString((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableEnum16AsString, 119), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableEnum16AsString, 130), (InternalEntityEntry entry) => entry.GetCurrentValue>(nullableEnum16AsString), - (ValueBuffer valueBuffer) => valueBuffer[119]); + (ValueBuffer valueBuffer) => valueBuffer[130]); nullableEnum16AsString.SetPropertyIndexes( - index: 119, - originalValueIndex: 119, + index: 130, + originalValueIndex: 130, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnum16AsString.TypeMapping = ShortTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum16)v1, (object)(CompiledModelTestBase.Enum16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum16)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum16)v1, (object)(CompiledModelTestBase.Enum16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum16)v : default(Nullable)), providerValueComparer: new ValueComparer( (short v1, short v2) => v1 == v2, @@ -6857,35 +7870,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum16AsStringArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum16AsStringArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum16AsStringArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableEnum16AsStringArray, 120), + (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableEnum16AsStringArray, 131), (InternalEntityEntry entry) => entry.GetCurrentValue[]>(nullableEnum16AsStringArray), - (ValueBuffer valueBuffer) => valueBuffer[120]); + (ValueBuffer valueBuffer) => valueBuffer[131]); nullableEnum16AsStringArray.SetPropertyIndexes( - index: 120, - originalValueIndex: 120, + index: 131, + originalValueIndex: 131, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnum16AsStringArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum16)v1, (object)(CompiledModelTestBase.Enum16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum16)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum16)v1, (object)(CompiledModelTestBase.Enum16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum16)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonInt16ReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.Enum16 value) => (short)value, (short value) => (CompiledModelTestBase.Enum16)value)))), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonInt16ReaderWriter.Instance, new ValueConverter( @@ -6894,11 +7907,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: ShortTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v), providerValueComparer: new ValueComparer( (short v1, short v2) => v1 == v2, @@ -6933,35 +7946,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum16AsStringCollection.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum16AsStringCollection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum16AsStringCollection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>>(nullableEnum16AsStringCollection, 121), + (InternalEntityEntry entry) => entry.ReadOriginalValue>>(nullableEnum16AsStringCollection, 132), (InternalEntityEntry entry) => entry.GetCurrentValue>>(nullableEnum16AsStringCollection), - (ValueBuffer valueBuffer) => valueBuffer[121]); + (ValueBuffer valueBuffer) => valueBuffer[132]); nullableEnum16AsStringCollection.SetPropertyIndexes( - index: 121, - originalValueIndex: 121, + index: 132, + originalValueIndex: 132, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnum16AsStringCollection.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.Enum16>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum16)v1, (object)(CompiledModelTestBase.Enum16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum16)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.Enum16>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum16)v1, (object)(CompiledModelTestBase.Enum16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum16)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter, List, CompiledModelTestBase.Enum16>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter, CompiledModelTestBase.Enum16>( new JsonConvertedValueReaderWriter( JsonInt16ReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.Enum16 value) => (short)value, (short value) => (CompiledModelTestBase.Enum16)value)))), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter, List, CompiledModelTestBase.Enum16>( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter, CompiledModelTestBase.Enum16>( new JsonConvertedValueReaderWriter( JsonInt16ReaderWriter.Instance, new ValueConverter( @@ -6970,11 +7983,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: ShortTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v), providerValueComparer: new ValueComparer( (short v1, short v2) => v1 == v2, @@ -7009,35 +8022,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum16Collection.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum16Collection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum16Collection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>>(nullableEnum16Collection, 122), + (InternalEntityEntry entry) => entry.ReadOriginalValue>>(nullableEnum16Collection, 133), (InternalEntityEntry entry) => entry.GetCurrentValue>>(nullableEnum16Collection), - (ValueBuffer valueBuffer) => valueBuffer[122]); + (ValueBuffer valueBuffer) => valueBuffer[133]); nullableEnum16Collection.SetPropertyIndexes( - index: 122, - originalValueIndex: 122, + index: 133, + originalValueIndex: 133, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnum16Collection.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.Enum16>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum16)v1, (object)(CompiledModelTestBase.Enum16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum16)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.Enum16>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum16)v1, (object)(CompiledModelTestBase.Enum16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum16)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter, List, CompiledModelTestBase.Enum16>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter, CompiledModelTestBase.Enum16>( new JsonConvertedValueReaderWriter( JsonInt16ReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.Enum16 value) => (short)value, (short value) => (CompiledModelTestBase.Enum16)value)))), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter, List, CompiledModelTestBase.Enum16>( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter, CompiledModelTestBase.Enum16>( new JsonConvertedValueReaderWriter( JsonInt16ReaderWriter.Instance, new ValueConverter( @@ -7046,11 +8059,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: ShortTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum16 v1, CompiledModelTestBase.Enum16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum16 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum16 v) => v), providerValueComparer: new ValueComparer( (short v1, short v2) => v1 == v2, @@ -7086,23 +8099,23 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum32.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum32((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum32((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableEnum32, 123), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableEnum32, 134), (InternalEntityEntry entry) => entry.GetCurrentValue>(nullableEnum32), - (ValueBuffer valueBuffer) => valueBuffer[123]); + (ValueBuffer valueBuffer) => valueBuffer[134]); nullableEnum32.SetPropertyIndexes( - index: 123, - originalValueIndex: 123, + index: 134, + originalValueIndex: 134, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnum32.TypeMapping = IntTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum32)v1, (object)(CompiledModelTestBase.Enum32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum32)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum32)v1, (object)(CompiledModelTestBase.Enum32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum32)v : default(Nullable)), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -7137,35 +8150,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum32Array.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum32Array((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum32Array((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableEnum32Array, 124), + (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableEnum32Array, 135), (InternalEntityEntry entry) => entry.GetCurrentValue[]>(nullableEnum32Array), - (ValueBuffer valueBuffer) => valueBuffer[124]); + (ValueBuffer valueBuffer) => valueBuffer[135]); nullableEnum32Array.SetPropertyIndexes( - index: 124, - originalValueIndex: 124, + index: 135, + originalValueIndex: 135, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnum32Array.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum32)v1, (object)(CompiledModelTestBase.Enum32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum32)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum32)v1, (object)(CompiledModelTestBase.Enum32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum32)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonInt32ReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.Enum32 value) => (int)value, (int value) => (CompiledModelTestBase.Enum32)value)))), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonInt32ReaderWriter.Instance, new ValueConverter( @@ -7174,11 +8187,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: IntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -7214,23 +8227,23 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum32AsString.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum32AsString((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum32AsString((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableEnum32AsString, 125), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableEnum32AsString, 136), (InternalEntityEntry entry) => entry.GetCurrentValue>(nullableEnum32AsString), - (ValueBuffer valueBuffer) => valueBuffer[125]); + (ValueBuffer valueBuffer) => valueBuffer[136]); nullableEnum32AsString.SetPropertyIndexes( - index: 125, - originalValueIndex: 125, + index: 136, + originalValueIndex: 136, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnum32AsString.TypeMapping = IntTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum32)v1, (object)(CompiledModelTestBase.Enum32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum32)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum32)v1, (object)(CompiledModelTestBase.Enum32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum32)v : default(Nullable)), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -7265,35 +8278,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum32AsStringArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum32AsStringArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum32AsStringArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableEnum32AsStringArray, 126), + (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableEnum32AsStringArray, 137), (InternalEntityEntry entry) => entry.GetCurrentValue[]>(nullableEnum32AsStringArray), - (ValueBuffer valueBuffer) => valueBuffer[126]); + (ValueBuffer valueBuffer) => valueBuffer[137]); nullableEnum32AsStringArray.SetPropertyIndexes( - index: 126, - originalValueIndex: 126, + index: 137, + originalValueIndex: 137, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnum32AsStringArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum32)v1, (object)(CompiledModelTestBase.Enum32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum32)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum32)v1, (object)(CompiledModelTestBase.Enum32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum32)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonInt32ReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.Enum32 value) => (int)value, (int value) => (CompiledModelTestBase.Enum32)value)))), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonInt32ReaderWriter.Instance, new ValueConverter( @@ -7302,11 +8315,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: IntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -7341,35 +8354,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum32AsStringCollection.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum32AsStringCollection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum32AsStringCollection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>>(nullableEnum32AsStringCollection, 127), + (InternalEntityEntry entry) => entry.ReadOriginalValue>>(nullableEnum32AsStringCollection, 138), (InternalEntityEntry entry) => entry.GetCurrentValue>>(nullableEnum32AsStringCollection), - (ValueBuffer valueBuffer) => valueBuffer[127]); + (ValueBuffer valueBuffer) => valueBuffer[138]); nullableEnum32AsStringCollection.SetPropertyIndexes( - index: 127, - originalValueIndex: 127, + index: 138, + originalValueIndex: 138, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnum32AsStringCollection.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.Enum32>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum32)v1, (object)(CompiledModelTestBase.Enum32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum32)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.Enum32>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum32)v1, (object)(CompiledModelTestBase.Enum32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum32)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter, List, CompiledModelTestBase.Enum32>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter, CompiledModelTestBase.Enum32>( new JsonConvertedValueReaderWriter( JsonInt32ReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.Enum32 value) => (int)value, (int value) => (CompiledModelTestBase.Enum32)value)))), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter, List, CompiledModelTestBase.Enum32>( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter, CompiledModelTestBase.Enum32>( new JsonConvertedValueReaderWriter( JsonInt32ReaderWriter.Instance, new ValueConverter( @@ -7378,11 +8391,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: IntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -7417,35 +8430,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum32Collection.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum32Collection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum32Collection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>>(nullableEnum32Collection, 128), + (InternalEntityEntry entry) => entry.ReadOriginalValue>>(nullableEnum32Collection, 139), (InternalEntityEntry entry) => entry.GetCurrentValue>>(nullableEnum32Collection), - (ValueBuffer valueBuffer) => valueBuffer[128]); + (ValueBuffer valueBuffer) => valueBuffer[139]); nullableEnum32Collection.SetPropertyIndexes( - index: 128, - originalValueIndex: 128, + index: 139, + originalValueIndex: 139, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnum32Collection.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.Enum32>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum32)v1, (object)(CompiledModelTestBase.Enum32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum32)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.Enum32>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum32)v1, (object)(CompiledModelTestBase.Enum32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum32)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter, List, CompiledModelTestBase.Enum32>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter, CompiledModelTestBase.Enum32>( new JsonConvertedValueReaderWriter( JsonInt32ReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.Enum32 value) => (int)value, (int value) => (CompiledModelTestBase.Enum32)value)))), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter, List, CompiledModelTestBase.Enum32>( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter, CompiledModelTestBase.Enum32>( new JsonConvertedValueReaderWriter( JsonInt32ReaderWriter.Instance, new ValueConverter( @@ -7454,11 +8467,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: IntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum32 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum32 v) => v), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -7476,6 +8489,138 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (int value) => (CompiledModelTestBase.Enum32)value)))); nullableEnum32Collection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum32Collection", "TestNamespace") }); + var nullableEnum32NestedCollection = runtimeEntityType.AddProperty( + "NullableEnum32NestedCollection", + typeof(CompiledModelTestBase.Enum32?[][][]), + propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("NullableEnum32NestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + nullableEnum32NestedCollection.SetGetter( + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum32NestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum32NestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum32NestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum32NestedCollection(instance) == null); + nullableEnum32NestedCollection.SetSetter( + (CompiledModelTestBase.ManyTypes entity, Nullable[][][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum32NestedCollection(entity) = value); + nullableEnum32NestedCollection.SetMaterializationSetter( + (CompiledModelTestBase.ManyTypes entity, Nullable[][][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum32NestedCollection(entity) = value); + nullableEnum32NestedCollection.SetAccessors( + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum32NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum32NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => entry.ReadOriginalValue[][][]>(nullableEnum32NestedCollection, 140), + (InternalEntityEntry entry) => entry.GetCurrentValue[][][]>(nullableEnum32NestedCollection), + (ValueBuffer valueBuffer) => valueBuffer[140]); + nullableEnum32NestedCollection.SetPropertyIndexes( + index: 140, + originalValueIndex: 140, + shadowIndex: -1, + relationshipIndex: -1, + storeGenerationIndex: -1); + nullableEnum32NestedCollection.TypeMapping = SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfReferenceTypesComparer(new ListOfReferenceTypesComparer(new ListOfNullableValueTypesComparer(new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum32)v1, (object)(CompiledModelTestBase.Enum32)v2) || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum32)v : default(Nullable))))), + keyComparer: new ListOfReferenceTypesComparer(new ListOfReferenceTypesComparer(new ListOfNullableValueTypesComparer(new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum32)v1, (object)(CompiledModelTestBase.Enum32)v2) || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum32)v : default(Nullable))))), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfNullableStructsReaderWriter( + new JsonConvertedValueReaderWriter( + JsonInt32ReaderWriter.Instance, + new ValueConverter( + (CompiledModelTestBase.Enum32 value) => (int)value, + (int value) => (CompiledModelTestBase.Enum32)value)))))), + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfNullableStructsReaderWriter( + new JsonConvertedValueReaderWriter( + JsonInt32ReaderWriter.Instance, + new ValueConverter( + (CompiledModelTestBase.Enum32 value) => (int)value, + (int value) => (CompiledModelTestBase.Enum32)value))))), + elementMapping: SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfReferenceTypesComparer(new ListOfNullableValueTypesComparer(new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum32)v1, (object)(CompiledModelTestBase.Enum32)v2) || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum32)v : default(Nullable)))), + keyComparer: new ListOfReferenceTypesComparer(new ListOfNullableValueTypesComparer(new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum32)v1, (object)(CompiledModelTestBase.Enum32)v2) || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum32)v : default(Nullable)))), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfNullableStructsReaderWriter( + new JsonConvertedValueReaderWriter( + JsonInt32ReaderWriter.Instance, + new ValueConverter( + (CompiledModelTestBase.Enum32 value) => (int)value, + (int value) => (CompiledModelTestBase.Enum32)value))))), + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfNullableStructsReaderWriter( + new JsonConvertedValueReaderWriter( + JsonInt32ReaderWriter.Instance, + new ValueConverter( + (CompiledModelTestBase.Enum32 value) => (int)value, + (int value) => (CompiledModelTestBase.Enum32)value)))), + elementMapping: SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfNullableValueTypesComparer(new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum32)v1, (object)(CompiledModelTestBase.Enum32)v2) || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum32)v : default(Nullable))), + keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum32)v1, (object)(CompiledModelTestBase.Enum32)v2) || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum32)v : default(Nullable))), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter( + new JsonConvertedValueReaderWriter( + JsonInt32ReaderWriter.Instance, + new ValueConverter( + (CompiledModelTestBase.Enum32 value) => (int)value, + (int value) => (CompiledModelTestBase.Enum32)value)))), + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter( + new JsonConvertedValueReaderWriter( + JsonInt32ReaderWriter.Instance, + new ValueConverter( + (CompiledModelTestBase.Enum32 value) => (int)value, + (int value) => (CompiledModelTestBase.Enum32)value))), + elementMapping: IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), + (CompiledModelTestBase.Enum32 v) => v), + keyComparer: new ValueComparer( + (CompiledModelTestBase.Enum32 v1, CompiledModelTestBase.Enum32 v2) => object.Equals((object)v1, (object)v2), + (CompiledModelTestBase.Enum32 v) => ((object)v).GetHashCode(), + (CompiledModelTestBase.Enum32 v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "INTEGER"), + converter: new ValueConverter( + (CompiledModelTestBase.Enum32 value) => (int)value, + (int value) => (CompiledModelTestBase.Enum32)value), + jsonValueReaderWriter: new JsonConvertedValueReaderWriter( + JsonInt32ReaderWriter.Instance, + new ValueConverter( + (CompiledModelTestBase.Enum32 value) => (int)value, + (int value) => (CompiledModelTestBase.Enum32)value)))))); + nullableEnum32NestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum32NestedCollection", "TestNamespace") }); + var nullableEnum64 = runtimeEntityType.AddProperty( "NullableEnum64", typeof(CompiledModelTestBase.Enum64?), @@ -7494,27 +8639,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum64.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum64((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum64((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableEnum64, 129), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableEnum64, 141), (InternalEntityEntry entry) => entry.GetCurrentValue>(nullableEnum64), - (ValueBuffer valueBuffer) => valueBuffer[129]); + (ValueBuffer valueBuffer) => valueBuffer[141]); nullableEnum64.SetPropertyIndexes( - index: 129, - originalValueIndex: 129, + index: 141, + originalValueIndex: 141, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnum64.TypeMapping = LongTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum64)v1, (object)(CompiledModelTestBase.Enum64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum64)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum64)v1, (object)(CompiledModelTestBase.Enum64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum64)v : default(Nullable)), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "INTEGER"), @@ -7545,35 +8690,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum64Array.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum64Array((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum64Array((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableEnum64Array, 130), + (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableEnum64Array, 142), (InternalEntityEntry entry) => entry.GetCurrentValue[]>(nullableEnum64Array), - (ValueBuffer valueBuffer) => valueBuffer[130]); + (ValueBuffer valueBuffer) => valueBuffer[142]); nullableEnum64Array.SetPropertyIndexes( - index: 130, - originalValueIndex: 130, + index: 142, + originalValueIndex: 142, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnum64Array.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum64)v1, (object)(CompiledModelTestBase.Enum64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum64)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum64)v1, (object)(CompiledModelTestBase.Enum64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum64)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonInt64ReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.Enum64 value) => (long)value, (long value) => (CompiledModelTestBase.Enum64)value)))), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonInt64ReaderWriter.Instance, new ValueConverter( @@ -7582,15 +8727,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: LongTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "INTEGER"), @@ -7622,27 +8767,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum64AsString.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum64AsString((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum64AsString((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableEnum64AsString, 131), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableEnum64AsString, 143), (InternalEntityEntry entry) => entry.GetCurrentValue>(nullableEnum64AsString), - (ValueBuffer valueBuffer) => valueBuffer[131]); + (ValueBuffer valueBuffer) => valueBuffer[143]); nullableEnum64AsString.SetPropertyIndexes( - index: 131, - originalValueIndex: 131, + index: 143, + originalValueIndex: 143, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnum64AsString.TypeMapping = LongTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum64)v1, (object)(CompiledModelTestBase.Enum64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum64)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum64)v1, (object)(CompiledModelTestBase.Enum64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum64)v : default(Nullable)), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "INTEGER"), @@ -7673,35 +8818,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum64AsStringArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum64AsStringArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum64AsStringArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableEnum64AsStringArray, 132), + (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableEnum64AsStringArray, 144), (InternalEntityEntry entry) => entry.GetCurrentValue[]>(nullableEnum64AsStringArray), - (ValueBuffer valueBuffer) => valueBuffer[132]); + (ValueBuffer valueBuffer) => valueBuffer[144]); nullableEnum64AsStringArray.SetPropertyIndexes( - index: 132, - originalValueIndex: 132, + index: 144, + originalValueIndex: 144, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnum64AsStringArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum64)v1, (object)(CompiledModelTestBase.Enum64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum64)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum64)v1, (object)(CompiledModelTestBase.Enum64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum64)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonInt64ReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.Enum64 value) => (long)value, (long value) => (CompiledModelTestBase.Enum64)value)))), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonInt64ReaderWriter.Instance, new ValueConverter( @@ -7710,15 +8855,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: LongTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "INTEGER"), @@ -7749,35 +8894,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum64AsStringCollection.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum64AsStringCollection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum64AsStringCollection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>>(nullableEnum64AsStringCollection, 133), + (InternalEntityEntry entry) => entry.ReadOriginalValue>>(nullableEnum64AsStringCollection, 145), (InternalEntityEntry entry) => entry.GetCurrentValue>>(nullableEnum64AsStringCollection), - (ValueBuffer valueBuffer) => valueBuffer[133]); + (ValueBuffer valueBuffer) => valueBuffer[145]); nullableEnum64AsStringCollection.SetPropertyIndexes( - index: 133, - originalValueIndex: 133, + index: 145, + originalValueIndex: 145, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnum64AsStringCollection.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.Enum64>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum64)v1, (object)(CompiledModelTestBase.Enum64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum64)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.Enum64>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum64)v1, (object)(CompiledModelTestBase.Enum64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum64)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter, List, CompiledModelTestBase.Enum64>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter, CompiledModelTestBase.Enum64>( new JsonConvertedValueReaderWriter( JsonInt64ReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.Enum64 value) => (long)value, (long value) => (CompiledModelTestBase.Enum64)value)))), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter, List, CompiledModelTestBase.Enum64>( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter, CompiledModelTestBase.Enum64>( new JsonConvertedValueReaderWriter( JsonInt64ReaderWriter.Instance, new ValueConverter( @@ -7786,15 +8931,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: LongTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "INTEGER"), @@ -7825,35 +8970,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum64Collection.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum64Collection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum64Collection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>>(nullableEnum64Collection, 134), + (InternalEntityEntry entry) => entry.ReadOriginalValue>>(nullableEnum64Collection, 146), (InternalEntityEntry entry) => entry.GetCurrentValue>>(nullableEnum64Collection), - (ValueBuffer valueBuffer) => valueBuffer[134]); + (ValueBuffer valueBuffer) => valueBuffer[146]); nullableEnum64Collection.SetPropertyIndexes( - index: 134, - originalValueIndex: 134, + index: 146, + originalValueIndex: 146, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnum64Collection.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.Enum64>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum64)v1, (object)(CompiledModelTestBase.Enum64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum64)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.Enum64>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum64)v1, (object)(CompiledModelTestBase.Enum64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum64)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter, List, CompiledModelTestBase.Enum64>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter, CompiledModelTestBase.Enum64>( new JsonConvertedValueReaderWriter( JsonInt64ReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.Enum64 value) => (long)value, (long value) => (CompiledModelTestBase.Enum64)value)))), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter, List, CompiledModelTestBase.Enum64>( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter, CompiledModelTestBase.Enum64>( new JsonConvertedValueReaderWriter( JsonInt64ReaderWriter.Instance, new ValueConverter( @@ -7862,15 +9007,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: LongTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum64 v1, CompiledModelTestBase.Enum64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum64 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum64 v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "INTEGER"), @@ -7902,23 +9047,23 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum8.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum8((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum8((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableEnum8, 135), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableEnum8, 147), (InternalEntityEntry entry) => entry.GetCurrentValue>(nullableEnum8), - (ValueBuffer valueBuffer) => valueBuffer[135]); + (ValueBuffer valueBuffer) => valueBuffer[147]); nullableEnum8.SetPropertyIndexes( - index: 135, - originalValueIndex: 135, + index: 147, + originalValueIndex: 147, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnum8.TypeMapping = SByteTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum8)v1, (object)(CompiledModelTestBase.Enum8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum8)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum8)v1, (object)(CompiledModelTestBase.Enum8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum8)v : default(Nullable)), providerValueComparer: new ValueComparer( (sbyte v1, sbyte v2) => v1 == v2, @@ -7953,35 +9098,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum8Array.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum8Array((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum8Array((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableEnum8Array, 136), + (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableEnum8Array, 148), (InternalEntityEntry entry) => entry.GetCurrentValue[]>(nullableEnum8Array), - (ValueBuffer valueBuffer) => valueBuffer[136]); + (ValueBuffer valueBuffer) => valueBuffer[148]); nullableEnum8Array.SetPropertyIndexes( - index: 136, - originalValueIndex: 136, + index: 148, + originalValueIndex: 148, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnum8Array.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum8)v1, (object)(CompiledModelTestBase.Enum8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum8)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum8)v1, (object)(CompiledModelTestBase.Enum8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum8)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonSByteReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.Enum8 value) => (sbyte)value, (sbyte value) => (CompiledModelTestBase.Enum8)value)))), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonSByteReaderWriter.Instance, new ValueConverter( @@ -7990,11 +9135,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SByteTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), providerValueComparer: new ValueComparer( (sbyte v1, sbyte v2) => v1 == v2, @@ -8030,23 +9175,23 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum8AsString.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum8AsString((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum8AsString((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableEnum8AsString, 137), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableEnum8AsString, 149), (InternalEntityEntry entry) => entry.GetCurrentValue>(nullableEnum8AsString), - (ValueBuffer valueBuffer) => valueBuffer[137]); + (ValueBuffer valueBuffer) => valueBuffer[149]); nullableEnum8AsString.SetPropertyIndexes( - index: 137, - originalValueIndex: 137, + index: 149, + originalValueIndex: 149, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnum8AsString.TypeMapping = SByteTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum8)v1, (object)(CompiledModelTestBase.Enum8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum8)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum8)v1, (object)(CompiledModelTestBase.Enum8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum8)v : default(Nullable)), providerValueComparer: new ValueComparer( (sbyte v1, sbyte v2) => v1 == v2, @@ -8081,35 +9226,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum8AsStringArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum8AsStringArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum8AsStringArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableEnum8AsStringArray, 138), + (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableEnum8AsStringArray, 150), (InternalEntityEntry entry) => entry.GetCurrentValue[]>(nullableEnum8AsStringArray), - (ValueBuffer valueBuffer) => valueBuffer[138]); + (ValueBuffer valueBuffer) => valueBuffer[150]); nullableEnum8AsStringArray.SetPropertyIndexes( - index: 138, - originalValueIndex: 138, + index: 150, + originalValueIndex: 150, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnum8AsStringArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum8)v1, (object)(CompiledModelTestBase.Enum8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum8)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum8)v1, (object)(CompiledModelTestBase.Enum8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum8)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonSByteReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.Enum8 value) => (sbyte)value, (sbyte value) => (CompiledModelTestBase.Enum8)value)))), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonSByteReaderWriter.Instance, new ValueConverter( @@ -8118,11 +9263,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SByteTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), providerValueComparer: new ValueComparer( (sbyte v1, sbyte v2) => v1 == v2, @@ -8157,35 +9302,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum8AsStringCollection.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum8AsStringCollection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum8AsStringCollection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>>(nullableEnum8AsStringCollection, 139), + (InternalEntityEntry entry) => entry.ReadOriginalValue>>(nullableEnum8AsStringCollection, 151), (InternalEntityEntry entry) => entry.GetCurrentValue>>(nullableEnum8AsStringCollection), - (ValueBuffer valueBuffer) => valueBuffer[139]); + (ValueBuffer valueBuffer) => valueBuffer[151]); nullableEnum8AsStringCollection.SetPropertyIndexes( - index: 139, - originalValueIndex: 139, + index: 151, + originalValueIndex: 151, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnum8AsStringCollection.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.Enum8>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum8)v1, (object)(CompiledModelTestBase.Enum8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum8)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.Enum8>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum8)v1, (object)(CompiledModelTestBase.Enum8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum8)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter, List, CompiledModelTestBase.Enum8>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter, CompiledModelTestBase.Enum8>( new JsonConvertedValueReaderWriter( JsonSByteReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.Enum8 value) => (sbyte)value, (sbyte value) => (CompiledModelTestBase.Enum8)value)))), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter, List, CompiledModelTestBase.Enum8>( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter, CompiledModelTestBase.Enum8>( new JsonConvertedValueReaderWriter( JsonSByteReaderWriter.Instance, new ValueConverter( @@ -8194,11 +9339,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SByteTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), providerValueComparer: new ValueComparer( (sbyte v1, sbyte v2) => v1 == v2, @@ -8233,35 +9378,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnum8Collection.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum8Collection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum8Collection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>>(nullableEnum8Collection, 140), + (InternalEntityEntry entry) => entry.ReadOriginalValue>>(nullableEnum8Collection, 152), (InternalEntityEntry entry) => entry.GetCurrentValue>>(nullableEnum8Collection), - (ValueBuffer valueBuffer) => valueBuffer[140]); + (ValueBuffer valueBuffer) => valueBuffer[152]); nullableEnum8Collection.SetPropertyIndexes( - index: 140, - originalValueIndex: 140, + index: 152, + originalValueIndex: 152, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnum8Collection.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.Enum8>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum8)v1, (object)(CompiledModelTestBase.Enum8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum8)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.Enum8>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum8)v1, (object)(CompiledModelTestBase.Enum8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.Enum8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum8)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter, List, CompiledModelTestBase.Enum8>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter, CompiledModelTestBase.Enum8>( new JsonConvertedValueReaderWriter( JsonSByteReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.Enum8 value) => (sbyte)value, (sbyte value) => (CompiledModelTestBase.Enum8)value)))), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter, List, CompiledModelTestBase.Enum8>( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter, CompiledModelTestBase.Enum8>( new JsonConvertedValueReaderWriter( JsonSByteReaderWriter.Instance, new ValueConverter( @@ -8270,11 +9415,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SByteTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.Enum8 v) => v.GetHashCode(), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.Enum8 v) => v), providerValueComparer: new ValueComparer( (sbyte v1, sbyte v2) => v1 == v2, @@ -8292,6 +9437,109 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (sbyte value) => (CompiledModelTestBase.Enum8)value)))); nullableEnum8Collection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum8Collection", "TestNamespace") }); + var nullableEnum8NestedCollection = runtimeEntityType.AddProperty( + "NullableEnum8NestedCollection", + typeof(CompiledModelTestBase.Enum8?[][]), + propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("NullableEnum8NestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + nullableEnum8NestedCollection.SetGetter( + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum8NestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum8NestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum8NestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum8NestedCollection(instance) == null); + nullableEnum8NestedCollection.SetSetter( + (CompiledModelTestBase.ManyTypes entity, Nullable[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum8NestedCollection(entity) = value); + nullableEnum8NestedCollection.SetMaterializationSetter( + (CompiledModelTestBase.ManyTypes entity, Nullable[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum8NestedCollection(entity) = value); + nullableEnum8NestedCollection.SetAccessors( + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum8NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum8NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => entry.ReadOriginalValue[][]>(nullableEnum8NestedCollection, 153), + (InternalEntityEntry entry) => entry.GetCurrentValue[][]>(nullableEnum8NestedCollection), + (ValueBuffer valueBuffer) => valueBuffer[153]); + nullableEnum8NestedCollection.SetPropertyIndexes( + index: 153, + originalValueIndex: 153, + shadowIndex: -1, + relationshipIndex: -1, + storeGenerationIndex: -1); + nullableEnum8NestedCollection.TypeMapping = SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfReferenceTypesComparer(new ListOfNullableValueTypesComparer(new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum8)v1, (object)(CompiledModelTestBase.Enum8)v2) || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum8)v : default(Nullable)))), + keyComparer: new ListOfReferenceTypesComparer(new ListOfNullableValueTypesComparer(new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum8)v1, (object)(CompiledModelTestBase.Enum8)v2) || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum8)v : default(Nullable)))), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfNullableStructsReaderWriter( + new JsonConvertedValueReaderWriter( + JsonSByteReaderWriter.Instance, + new ValueConverter( + (CompiledModelTestBase.Enum8 value) => (sbyte)value, + (sbyte value) => (CompiledModelTestBase.Enum8)value))))), + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfNullableStructsReaderWriter( + new JsonConvertedValueReaderWriter( + JsonSByteReaderWriter.Instance, + new ValueConverter( + (CompiledModelTestBase.Enum8 value) => (sbyte)value, + (sbyte value) => (CompiledModelTestBase.Enum8)value)))), + elementMapping: SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfNullableValueTypesComparer(new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum8)v1, (object)(CompiledModelTestBase.Enum8)v2) || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum8)v : default(Nullable))), + keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.Enum8)v1, (object)(CompiledModelTestBase.Enum8)v2) || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.Enum8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.Enum8)v : default(Nullable))), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter( + new JsonConvertedValueReaderWriter( + JsonSByteReaderWriter.Instance, + new ValueConverter( + (CompiledModelTestBase.Enum8 value) => (sbyte)value, + (sbyte value) => (CompiledModelTestBase.Enum8)value)))), + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter( + new JsonConvertedValueReaderWriter( + JsonSByteReaderWriter.Instance, + new ValueConverter( + (CompiledModelTestBase.Enum8 value) => (sbyte)value, + (sbyte value) => (CompiledModelTestBase.Enum8)value))), + elementMapping: SByteTypeMapping.Default.Clone( + comparer: new ValueComparer( + (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), + (CompiledModelTestBase.Enum8 v) => v), + keyComparer: new ValueComparer( + (CompiledModelTestBase.Enum8 v1, CompiledModelTestBase.Enum8 v2) => object.Equals((object)v1, (object)v2), + (CompiledModelTestBase.Enum8 v) => ((object)v).GetHashCode(), + (CompiledModelTestBase.Enum8 v) => v), + providerValueComparer: new ValueComparer( + (sbyte v1, sbyte v2) => v1 == v2, + (sbyte v) => (int)v, + (sbyte v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "INTEGER"), + converter: new ValueConverter( + (CompiledModelTestBase.Enum8 value) => (sbyte)value, + (sbyte value) => (CompiledModelTestBase.Enum8)value), + jsonValueReaderWriter: new JsonConvertedValueReaderWriter( + JsonSByteReaderWriter.Instance, + new ValueConverter( + (CompiledModelTestBase.Enum8 value) => (sbyte)value, + (sbyte value) => (CompiledModelTestBase.Enum8)value))))); + nullableEnum8NestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum8NestedCollection", "TestNamespace") }); + var nullableEnumU16 = runtimeEntityType.AddProperty( "NullableEnumU16", typeof(CompiledModelTestBase.EnumU16?), @@ -8310,23 +9558,23 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU16.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU16((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU16((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableEnumU16, 141), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableEnumU16, 154), (InternalEntityEntry entry) => entry.GetCurrentValue>(nullableEnumU16), - (ValueBuffer valueBuffer) => valueBuffer[141]); + (ValueBuffer valueBuffer) => valueBuffer[154]); nullableEnumU16.SetPropertyIndexes( - index: 141, - originalValueIndex: 141, + index: 154, + originalValueIndex: 154, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnumU16.TypeMapping = UShortTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU16)v1, (object)(CompiledModelTestBase.EnumU16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU16)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU16)v1, (object)(CompiledModelTestBase.EnumU16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU16)v : default(Nullable)), providerValueComparer: new ValueComparer( (ushort v1, ushort v2) => v1 == v2, @@ -8361,35 +9609,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU16Array.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU16Array((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU16Array((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableEnumU16Array, 142), + (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableEnumU16Array, 155), (InternalEntityEntry entry) => entry.GetCurrentValue[]>(nullableEnumU16Array), - (ValueBuffer valueBuffer) => valueBuffer[142]); + (ValueBuffer valueBuffer) => valueBuffer[155]); nullableEnumU16Array.SetPropertyIndexes( - index: 142, - originalValueIndex: 142, + index: 155, + originalValueIndex: 155, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnumU16Array.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU16)v1, (object)(CompiledModelTestBase.EnumU16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU16)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU16)v1, (object)(CompiledModelTestBase.EnumU16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU16)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonUInt16ReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.EnumU16 value) => (ushort)value, (ushort value) => (CompiledModelTestBase.EnumU16)value)))), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonUInt16ReaderWriter.Instance, new ValueConverter( @@ -8398,11 +9646,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: UShortTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v), providerValueComparer: new ValueComparer( (ushort v1, ushort v2) => v1 == v2, @@ -8438,23 +9686,23 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU16AsString.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU16AsString((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU16AsString((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableEnumU16AsString, 143), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableEnumU16AsString, 156), (InternalEntityEntry entry) => entry.GetCurrentValue>(nullableEnumU16AsString), - (ValueBuffer valueBuffer) => valueBuffer[143]); + (ValueBuffer valueBuffer) => valueBuffer[156]); nullableEnumU16AsString.SetPropertyIndexes( - index: 143, - originalValueIndex: 143, + index: 156, + originalValueIndex: 156, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnumU16AsString.TypeMapping = UShortTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU16)v1, (object)(CompiledModelTestBase.EnumU16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU16)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU16)v1, (object)(CompiledModelTestBase.EnumU16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU16)v : default(Nullable)), providerValueComparer: new ValueComparer( (ushort v1, ushort v2) => v1 == v2, @@ -8489,35 +9737,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU16AsStringArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU16AsStringArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU16AsStringArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableEnumU16AsStringArray, 144), + (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableEnumU16AsStringArray, 157), (InternalEntityEntry entry) => entry.GetCurrentValue[]>(nullableEnumU16AsStringArray), - (ValueBuffer valueBuffer) => valueBuffer[144]); + (ValueBuffer valueBuffer) => valueBuffer[157]); nullableEnumU16AsStringArray.SetPropertyIndexes( - index: 144, - originalValueIndex: 144, + index: 157, + originalValueIndex: 157, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnumU16AsStringArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU16)v1, (object)(CompiledModelTestBase.EnumU16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU16)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU16)v1, (object)(CompiledModelTestBase.EnumU16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU16)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonUInt16ReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.EnumU16 value) => (ushort)value, (ushort value) => (CompiledModelTestBase.EnumU16)value)))), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonUInt16ReaderWriter.Instance, new ValueConverter( @@ -8526,11 +9774,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: UShortTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v), providerValueComparer: new ValueComparer( (ushort v1, ushort v2) => v1 == v2, @@ -8565,35 +9813,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU16AsStringCollection.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU16AsStringCollection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU16AsStringCollection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>>(nullableEnumU16AsStringCollection, 145), + (InternalEntityEntry entry) => entry.ReadOriginalValue>>(nullableEnumU16AsStringCollection, 158), (InternalEntityEntry entry) => entry.GetCurrentValue>>(nullableEnumU16AsStringCollection), - (ValueBuffer valueBuffer) => valueBuffer[145]); + (ValueBuffer valueBuffer) => valueBuffer[158]); nullableEnumU16AsStringCollection.SetPropertyIndexes( - index: 145, - originalValueIndex: 145, + index: 158, + originalValueIndex: 158, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnumU16AsStringCollection.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.EnumU16>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU16)v1, (object)(CompiledModelTestBase.EnumU16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU16)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.EnumU16>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU16)v1, (object)(CompiledModelTestBase.EnumU16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU16)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter, List, CompiledModelTestBase.EnumU16>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter, CompiledModelTestBase.EnumU16>( new JsonConvertedValueReaderWriter( JsonUInt16ReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.EnumU16 value) => (ushort)value, (ushort value) => (CompiledModelTestBase.EnumU16)value)))), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter, List, CompiledModelTestBase.EnumU16>( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter, CompiledModelTestBase.EnumU16>( new JsonConvertedValueReaderWriter( JsonUInt16ReaderWriter.Instance, new ValueConverter( @@ -8602,11 +9850,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: UShortTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v), providerValueComparer: new ValueComparer( (ushort v1, ushort v2) => v1 == v2, @@ -8641,35 +9889,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU16Collection.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU16Collection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU16Collection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>>(nullableEnumU16Collection, 146), + (InternalEntityEntry entry) => entry.ReadOriginalValue>>(nullableEnumU16Collection, 159), (InternalEntityEntry entry) => entry.GetCurrentValue>>(nullableEnumU16Collection), - (ValueBuffer valueBuffer) => valueBuffer[146]); + (ValueBuffer valueBuffer) => valueBuffer[159]); nullableEnumU16Collection.SetPropertyIndexes( - index: 146, - originalValueIndex: 146, + index: 159, + originalValueIndex: 159, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnumU16Collection.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.EnumU16>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU16)v1, (object)(CompiledModelTestBase.EnumU16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU16)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.EnumU16>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU16)v1, (object)(CompiledModelTestBase.EnumU16)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU16)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU16)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter, List, CompiledModelTestBase.EnumU16>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter, CompiledModelTestBase.EnumU16>( new JsonConvertedValueReaderWriter( JsonUInt16ReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.EnumU16 value) => (ushort)value, (ushort value) => (CompiledModelTestBase.EnumU16)value)))), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter, List, CompiledModelTestBase.EnumU16>( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter, CompiledModelTestBase.EnumU16>( new JsonConvertedValueReaderWriter( JsonUInt16ReaderWriter.Instance, new ValueConverter( @@ -8678,11 +9926,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: UShortTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU16 v1, CompiledModelTestBase.EnumU16 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU16 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU16 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU16 v) => v), providerValueComparer: new ValueComparer( (ushort v1, ushort v2) => v1 == v2, @@ -8718,23 +9966,23 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU32.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU32((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU32((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableEnumU32, 147), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableEnumU32, 160), (InternalEntityEntry entry) => entry.GetCurrentValue>(nullableEnumU32), - (ValueBuffer valueBuffer) => valueBuffer[147]); + (ValueBuffer valueBuffer) => valueBuffer[160]); nullableEnumU32.SetPropertyIndexes( - index: 147, - originalValueIndex: 147, + index: 160, + originalValueIndex: 160, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnumU32.TypeMapping = UIntTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU32)v1, (object)(CompiledModelTestBase.EnumU32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU32)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU32)v1, (object)(CompiledModelTestBase.EnumU32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU32)v : default(Nullable)), providerValueComparer: new ValueComparer( (uint v1, uint v2) => v1 == v2, @@ -8769,35 +10017,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU32Array.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU32Array((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU32Array((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableEnumU32Array, 148), + (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableEnumU32Array, 161), (InternalEntityEntry entry) => entry.GetCurrentValue[]>(nullableEnumU32Array), - (ValueBuffer valueBuffer) => valueBuffer[148]); + (ValueBuffer valueBuffer) => valueBuffer[161]); nullableEnumU32Array.SetPropertyIndexes( - index: 148, - originalValueIndex: 148, + index: 161, + originalValueIndex: 161, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnumU32Array.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU32)v1, (object)(CompiledModelTestBase.EnumU32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU32)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU32)v1, (object)(CompiledModelTestBase.EnumU32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU32)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonUInt32ReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.EnumU32 value) => (uint)value, (uint value) => (CompiledModelTestBase.EnumU32)value)))), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonUInt32ReaderWriter.Instance, new ValueConverter( @@ -8806,11 +10054,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: UIntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v), providerValueComparer: new ValueComparer( (uint v1, uint v2) => v1 == v2, @@ -8846,23 +10094,23 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU32AsString.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU32AsString((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU32AsString((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableEnumU32AsString, 149), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableEnumU32AsString, 162), (InternalEntityEntry entry) => entry.GetCurrentValue>(nullableEnumU32AsString), - (ValueBuffer valueBuffer) => valueBuffer[149]); + (ValueBuffer valueBuffer) => valueBuffer[162]); nullableEnumU32AsString.SetPropertyIndexes( - index: 149, - originalValueIndex: 149, + index: 162, + originalValueIndex: 162, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnumU32AsString.TypeMapping = UIntTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU32)v1, (object)(CompiledModelTestBase.EnumU32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU32)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU32)v1, (object)(CompiledModelTestBase.EnumU32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU32)v : default(Nullable)), providerValueComparer: new ValueComparer( (uint v1, uint v2) => v1 == v2, @@ -8897,35 +10145,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU32AsStringArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU32AsStringArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU32AsStringArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableEnumU32AsStringArray, 150), + (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableEnumU32AsStringArray, 163), (InternalEntityEntry entry) => entry.GetCurrentValue[]>(nullableEnumU32AsStringArray), - (ValueBuffer valueBuffer) => valueBuffer[150]); + (ValueBuffer valueBuffer) => valueBuffer[163]); nullableEnumU32AsStringArray.SetPropertyIndexes( - index: 150, - originalValueIndex: 150, + index: 163, + originalValueIndex: 163, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnumU32AsStringArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU32)v1, (object)(CompiledModelTestBase.EnumU32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU32)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU32)v1, (object)(CompiledModelTestBase.EnumU32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU32)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonUInt32ReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.EnumU32 value) => (uint)value, (uint value) => (CompiledModelTestBase.EnumU32)value)))), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonUInt32ReaderWriter.Instance, new ValueConverter( @@ -8934,11 +10182,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: UIntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v), providerValueComparer: new ValueComparer( (uint v1, uint v2) => v1 == v2, @@ -8973,35 +10221,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU32AsStringCollection.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU32AsStringCollection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU32AsStringCollection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>>(nullableEnumU32AsStringCollection, 151), + (InternalEntityEntry entry) => entry.ReadOriginalValue>>(nullableEnumU32AsStringCollection, 164), (InternalEntityEntry entry) => entry.GetCurrentValue>>(nullableEnumU32AsStringCollection), - (ValueBuffer valueBuffer) => valueBuffer[151]); + (ValueBuffer valueBuffer) => valueBuffer[164]); nullableEnumU32AsStringCollection.SetPropertyIndexes( - index: 151, - originalValueIndex: 151, + index: 164, + originalValueIndex: 164, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnumU32AsStringCollection.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.EnumU32>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU32)v1, (object)(CompiledModelTestBase.EnumU32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU32)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.EnumU32>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU32)v1, (object)(CompiledModelTestBase.EnumU32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU32)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter, List, CompiledModelTestBase.EnumU32>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter, CompiledModelTestBase.EnumU32>( new JsonConvertedValueReaderWriter( JsonUInt32ReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.EnumU32 value) => (uint)value, (uint value) => (CompiledModelTestBase.EnumU32)value)))), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter, List, CompiledModelTestBase.EnumU32>( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter, CompiledModelTestBase.EnumU32>( new JsonConvertedValueReaderWriter( JsonUInt32ReaderWriter.Instance, new ValueConverter( @@ -9010,11 +10258,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: UIntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v), providerValueComparer: new ValueComparer( (uint v1, uint v2) => v1 == v2, @@ -9049,35 +10297,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU32Collection.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU32Collection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU32Collection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>>(nullableEnumU32Collection, 152), + (InternalEntityEntry entry) => entry.ReadOriginalValue>>(nullableEnumU32Collection, 165), (InternalEntityEntry entry) => entry.GetCurrentValue>>(nullableEnumU32Collection), - (ValueBuffer valueBuffer) => valueBuffer[152]); + (ValueBuffer valueBuffer) => valueBuffer[165]); nullableEnumU32Collection.SetPropertyIndexes( - index: 152, - originalValueIndex: 152, + index: 165, + originalValueIndex: 165, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnumU32Collection.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.EnumU32>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU32)v1, (object)(CompiledModelTestBase.EnumU32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU32)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.EnumU32>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU32)v1, (object)(CompiledModelTestBase.EnumU32)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU32)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU32)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter, List, CompiledModelTestBase.EnumU32>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter, CompiledModelTestBase.EnumU32>( new JsonConvertedValueReaderWriter( JsonUInt32ReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.EnumU32 value) => (uint)value, (uint value) => (CompiledModelTestBase.EnumU32)value)))), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter, List, CompiledModelTestBase.EnumU32>( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter, CompiledModelTestBase.EnumU32>( new JsonConvertedValueReaderWriter( JsonUInt32ReaderWriter.Instance, new ValueConverter( @@ -9086,11 +10334,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: UIntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU32 v1, CompiledModelTestBase.EnumU32 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU32 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU32 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU32 v) => v), providerValueComparer: new ValueComparer( (uint v1, uint v2) => v1 == v2, @@ -9126,27 +10374,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU64.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU64((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU64((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableEnumU64, 153), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableEnumU64, 166), (InternalEntityEntry entry) => entry.GetCurrentValue>(nullableEnumU64), - (ValueBuffer valueBuffer) => valueBuffer[153]); + (ValueBuffer valueBuffer) => valueBuffer[166]); nullableEnumU64.SetPropertyIndexes( - index: 153, - originalValueIndex: 153, + index: 166, + originalValueIndex: 166, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnumU64.TypeMapping = SqliteULongTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU64)v1, (object)(CompiledModelTestBase.EnumU64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU64)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU64)v1, (object)(CompiledModelTestBase.EnumU64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU64)v : default(Nullable)), providerValueComparer: new ValueComparer( (ulong v1, ulong v2) => v1 == v2, - (ulong v) => v.GetHashCode(), + (ulong v) => ((object)v).GetHashCode(), (ulong v) => v), converter: new ValueConverter( (CompiledModelTestBase.EnumU64 value) => (ulong)value, @@ -9175,35 +10423,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU64Array.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU64Array((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU64Array((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableEnumU64Array, 154), + (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableEnumU64Array, 167), (InternalEntityEntry entry) => entry.GetCurrentValue[]>(nullableEnumU64Array), - (ValueBuffer valueBuffer) => valueBuffer[154]); + (ValueBuffer valueBuffer) => valueBuffer[167]); nullableEnumU64Array.SetPropertyIndexes( - index: 154, - originalValueIndex: 154, + index: 167, + originalValueIndex: 167, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnumU64Array.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU64)v1, (object)(CompiledModelTestBase.EnumU64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU64)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU64)v1, (object)(CompiledModelTestBase.EnumU64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU64)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonUInt64ReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.EnumU64 value) => (ulong)value, (ulong value) => (CompiledModelTestBase.EnumU64)value)))), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonUInt64ReaderWriter.Instance, new ValueConverter( @@ -9212,15 +10460,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqliteULongTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), providerValueComparer: new ValueComparer( (ulong v1, ulong v2) => v1 == v2, - (ulong v) => v.GetHashCode(), + (ulong v) => ((object)v).GetHashCode(), (ulong v) => v), converter: new ValueConverter( (CompiledModelTestBase.EnumU64 value) => (ulong)value, @@ -9250,27 +10498,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU64AsString.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU64AsString((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU64AsString((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableEnumU64AsString, 155), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableEnumU64AsString, 168), (InternalEntityEntry entry) => entry.GetCurrentValue>(nullableEnumU64AsString), - (ValueBuffer valueBuffer) => valueBuffer[155]); + (ValueBuffer valueBuffer) => valueBuffer[168]); nullableEnumU64AsString.SetPropertyIndexes( - index: 155, - originalValueIndex: 155, + index: 168, + originalValueIndex: 168, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnumU64AsString.TypeMapping = SqliteULongTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU64)v1, (object)(CompiledModelTestBase.EnumU64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU64)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU64)v1, (object)(CompiledModelTestBase.EnumU64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU64)v : default(Nullable)), providerValueComparer: new ValueComparer( (ulong v1, ulong v2) => v1 == v2, - (ulong v) => v.GetHashCode(), + (ulong v) => ((object)v).GetHashCode(), (ulong v) => v), converter: new ValueConverter( (CompiledModelTestBase.EnumU64 value) => (ulong)value, @@ -9299,35 +10547,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU64AsStringArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU64AsStringArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU64AsStringArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableEnumU64AsStringArray, 156), + (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableEnumU64AsStringArray, 169), (InternalEntityEntry entry) => entry.GetCurrentValue[]>(nullableEnumU64AsStringArray), - (ValueBuffer valueBuffer) => valueBuffer[156]); + (ValueBuffer valueBuffer) => valueBuffer[169]); nullableEnumU64AsStringArray.SetPropertyIndexes( - index: 156, - originalValueIndex: 156, + index: 169, + originalValueIndex: 169, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnumU64AsStringArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU64)v1, (object)(CompiledModelTestBase.EnumU64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU64)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU64)v1, (object)(CompiledModelTestBase.EnumU64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU64)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonUInt64ReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.EnumU64 value) => (ulong)value, (ulong value) => (CompiledModelTestBase.EnumU64)value)))), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonUInt64ReaderWriter.Instance, new ValueConverter( @@ -9336,15 +10584,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqliteULongTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), providerValueComparer: new ValueComparer( (ulong v1, ulong v2) => v1 == v2, - (ulong v) => v.GetHashCode(), + (ulong v) => ((object)v).GetHashCode(), (ulong v) => v), converter: new ValueConverter( (CompiledModelTestBase.EnumU64 value) => (ulong)value, @@ -9373,35 +10621,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU64AsStringCollection.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU64AsStringCollection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU64AsStringCollection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>>(nullableEnumU64AsStringCollection, 157), + (InternalEntityEntry entry) => entry.ReadOriginalValue>>(nullableEnumU64AsStringCollection, 170), (InternalEntityEntry entry) => entry.GetCurrentValue>>(nullableEnumU64AsStringCollection), - (ValueBuffer valueBuffer) => valueBuffer[157]); + (ValueBuffer valueBuffer) => valueBuffer[170]); nullableEnumU64AsStringCollection.SetPropertyIndexes( - index: 157, - originalValueIndex: 157, + index: 170, + originalValueIndex: 170, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnumU64AsStringCollection.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.EnumU64>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU64)v1, (object)(CompiledModelTestBase.EnumU64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU64)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.EnumU64>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU64)v1, (object)(CompiledModelTestBase.EnumU64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU64)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter, List, CompiledModelTestBase.EnumU64>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter, CompiledModelTestBase.EnumU64>( new JsonConvertedValueReaderWriter( JsonUInt64ReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.EnumU64 value) => (ulong)value, (ulong value) => (CompiledModelTestBase.EnumU64)value)))), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter, List, CompiledModelTestBase.EnumU64>( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter, CompiledModelTestBase.EnumU64>( new JsonConvertedValueReaderWriter( JsonUInt64ReaderWriter.Instance, new ValueConverter( @@ -9410,15 +10658,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqliteULongTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), providerValueComparer: new ValueComparer( (ulong v1, ulong v2) => v1 == v2, - (ulong v) => v.GetHashCode(), + (ulong v) => ((object)v).GetHashCode(), (ulong v) => v), converter: new ValueConverter( (CompiledModelTestBase.EnumU64 value) => (ulong)value, @@ -9447,35 +10695,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU64Collection.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU64Collection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU64Collection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>>(nullableEnumU64Collection, 158), + (InternalEntityEntry entry) => entry.ReadOriginalValue>>(nullableEnumU64Collection, 171), (InternalEntityEntry entry) => entry.GetCurrentValue>>(nullableEnumU64Collection), - (ValueBuffer valueBuffer) => valueBuffer[158]); + (ValueBuffer valueBuffer) => valueBuffer[171]); nullableEnumU64Collection.SetPropertyIndexes( - index: 158, - originalValueIndex: 158, + index: 171, + originalValueIndex: 171, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnumU64Collection.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.EnumU64>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU64)v1, (object)(CompiledModelTestBase.EnumU64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU64)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.EnumU64>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU64)v1, (object)(CompiledModelTestBase.EnumU64)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU64)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter, List, CompiledModelTestBase.EnumU64>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter, CompiledModelTestBase.EnumU64>( new JsonConvertedValueReaderWriter( JsonUInt64ReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.EnumU64 value) => (ulong)value, (ulong value) => (CompiledModelTestBase.EnumU64)value)))), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter, List, CompiledModelTestBase.EnumU64>( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter, CompiledModelTestBase.EnumU64>( new JsonConvertedValueReaderWriter( JsonUInt64ReaderWriter.Instance, new ValueConverter( @@ -9484,15 +10732,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: SqliteULongTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU64 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU64 v) => v), providerValueComparer: new ValueComparer( (ulong v1, ulong v2) => v1 == v2, - (ulong v) => v.GetHashCode(), + (ulong v) => ((object)v).GetHashCode(), (ulong v) => v), converter: new ValueConverter( (CompiledModelTestBase.EnumU64 value) => (ulong)value, @@ -9504,6 +10752,107 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (ulong value) => (CompiledModelTestBase.EnumU64)value)))); nullableEnumU64Collection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU64Collection", "TestNamespace") }); + var nullableEnumU64NestedCollection = runtimeEntityType.AddProperty( + "NullableEnumU64NestedCollection", + typeof(CompiledModelTestBase.EnumU64?[][]), + propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("NullableEnumU64NestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + nullableEnumU64NestedCollection.SetGetter( + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU64NestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU64NestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU64NestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU64NestedCollection(instance) == null); + nullableEnumU64NestedCollection.SetSetter( + (CompiledModelTestBase.ManyTypes entity, Nullable[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU64NestedCollection(entity) = value); + nullableEnumU64NestedCollection.SetMaterializationSetter( + (CompiledModelTestBase.ManyTypes entity, Nullable[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU64NestedCollection(entity) = value); + nullableEnumU64NestedCollection.SetAccessors( + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU64NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU64NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => entry.ReadOriginalValue[][]>(nullableEnumU64NestedCollection, 172), + (InternalEntityEntry entry) => entry.GetCurrentValue[][]>(nullableEnumU64NestedCollection), + (ValueBuffer valueBuffer) => valueBuffer[172]); + nullableEnumU64NestedCollection.SetPropertyIndexes( + index: 172, + originalValueIndex: 172, + shadowIndex: -1, + relationshipIndex: -1, + storeGenerationIndex: -1); + nullableEnumU64NestedCollection.TypeMapping = SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfReferenceTypesComparer(new ListOfNullableValueTypesComparer(new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU64)v1, (object)(CompiledModelTestBase.EnumU64)v2) || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU64)v : default(Nullable)))), + keyComparer: new ListOfReferenceTypesComparer(new ListOfNullableValueTypesComparer(new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU64)v1, (object)(CompiledModelTestBase.EnumU64)v2) || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU64)v : default(Nullable)))), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfNullableStructsReaderWriter( + new JsonConvertedValueReaderWriter( + JsonUInt64ReaderWriter.Instance, + new ValueConverter( + (CompiledModelTestBase.EnumU64 value) => (ulong)value, + (ulong value) => (CompiledModelTestBase.EnumU64)value))))), + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfNullableStructsReaderWriter( + new JsonConvertedValueReaderWriter( + JsonUInt64ReaderWriter.Instance, + new ValueConverter( + (CompiledModelTestBase.EnumU64 value) => (ulong)value, + (ulong value) => (CompiledModelTestBase.EnumU64)value)))), + elementMapping: SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfNullableValueTypesComparer(new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU64)v1, (object)(CompiledModelTestBase.EnumU64)v2) || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU64)v : default(Nullable))), + keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU64)v1, (object)(CompiledModelTestBase.EnumU64)v2) || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU64)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU64)v : default(Nullable))), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter( + new JsonConvertedValueReaderWriter( + JsonUInt64ReaderWriter.Instance, + new ValueConverter( + (CompiledModelTestBase.EnumU64 value) => (ulong)value, + (ulong value) => (CompiledModelTestBase.EnumU64)value)))), + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter( + new JsonConvertedValueReaderWriter( + JsonUInt64ReaderWriter.Instance, + new ValueConverter( + (CompiledModelTestBase.EnumU64 value) => (ulong)value, + (ulong value) => (CompiledModelTestBase.EnumU64)value))), + elementMapping: SqliteULongTypeMapping.Default.Clone( + comparer: new ValueComparer( + (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => v), + keyComparer: new ValueComparer( + (CompiledModelTestBase.EnumU64 v1, CompiledModelTestBase.EnumU64 v2) => object.Equals((object)v1, (object)v2), + (CompiledModelTestBase.EnumU64 v) => ((object)v).GetHashCode(), + (CompiledModelTestBase.EnumU64 v) => v), + providerValueComparer: new ValueComparer( + (ulong v1, ulong v2) => v1 == v2, + (ulong v) => ((object)v).GetHashCode(), + (ulong v) => v), + converter: new ValueConverter( + (CompiledModelTestBase.EnumU64 value) => (ulong)value, + (ulong value) => (CompiledModelTestBase.EnumU64)value), + jsonValueReaderWriter: new JsonConvertedValueReaderWriter( + JsonUInt64ReaderWriter.Instance, + new ValueConverter( + (CompiledModelTestBase.EnumU64 value) => (ulong)value, + (ulong value) => (CompiledModelTestBase.EnumU64)value))))); + nullableEnumU64NestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU64NestedCollection", "TestNamespace") }); + var nullableEnumU8 = runtimeEntityType.AddProperty( "NullableEnumU8", typeof(CompiledModelTestBase.EnumU8?), @@ -9522,23 +10871,23 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU8.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU8((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU8((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableEnumU8, 159), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableEnumU8, 173), (InternalEntityEntry entry) => entry.GetCurrentValue>(nullableEnumU8), - (ValueBuffer valueBuffer) => valueBuffer[159]); + (ValueBuffer valueBuffer) => valueBuffer[173]); nullableEnumU8.SetPropertyIndexes( - index: 159, - originalValueIndex: 159, + index: 173, + originalValueIndex: 173, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnumU8.TypeMapping = ByteTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU8)v1, (object)(CompiledModelTestBase.EnumU8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU8)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU8)v1, (object)(CompiledModelTestBase.EnumU8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU8)v : default(Nullable)), providerValueComparer: new ValueComparer( (byte v1, byte v2) => v1 == v2, @@ -9573,35 +10922,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU8Array.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU8Array((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU8Array((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableEnumU8Array, 160), + (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableEnumU8Array, 174), (InternalEntityEntry entry) => entry.GetCurrentValue[]>(nullableEnumU8Array), - (ValueBuffer valueBuffer) => valueBuffer[160]); + (ValueBuffer valueBuffer) => valueBuffer[174]); nullableEnumU8Array.SetPropertyIndexes( - index: 160, - originalValueIndex: 160, + index: 174, + originalValueIndex: 174, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnumU8Array.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU8)v1, (object)(CompiledModelTestBase.EnumU8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU8)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU8)v1, (object)(CompiledModelTestBase.EnumU8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU8)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonByteReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.EnumU8 value) => (byte)value, (byte value) => (CompiledModelTestBase.EnumU8)value)))), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonByteReaderWriter.Instance, new ValueConverter( @@ -9610,11 +10959,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: ByteTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v), providerValueComparer: new ValueComparer( (byte v1, byte v2) => v1 == v2, @@ -9650,23 +10999,23 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU8AsString.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU8AsString((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU8AsString((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableEnumU8AsString, 161), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableEnumU8AsString, 175), (InternalEntityEntry entry) => entry.GetCurrentValue>(nullableEnumU8AsString), - (ValueBuffer valueBuffer) => valueBuffer[161]); + (ValueBuffer valueBuffer) => valueBuffer[175]); nullableEnumU8AsString.SetPropertyIndexes( - index: 161, - originalValueIndex: 161, + index: 175, + originalValueIndex: 175, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnumU8AsString.TypeMapping = ByteTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU8)v1, (object)(CompiledModelTestBase.EnumU8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU8)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU8)v1, (object)(CompiledModelTestBase.EnumU8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU8)v : default(Nullable)), providerValueComparer: new ValueComparer( (byte v1, byte v2) => v1 == v2, @@ -9701,35 +11050,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU8AsStringArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU8AsStringArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU8AsStringArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableEnumU8AsStringArray, 162), + (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableEnumU8AsStringArray, 176), (InternalEntityEntry entry) => entry.GetCurrentValue[]>(nullableEnumU8AsStringArray), - (ValueBuffer valueBuffer) => valueBuffer[162]); + (ValueBuffer valueBuffer) => valueBuffer[176]); nullableEnumU8AsStringArray.SetPropertyIndexes( - index: 162, - originalValueIndex: 162, + index: 176, + originalValueIndex: 176, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnumU8AsStringArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU8)v1, (object)(CompiledModelTestBase.EnumU8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU8)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU8)v1, (object)(CompiledModelTestBase.EnumU8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU8)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonByteReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.EnumU8 value) => (byte)value, (byte value) => (CompiledModelTestBase.EnumU8)value)))), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter( new JsonConvertedValueReaderWriter( JsonByteReaderWriter.Instance, new ValueConverter( @@ -9738,11 +11087,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: ByteTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v), providerValueComparer: new ValueComparer( (byte v1, byte v2) => v1 == v2, @@ -9777,35 +11126,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU8AsStringCollection.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU8AsStringCollection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU8AsStringCollection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>>(nullableEnumU8AsStringCollection, 163), + (InternalEntityEntry entry) => entry.ReadOriginalValue>>(nullableEnumU8AsStringCollection, 177), (InternalEntityEntry entry) => entry.GetCurrentValue>>(nullableEnumU8AsStringCollection), - (ValueBuffer valueBuffer) => valueBuffer[163]); + (ValueBuffer valueBuffer) => valueBuffer[177]); nullableEnumU8AsStringCollection.SetPropertyIndexes( - index: 163, - originalValueIndex: 163, + index: 177, + originalValueIndex: 177, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnumU8AsStringCollection.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.EnumU8>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU8)v1, (object)(CompiledModelTestBase.EnumU8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU8)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.EnumU8>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU8)v1, (object)(CompiledModelTestBase.EnumU8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU8)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter, List, CompiledModelTestBase.EnumU8>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter, CompiledModelTestBase.EnumU8>( new JsonConvertedValueReaderWriter( JsonByteReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.EnumU8 value) => (byte)value, (byte value) => (CompiledModelTestBase.EnumU8)value)))), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter, List, CompiledModelTestBase.EnumU8>( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter, CompiledModelTestBase.EnumU8>( new JsonConvertedValueReaderWriter( JsonByteReaderWriter.Instance, new ValueConverter( @@ -9814,11 +11163,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: ByteTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v), providerValueComparer: new ValueComparer( (byte v1, byte v2) => v1 == v2, @@ -9853,35 +11202,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableEnumU8Collection.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU8Collection((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU8Collection((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>>(nullableEnumU8Collection, 164), + (InternalEntityEntry entry) => entry.ReadOriginalValue>>(nullableEnumU8Collection, 178), (InternalEntityEntry entry) => entry.GetCurrentValue>>(nullableEnumU8Collection), - (ValueBuffer valueBuffer) => valueBuffer[164]); + (ValueBuffer valueBuffer) => valueBuffer[178]); nullableEnumU8Collection.SetPropertyIndexes( - index: 164, - originalValueIndex: 164, + index: 178, + originalValueIndex: 178, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableEnumU8Collection.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.EnumU8>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU8)v1, (object)(CompiledModelTestBase.EnumU8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU8)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer, CompiledModelTestBase.EnumU8>(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.EnumU8)v1, (object)(CompiledModelTestBase.EnumU8)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.EnumU8)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.EnumU8)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter, List, CompiledModelTestBase.EnumU8>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter, CompiledModelTestBase.EnumU8>( new JsonConvertedValueReaderWriter( JsonByteReaderWriter.Instance, new ValueConverter( (CompiledModelTestBase.EnumU8 value) => (byte)value, (byte value) => (CompiledModelTestBase.EnumU8)value)))), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter, List, CompiledModelTestBase.EnumU8>( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter, CompiledModelTestBase.EnumU8>( new JsonConvertedValueReaderWriter( JsonByteReaderWriter.Instance, new ValueConverter( @@ -9890,11 +11239,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas elementMapping: ByteTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.EnumU8 v1, CompiledModelTestBase.EnumU8 v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.EnumU8 v) => v.GetHashCode(), + (CompiledModelTestBase.EnumU8 v) => ((object)v).GetHashCode(), (CompiledModelTestBase.EnumU8 v) => v), providerValueComparer: new ValueComparer( (byte v1, byte v2) => v1 == v2, @@ -9930,27 +11279,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableFloat.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableFloat((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableFloat((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableFloat, 165), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableFloat, 179), (InternalEntityEntry entry) => entry.GetCurrentValue>(nullableFloat), - (ValueBuffer valueBuffer) => valueBuffer[165]); + (ValueBuffer valueBuffer) => valueBuffer[179]); nullableFloat.SetPropertyIndexes( - index: 165, - originalValueIndex: 165, + index: 179, + originalValueIndex: 179, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableFloat.TypeMapping = FloatTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && ((float)v1).Equals((float)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((float)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(float)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(float)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && ((float)v1).Equals((float)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((float)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(float)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(float)v : default(Nullable)), providerValueComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && ((float)v1).Equals((float)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((float)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(float)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(float)v : default(Nullable)), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "REAL")); @@ -9973,44 +11322,44 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableFloatArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableFloatArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableFloatArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableFloatArray, 166), + (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableFloatArray, 180), (InternalEntityEntry entry) => entry.GetCurrentValue[]>(nullableFloatArray), - (ValueBuffer valueBuffer) => valueBuffer[166]); + (ValueBuffer valueBuffer) => valueBuffer[180]); nullableFloatArray.SetPropertyIndexes( - index: 166, - originalValueIndex: 166, + index: 180, + originalValueIndex: 180, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableFloatArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && ((float)v1).Equals((float)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((float)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(float)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(float)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && ((float)v1).Equals((float)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((float)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(float)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(float)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter( JsonFloatReaderWriter.Instance)), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter( JsonFloatReaderWriter.Instance), elementMapping: FloatTypeMapping.Default.Clone( comparer: new ValueComparer( (float v1, float v2) => v1.Equals(v2), - (float v) => v.GetHashCode(), + (float v) => ((object)v).GetHashCode(), (float v) => v), keyComparer: new ValueComparer( (float v1, float v2) => v1.Equals(v2), - (float v) => v.GetHashCode(), + (float v) => ((object)v).GetHashCode(), (float v) => v), providerValueComparer: new ValueComparer( (float v1, float v2) => v1.Equals(v2), - (float v) => v.GetHashCode(), + (float v) => ((object)v).GetHashCode(), (float v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "REAL"))); @@ -10034,12 +11383,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableGuid.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableGuid((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableGuid((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableGuid, 167), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableGuid, 181), (InternalEntityEntry entry) => entry.GetCurrentValue>(nullableGuid), - (ValueBuffer valueBuffer) => valueBuffer[167]); + (ValueBuffer valueBuffer) => valueBuffer[181]); nullableGuid.SetPropertyIndexes( - index: 167, - originalValueIndex: 167, + index: 181, + originalValueIndex: 181, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); @@ -10063,35 +11412,100 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableGuidArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableGuidArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableGuidArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableGuidArray, 168), + (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableGuidArray, 182), (InternalEntityEntry entry) => entry.GetCurrentValue[]>(nullableGuidArray), - (ValueBuffer valueBuffer) => valueBuffer[168]); + (ValueBuffer valueBuffer) => valueBuffer[182]); nullableGuidArray.SetPropertyIndexes( - index: 168, - originalValueIndex: 168, + index: 182, + originalValueIndex: 182, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableGuidArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (Guid)v1 == (Guid)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((Guid)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(Guid)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(Guid)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (Guid)v1 == (Guid)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((Guid)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(Guid)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(Guid)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter( SqliteJsonGuidReaderWriter.Instance)), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter( SqliteJsonGuidReaderWriter.Instance), elementMapping: SqliteGuidTypeMapping.Default); nullableGuidArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableGuidArray", "TestNamespace") }); + var nullableGuidNestedCollection = runtimeEntityType.AddProperty( + "NullableGuidNestedCollection", + typeof(Guid?[][]), + propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("NullableGuidNestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + nullableGuidNestedCollection.SetGetter( + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableGuidNestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableGuidNestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableGuidNestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableGuidNestedCollection(instance) == null); + nullableGuidNestedCollection.SetSetter( + (CompiledModelTestBase.ManyTypes entity, Nullable[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableGuidNestedCollection(entity) = value); + nullableGuidNestedCollection.SetMaterializationSetter( + (CompiledModelTestBase.ManyTypes entity, Nullable[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableGuidNestedCollection(entity) = value); + nullableGuidNestedCollection.SetAccessors( + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableGuidNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableGuidNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => entry.ReadOriginalValue[][]>(nullableGuidNestedCollection, 183), + (InternalEntityEntry entry) => entry.GetCurrentValue[][]>(nullableGuidNestedCollection), + (ValueBuffer valueBuffer) => valueBuffer[183]); + nullableGuidNestedCollection.SetPropertyIndexes( + index: 183, + originalValueIndex: 183, + shadowIndex: -1, + relationshipIndex: -1, + storeGenerationIndex: -1); + nullableGuidNestedCollection.TypeMapping = SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfReferenceTypesComparer(new ListOfNullableValueTypesComparer(new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (Guid)v1 == (Guid)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((object)(Guid)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(Guid)v : default(Nullable)))), + keyComparer: new ListOfReferenceTypesComparer(new ListOfNullableValueTypesComparer(new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (Guid)v1 == (Guid)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((object)(Guid)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(Guid)v : default(Nullable)))), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfNullableStructsReaderWriter( + SqliteJsonGuidReaderWriter.Instance))), + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfNullableStructsReaderWriter( + SqliteJsonGuidReaderWriter.Instance)), + elementMapping: SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfNullableValueTypesComparer(new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (Guid)v1 == (Guid)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((object)(Guid)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(Guid)v : default(Nullable))), + keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (Guid)v1 == (Guid)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((object)(Guid)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(Guid)v : default(Nullable))), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter( + SqliteJsonGuidReaderWriter.Instance)), + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter( + SqliteJsonGuidReaderWriter.Instance), + elementMapping: SqliteGuidTypeMapping.Default)); + nullableGuidNestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableGuidNestedCollection", "TestNamespace") }); + var nullableIPAddress = runtimeEntityType.AddProperty( "NullableIPAddress", typeof(IPAddress), @@ -10110,37 +11524,37 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableIPAddress.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableIPAddress((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableIPAddress((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(nullableIPAddress, 169), + (InternalEntityEntry entry) => entry.ReadOriginalValue(nullableIPAddress, 184), (InternalEntityEntry entry) => entry.GetCurrentValue(nullableIPAddress), - (ValueBuffer valueBuffer) => valueBuffer[169]); + (ValueBuffer valueBuffer) => valueBuffer[184]); nullableIPAddress.SetPropertyIndexes( - index: 169, - originalValueIndex: 169, + index: 184, + originalValueIndex: 184, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableIPAddress.TypeMapping = SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), keyComparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( size: 45), converter: new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)))); nullableIPAddress.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableIPAddress", "TestNamespace") }); @@ -10161,62 +11575,62 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableIPAddressArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableIPAddressArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableIPAddressArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(nullableIPAddressArray, 170), + (InternalEntityEntry entry) => entry.ReadOriginalValue(nullableIPAddressArray, 185), (InternalEntityEntry entry) => entry.GetCurrentValue(nullableIPAddressArray), - (ValueBuffer valueBuffer) => valueBuffer[170]); + (ValueBuffer valueBuffer) => valueBuffer[185]); nullableIPAddressArray.SetPropertyIndexes( - index: 170, - originalValueIndex: 170, + index: 185, + originalValueIndex: 185, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableIPAddressArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfReferenceTypesComparer(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)))), elementMapping: SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), keyComparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( size: 45), converter: new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))); nullableIPAddressArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableIPAddressArray", "TestNamespace") }); @@ -10238,12 +11652,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableInt16.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt16((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt16((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableInt16, 171), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableInt16, 186), (InternalEntityEntry entry) => entry.GetCurrentValue>(nullableInt16), - (ValueBuffer valueBuffer) => valueBuffer[171]); + (ValueBuffer valueBuffer) => valueBuffer[186]); nullableInt16.SetPropertyIndexes( - index: 171, - originalValueIndex: 171, + index: 186, + originalValueIndex: 186, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); @@ -10281,31 +11695,31 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableInt16Array.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt16Array((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt16Array((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableInt16Array, 172), + (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableInt16Array, 187), (InternalEntityEntry entry) => entry.GetCurrentValue[]>(nullableInt16Array), - (ValueBuffer valueBuffer) => valueBuffer[172]); + (ValueBuffer valueBuffer) => valueBuffer[187]); nullableInt16Array.SetPropertyIndexes( - index: 172, - originalValueIndex: 172, + index: 187, + originalValueIndex: 187, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableInt16Array.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, (Nullable v) => v.HasValue ? (int)(short)v : 0, (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (short)v1 == (short)v2 || !v1.HasValue && !v2.HasValue, (Nullable v) => v.HasValue ? (int)(short)v : 0, (Nullable v) => v.HasValue ? (Nullable)(short)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter( JsonInt16ReaderWriter.Instance)), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter( JsonInt16ReaderWriter.Instance), elementMapping: ShortTypeMapping.Default.Clone( comparer: new ValueComparer( @@ -10342,12 +11756,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableInt32.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt32((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt32((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableInt32, 173), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableInt32, 188), (InternalEntityEntry entry) => entry.GetCurrentValue>(nullableInt32), - (ValueBuffer valueBuffer) => valueBuffer[173]); + (ValueBuffer valueBuffer) => valueBuffer[188]); nullableInt32.SetPropertyIndexes( - index: 173, - originalValueIndex: 173, + index: 188, + originalValueIndex: 188, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); @@ -10385,31 +11799,31 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableInt32Array.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt32Array((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt32Array((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableInt32Array, 174), + (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableInt32Array, 189), (InternalEntityEntry entry) => entry.GetCurrentValue[]>(nullableInt32Array), - (ValueBuffer valueBuffer) => valueBuffer[174]); + (ValueBuffer valueBuffer) => valueBuffer[189]); nullableInt32Array.SetPropertyIndexes( - index: 174, - originalValueIndex: 174, + index: 189, + originalValueIndex: 189, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableInt32Array.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, (Nullable v) => v.HasValue ? (int)v : 0, (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, (Nullable v) => v.HasValue ? (int)v : 0, (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter( JsonInt32ReaderWriter.Instance)), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter( JsonInt32ReaderWriter.Instance), elementMapping: IntTypeMapping.Default.Clone( comparer: new ValueComparer( @@ -10428,6 +11842,85 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas storeTypeName: "INTEGER"))); nullableInt32Array.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt32Array", "TestNamespace") }); + var nullableInt32NestedCollection = runtimeEntityType.AddProperty( + "NullableInt32NestedCollection", + typeof(int?[][]), + propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("NullableInt32NestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + nullableInt32NestedCollection.SetGetter( + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt32NestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt32NestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt32NestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt32NestedCollection(instance) == null); + nullableInt32NestedCollection.SetSetter( + (CompiledModelTestBase.ManyTypes entity, Nullable[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt32NestedCollection(entity) = value); + nullableInt32NestedCollection.SetMaterializationSetter( + (CompiledModelTestBase.ManyTypes entity, Nullable[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt32NestedCollection(entity) = value); + nullableInt32NestedCollection.SetAccessors( + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt32NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt32NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => entry.ReadOriginalValue[][]>(nullableInt32NestedCollection, 190), + (InternalEntityEntry entry) => entry.GetCurrentValue[][]>(nullableInt32NestedCollection), + (ValueBuffer valueBuffer) => valueBuffer[190]); + nullableInt32NestedCollection.SetPropertyIndexes( + index: 190, + originalValueIndex: 190, + shadowIndex: -1, + relationshipIndex: -1, + storeGenerationIndex: -1); + nullableInt32NestedCollection.TypeMapping = SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfReferenceTypesComparer(new ListOfNullableValueTypesComparer(new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable)))), + keyComparer: new ListOfReferenceTypesComparer(new ListOfNullableValueTypesComparer(new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable)))), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfNullableStructsReaderWriter( + JsonInt32ReaderWriter.Instance))), + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfNullableStructsReaderWriter( + JsonInt32ReaderWriter.Instance)), + elementMapping: SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfNullableValueTypesComparer(new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable))), + keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (int)v1 == (int)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(int)v : default(Nullable))), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter( + JsonInt32ReaderWriter.Instance)), + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter( + JsonInt32ReaderWriter.Instance), + elementMapping: IntTypeMapping.Default.Clone( + comparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + keyComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + providerValueComparer: new ValueComparer( + (int v1, int v2) => v1 == v2, + (int v) => v, + (int v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "INTEGER")))); + nullableInt32NestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt32NestedCollection", "TestNamespace") }); + var nullableInt64 = runtimeEntityType.AddProperty( "NullableInt64", typeof(long?), @@ -10446,27 +11939,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableInt64.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt64((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt64((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableInt64, 175), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableInt64, 191), (InternalEntityEntry entry) => entry.GetCurrentValue>(nullableInt64), - (ValueBuffer valueBuffer) => valueBuffer[175]); + (ValueBuffer valueBuffer) => valueBuffer[191]); nullableInt64.SetPropertyIndexes( - index: 175, - originalValueIndex: 175, + index: 191, + originalValueIndex: 191, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableInt64.TypeMapping = LongTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable)), providerValueComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable)), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "INTEGER")); @@ -10489,49 +11982,149 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableInt64Array.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt64Array((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt64Array((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableInt64Array, 176), + (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableInt64Array, 192), (InternalEntityEntry entry) => entry.GetCurrentValue[]>(nullableInt64Array), - (ValueBuffer valueBuffer) => valueBuffer[176]); + (ValueBuffer valueBuffer) => valueBuffer[192]); nullableInt64Array.SetPropertyIndexes( - index: 176, - originalValueIndex: 176, + index: 192, + originalValueIndex: 192, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableInt64Array.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter( JsonInt64ReaderWriter.Instance)), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter( JsonInt64ReaderWriter.Instance), elementMapping: LongTypeMapping.Default.Clone( comparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), keyComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "INTEGER"))); nullableInt64Array.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt64Array", "TestNamespace") }); + var nullableInt64NestedCollection = runtimeEntityType.AddProperty( + "NullableInt64NestedCollection", + typeof(List), + propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("NullableInt64NestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + nullableInt64NestedCollection.SetGetter( + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt64NestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt64NestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt64NestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt64NestedCollection(instance) == null); + nullableInt64NestedCollection.SetSetter( + (CompiledModelTestBase.ManyTypes entity, List[][]> value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt64NestedCollection(entity) = value); + nullableInt64NestedCollection.SetMaterializationSetter( + (CompiledModelTestBase.ManyTypes entity, List[][]> value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt64NestedCollection(entity) = value); + nullableInt64NestedCollection.SetAccessors( + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt64NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt64NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => entry.ReadOriginalValue[][]>>(nullableInt64NestedCollection, 193), + (InternalEntityEntry entry) => entry.GetCurrentValue[][]>>(nullableInt64NestedCollection), + (ValueBuffer valueBuffer) => valueBuffer[193]); + nullableInt64NestedCollection.SetPropertyIndexes( + index: 193, + originalValueIndex: 193, + shadowIndex: -1, + relationshipIndex: -1, + storeGenerationIndex: -1); + nullableInt64NestedCollection.TypeMapping = SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfReferenceTypesComparer, long?[][]>(new ListOfReferenceTypesComparer(new ListOfNullableValueTypesComparer(new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable))))), + keyComparer: new ListOfReferenceTypesComparer, long?[][]>(new ListOfReferenceTypesComparer(new ListOfNullableValueTypesComparer(new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable))))), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter, long?[][]>( + new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfNullableStructsReaderWriter( + JsonInt64ReaderWriter.Instance)))), + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter, long?[][]>( + new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfNullableStructsReaderWriter( + JsonInt64ReaderWriter.Instance))), + elementMapping: SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfReferenceTypesComparer(new ListOfNullableValueTypesComparer(new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable)))), + keyComparer: new ListOfReferenceTypesComparer(new ListOfNullableValueTypesComparer(new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable)))), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfNullableStructsReaderWriter( + JsonInt64ReaderWriter.Instance))), + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfNullableStructsReaderWriter( + JsonInt64ReaderWriter.Instance)), + elementMapping: SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfNullableValueTypesComparer(new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable))), + keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable))), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter( + JsonInt64ReaderWriter.Instance)), + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter( + JsonInt64ReaderWriter.Instance), + elementMapping: LongTypeMapping.Default.Clone( + comparer: new ValueComparer( + (long v1, long v2) => v1 == v2, + (long v) => ((object)v).GetHashCode(), + (long v) => v), + keyComparer: new ValueComparer( + (long v1, long v2) => v1 == v2, + (long v) => ((object)v).GetHashCode(), + (long v) => v), + providerValueComparer: new ValueComparer( + (long v1, long v2) => v1 == v2, + (long v) => ((object)v).GetHashCode(), + (long v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "INTEGER"))))); + nullableInt64NestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt64NestedCollection", "TestNamespace") }); + var nullableInt8 = runtimeEntityType.AddProperty( "NullableInt8", typeof(sbyte?), @@ -10550,12 +12143,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableInt8.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt8((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt8((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableInt8, 177), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableInt8, 194), (InternalEntityEntry entry) => entry.GetCurrentValue>(nullableInt8), - (ValueBuffer valueBuffer) => valueBuffer[177]); + (ValueBuffer valueBuffer) => valueBuffer[194]); nullableInt8.SetPropertyIndexes( - index: 177, - originalValueIndex: 177, + index: 194, + originalValueIndex: 194, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); @@ -10593,31 +12186,31 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableInt8Array.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt8Array((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt8Array((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableInt8Array, 178), + (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableInt8Array, 195), (InternalEntityEntry entry) => entry.GetCurrentValue[]>(nullableInt8Array), - (ValueBuffer valueBuffer) => valueBuffer[178]); + (ValueBuffer valueBuffer) => valueBuffer[195]); nullableInt8Array.SetPropertyIndexes( - index: 178, - originalValueIndex: 178, + index: 195, + originalValueIndex: 195, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableInt8Array.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (sbyte)v1 == (sbyte)v2 || !v1.HasValue && !v2.HasValue, (Nullable v) => v.HasValue ? (int)(sbyte)v : 0, (Nullable v) => v.HasValue ? (Nullable)(sbyte)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (sbyte)v1 == (sbyte)v2 || !v1.HasValue && !v2.HasValue, (Nullable v) => v.HasValue ? (int)(sbyte)v : 0, (Nullable v) => v.HasValue ? (Nullable)(sbyte)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter( JsonSByteReaderWriter.Instance)), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter( JsonSByteReaderWriter.Instance), elementMapping: SByteTypeMapping.Default.Clone( comparer: new ValueComparer( @@ -10654,37 +12247,37 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullablePhysicalAddress.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullablePhysicalAddress((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullablePhysicalAddress((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(nullablePhysicalAddress, 179), + (InternalEntityEntry entry) => entry.ReadOriginalValue(nullablePhysicalAddress, 196), (InternalEntityEntry entry) => entry.GetCurrentValue(nullablePhysicalAddress), - (ValueBuffer valueBuffer) => valueBuffer[179]); + (ValueBuffer valueBuffer) => valueBuffer[196]); nullablePhysicalAddress.SetPropertyIndexes( - index: 179, - originalValueIndex: 179, + index: 196, + originalValueIndex: 196, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullablePhysicalAddress.TypeMapping = SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), - (PhysicalAddress v) => v.GetHashCode(), + (PhysicalAddress v) => ((object)v).GetHashCode(), (PhysicalAddress v) => v), keyComparer: new ValueComparer( (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), - (PhysicalAddress v) => v.GetHashCode(), + (PhysicalAddress v) => ((object)v).GetHashCode(), (PhysicalAddress v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( size: 20), converter: new ValueConverter( - (PhysicalAddress v) => v.ToString(), + (PhysicalAddress v) => ((object)v).ToString(), (string v) => PhysicalAddress.Parse(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (PhysicalAddress v) => v.ToString(), + (PhysicalAddress v) => ((object)v).ToString(), (string v) => PhysicalAddress.Parse(v)))); nullablePhysicalAddress.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullablePhysicalAddress", "TestNamespace") }); @@ -10705,65 +12298,197 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullablePhysicalAddressArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullablePhysicalAddressArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullablePhysicalAddressArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(nullablePhysicalAddressArray, 180), + (InternalEntityEntry entry) => entry.ReadOriginalValue(nullablePhysicalAddressArray, 197), (InternalEntityEntry entry) => entry.GetCurrentValue(nullablePhysicalAddressArray), - (ValueBuffer valueBuffer) => valueBuffer[180]); + (ValueBuffer valueBuffer) => valueBuffer[197]); nullablePhysicalAddressArray.SetPropertyIndexes( - index: 180, - originalValueIndex: 180, + index: 197, + originalValueIndex: 197, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullablePhysicalAddressArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfReferenceTypesComparer(new ValueComparer( (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), - (PhysicalAddress v) => v.GetHashCode(), + (PhysicalAddress v) => ((object)v).GetHashCode(), (PhysicalAddress v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), - (PhysicalAddress v) => v.GetHashCode(), + (PhysicalAddress v) => ((object)v).GetHashCode(), (PhysicalAddress v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (PhysicalAddress v) => v.ToString(), + (PhysicalAddress v) => ((object)v).ToString(), (string v) => PhysicalAddress.Parse(v))))), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (PhysicalAddress v) => v.ToString(), + (PhysicalAddress v) => ((object)v).ToString(), (string v) => PhysicalAddress.Parse(v)))), elementMapping: SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), - (PhysicalAddress v) => v.GetHashCode(), + (PhysicalAddress v) => ((object)v).GetHashCode(), (PhysicalAddress v) => v), keyComparer: new ValueComparer( (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), - (PhysicalAddress v) => v.GetHashCode(), + (PhysicalAddress v) => ((object)v).GetHashCode(), (PhysicalAddress v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( size: 20), converter: new ValueConverter( - (PhysicalAddress v) => v.ToString(), + (PhysicalAddress v) => ((object)v).ToString(), (string v) => PhysicalAddress.Parse(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (PhysicalAddress v) => v.ToString(), + (PhysicalAddress v) => ((object)v).ToString(), (string v) => PhysicalAddress.Parse(v))))); nullablePhysicalAddressArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullablePhysicalAddressArray", "TestNamespace") }); + var nullablePhysicalAddressNestedCollection = runtimeEntityType.AddProperty( + "NullablePhysicalAddressNestedCollection", + typeof(IEnumerable), + propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("NullablePhysicalAddressNestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + nullablePhysicalAddressNestedCollection.SetGetter( + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullablePhysicalAddressNestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullablePhysicalAddressNestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullablePhysicalAddressNestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullablePhysicalAddressNestedCollection(instance) == null); + nullablePhysicalAddressNestedCollection.SetSetter( + (CompiledModelTestBase.ManyTypes entity, IEnumerable value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullablePhysicalAddressNestedCollection(entity) = value); + nullablePhysicalAddressNestedCollection.SetMaterializationSetter( + (CompiledModelTestBase.ManyTypes entity, IEnumerable value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullablePhysicalAddressNestedCollection(entity) = value); + nullablePhysicalAddressNestedCollection.SetAccessors( + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullablePhysicalAddressNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullablePhysicalAddressNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullablePhysicalAddressNestedCollection, 198), + (InternalEntityEntry entry) => entry.GetCurrentValue>(nullablePhysicalAddressNestedCollection), + (ValueBuffer valueBuffer) => valueBuffer[198]); + nullablePhysicalAddressNestedCollection.SetPropertyIndexes( + index: 198, + originalValueIndex: 198, + shadowIndex: -1, + relationshipIndex: -1, + storeGenerationIndex: -1); + nullablePhysicalAddressNestedCollection.TypeMapping = SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfReferenceTypesComparer, PhysicalAddress[][]>(new ListOfReferenceTypesComparer(new ListOfReferenceTypesComparer(new ValueComparer( + (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), + (PhysicalAddress v) => ((object)v).GetHashCode(), + (PhysicalAddress v) => v)))), + keyComparer: new ListOfReferenceTypesComparer, PhysicalAddress[][]>(new ListOfReferenceTypesComparer(new ListOfReferenceTypesComparer(new ValueComparer( + (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), + (PhysicalAddress v) => ((object)v).GetHashCode(), + (PhysicalAddress v) => v)))), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter, PhysicalAddress[][]>( + new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfReferencesReaderWriter( + new JsonConvertedValueReaderWriter( + JsonStringReaderWriter.Instance, + new ValueConverter( + (PhysicalAddress v) => ((object)v).ToString(), + (string v) => PhysicalAddress.Parse(v))))))), + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter, PhysicalAddress[][]>( + new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfReferencesReaderWriter( + new JsonConvertedValueReaderWriter( + JsonStringReaderWriter.Instance, + new ValueConverter( + (PhysicalAddress v) => ((object)v).ToString(), + (string v) => PhysicalAddress.Parse(v)))))), + elementMapping: SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfReferenceTypesComparer(new ListOfReferenceTypesComparer(new ValueComparer( + (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), + (PhysicalAddress v) => ((object)v).GetHashCode(), + (PhysicalAddress v) => v))), + keyComparer: new ListOfReferenceTypesComparer(new ListOfReferenceTypesComparer(new ValueComparer( + (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), + (PhysicalAddress v) => ((object)v).GetHashCode(), + (PhysicalAddress v) => v))), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfReferencesReaderWriter( + new JsonConvertedValueReaderWriter( + JsonStringReaderWriter.Instance, + new ValueConverter( + (PhysicalAddress v) => ((object)v).ToString(), + (string v) => PhysicalAddress.Parse(v)))))), + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfReferencesReaderWriter( + new JsonConvertedValueReaderWriter( + JsonStringReaderWriter.Instance, + new ValueConverter( + (PhysicalAddress v) => ((object)v).ToString(), + (string v) => PhysicalAddress.Parse(v))))), + elementMapping: SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfReferenceTypesComparer(new ValueComparer( + (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), + (PhysicalAddress v) => ((object)v).GetHashCode(), + (PhysicalAddress v) => v)), + keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( + (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), + (PhysicalAddress v) => ((object)v).GetHashCode(), + (PhysicalAddress v) => v)), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter( + new JsonConvertedValueReaderWriter( + JsonStringReaderWriter.Instance, + new ValueConverter( + (PhysicalAddress v) => ((object)v).ToString(), + (string v) => PhysicalAddress.Parse(v))))), + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( + new JsonConvertedValueReaderWriter( + JsonStringReaderWriter.Instance, + new ValueConverter( + (PhysicalAddress v) => ((object)v).ToString(), + (string v) => PhysicalAddress.Parse(v)))), + elementMapping: SqliteStringTypeMapping.Default.Clone( + comparer: new ValueComparer( + (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), + (PhysicalAddress v) => ((object)v).GetHashCode(), + (PhysicalAddress v) => v), + keyComparer: new ValueComparer( + (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), + (PhysicalAddress v) => ((object)v).GetHashCode(), + (PhysicalAddress v) => v), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + mappingInfo: new RelationalTypeMappingInfo( + size: 20), + converter: new ValueConverter( + (PhysicalAddress v) => ((object)v).ToString(), + (string v) => PhysicalAddress.Parse(v)), + jsonValueReaderWriter: new JsonConvertedValueReaderWriter( + JsonStringReaderWriter.Instance, + new ValueConverter( + (PhysicalAddress v) => ((object)v).ToString(), + (string v) => PhysicalAddress.Parse(v))))))); + nullablePhysicalAddressNestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullablePhysicalAddressNestedCollection", "TestNamespace") }); + var nullableString = runtimeEntityType.AddProperty( "NullableString", typeof(string), @@ -10782,12 +12507,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableString.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableString((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableString((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(nullableString, 181), + (InternalEntityEntry entry) => entry.ReadOriginalValue(nullableString, 199), (InternalEntityEntry entry) => entry.GetCurrentValue(nullableString), - (ValueBuffer valueBuffer) => valueBuffer[181]); + (ValueBuffer valueBuffer) => valueBuffer[199]); nullableString.SetPropertyIndexes( - index: 181, - originalValueIndex: 181, + index: 199, + originalValueIndex: 199, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); @@ -10811,35 +12536,100 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableStringArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableStringArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableStringArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(nullableStringArray, 182), + (InternalEntityEntry entry) => entry.ReadOriginalValue(nullableStringArray, 200), (InternalEntityEntry entry) => entry.GetCurrentValue(nullableStringArray), - (ValueBuffer valueBuffer) => valueBuffer[182]); + (ValueBuffer valueBuffer) => valueBuffer[200]); nullableStringArray.SetPropertyIndexes( - index: 182, - originalValueIndex: 182, + index: 200, + originalValueIndex: 200, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableStringArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfReferenceTypesComparer(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter( JsonStringReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( JsonStringReaderWriter.Instance), elementMapping: SqliteStringTypeMapping.Default); nullableStringArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableStringArray", "TestNamespace") }); + var nullableStringNestedCollection = runtimeEntityType.AddProperty( + "NullableStringNestedCollection", + typeof(string[][]), + propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("NullableStringNestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + nullableStringNestedCollection.SetGetter( + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableStringNestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableStringNestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableStringNestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableStringNestedCollection(instance) == null); + nullableStringNestedCollection.SetSetter( + (CompiledModelTestBase.ManyTypes entity, string[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableStringNestedCollection(entity) = value); + nullableStringNestedCollection.SetMaterializationSetter( + (CompiledModelTestBase.ManyTypes entity, string[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableStringNestedCollection(entity) = value); + nullableStringNestedCollection.SetAccessors( + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableStringNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableStringNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => entry.ReadOriginalValue(nullableStringNestedCollection, 201), + (InternalEntityEntry entry) => entry.GetCurrentValue(nullableStringNestedCollection), + (ValueBuffer valueBuffer) => valueBuffer[201]); + nullableStringNestedCollection.SetPropertyIndexes( + index: 201, + originalValueIndex: 201, + shadowIndex: -1, + relationshipIndex: -1, + storeGenerationIndex: -1); + nullableStringNestedCollection.TypeMapping = SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfReferenceTypesComparer(new ListOfReferenceTypesComparer(new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v))), + keyComparer: new ListOfReferenceTypesComparer(new ListOfReferenceTypesComparer(new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v))), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfReferencesReaderWriter( + JsonStringReaderWriter.Instance))), + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfReferencesReaderWriter( + JsonStringReaderWriter.Instance)), + elementMapping: SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfReferenceTypesComparer(new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v)), + keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v)), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter( + JsonStringReaderWriter.Instance)), + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( + JsonStringReaderWriter.Instance), + elementMapping: SqliteStringTypeMapping.Default)); + nullableStringNestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableStringNestedCollection", "TestNamespace") }); + var nullableTimeOnly = runtimeEntityType.AddProperty( "NullableTimeOnly", typeof(TimeOnly?), @@ -10858,12 +12648,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableTimeOnly.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableTimeOnly((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableTimeOnly((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableTimeOnly, 183), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableTimeOnly, 202), (InternalEntityEntry entry) => entry.GetCurrentValue>(nullableTimeOnly), - (ValueBuffer valueBuffer) => valueBuffer[183]); + (ValueBuffer valueBuffer) => valueBuffer[202]); nullableTimeOnly.SetPropertyIndexes( - index: 183, - originalValueIndex: 183, + index: 202, + originalValueIndex: 202, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); @@ -10887,31 +12677,31 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableTimeOnlyArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableTimeOnlyArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableTimeOnlyArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableTimeOnlyArray, 184), + (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableTimeOnlyArray, 203), (InternalEntityEntry entry) => entry.GetCurrentValue[]>(nullableTimeOnlyArray), - (ValueBuffer valueBuffer) => valueBuffer[184]); + (ValueBuffer valueBuffer) => valueBuffer[203]); nullableTimeOnlyArray.SetPropertyIndexes( - index: 184, - originalValueIndex: 184, + index: 203, + originalValueIndex: 203, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableTimeOnlyArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (TimeOnly)v1 == (TimeOnly)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((TimeOnly)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(TimeOnly)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(TimeOnly)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (TimeOnly)v1 == (TimeOnly)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((TimeOnly)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(TimeOnly)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(TimeOnly)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter( JsonTimeOnlyReaderWriter.Instance)), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter( JsonTimeOnlyReaderWriter.Instance), elementMapping: SqliteTimeOnlyTypeMapping.Default); nullableTimeOnlyArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableTimeOnlyArray", "TestNamespace") }); @@ -10934,27 +12724,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableTimeSpan.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableTimeSpan((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableTimeSpan((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableTimeSpan, 185), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableTimeSpan, 204), (InternalEntityEntry entry) => entry.GetCurrentValue>(nullableTimeSpan), - (ValueBuffer valueBuffer) => valueBuffer[185]); + (ValueBuffer valueBuffer) => valueBuffer[204]); nullableTimeSpan.SetPropertyIndexes( - index: 185, - originalValueIndex: 185, + index: 204, + originalValueIndex: 204, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableTimeSpan.TypeMapping = TimeSpanTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (TimeSpan)v1 == (TimeSpan)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((TimeSpan)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(TimeSpan)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(TimeSpan)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (TimeSpan)v1 == (TimeSpan)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((TimeSpan)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(TimeSpan)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(TimeSpan)v : default(Nullable)), providerValueComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (TimeSpan)v1 == (TimeSpan)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((TimeSpan)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(TimeSpan)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(TimeSpan)v : default(Nullable)), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "TEXT")); @@ -10977,44 +12767,44 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableTimeSpanArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableTimeSpanArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableTimeSpanArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableTimeSpanArray, 186), + (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableTimeSpanArray, 205), (InternalEntityEntry entry) => entry.GetCurrentValue[]>(nullableTimeSpanArray), - (ValueBuffer valueBuffer) => valueBuffer[186]); + (ValueBuffer valueBuffer) => valueBuffer[205]); nullableTimeSpanArray.SetPropertyIndexes( - index: 186, - originalValueIndex: 186, + index: 205, + originalValueIndex: 205, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableTimeSpanArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (TimeSpan)v1 == (TimeSpan)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((TimeSpan)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(TimeSpan)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(TimeSpan)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (TimeSpan)v1 == (TimeSpan)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((TimeSpan)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(TimeSpan)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(TimeSpan)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter( JsonTimeSpanReaderWriter.Instance)), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter( JsonTimeSpanReaderWriter.Instance), elementMapping: TimeSpanTypeMapping.Default.Clone( comparer: new ValueComparer( (TimeSpan v1, TimeSpan v2) => v1.Equals(v2), - (TimeSpan v) => v.GetHashCode(), + (TimeSpan v) => ((object)v).GetHashCode(), (TimeSpan v) => v), keyComparer: new ValueComparer( (TimeSpan v1, TimeSpan v2) => v1.Equals(v2), - (TimeSpan v) => v.GetHashCode(), + (TimeSpan v) => ((object)v).GetHashCode(), (TimeSpan v) => v), providerValueComparer: new ValueComparer( (TimeSpan v1, TimeSpan v2) => v1.Equals(v2), - (TimeSpan v) => v.GetHashCode(), + (TimeSpan v) => ((object)v).GetHashCode(), (TimeSpan v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "TEXT"))); @@ -11038,12 +12828,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableUInt16.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUInt16((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUInt16((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableUInt16, 187), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableUInt16, 206), (InternalEntityEntry entry) => entry.GetCurrentValue>(nullableUInt16), - (ValueBuffer valueBuffer) => valueBuffer[187]); + (ValueBuffer valueBuffer) => valueBuffer[206]); nullableUInt16.SetPropertyIndexes( - index: 187, - originalValueIndex: 187, + index: 206, + originalValueIndex: 206, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); @@ -11081,31 +12871,31 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableUInt16Array.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUInt16Array((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUInt16Array((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableUInt16Array, 188), + (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableUInt16Array, 207), (InternalEntityEntry entry) => entry.GetCurrentValue[]>(nullableUInt16Array), - (ValueBuffer valueBuffer) => valueBuffer[188]); + (ValueBuffer valueBuffer) => valueBuffer[207]); nullableUInt16Array.SetPropertyIndexes( - index: 188, - originalValueIndex: 188, + index: 207, + originalValueIndex: 207, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableUInt16Array.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (ushort)v1 == (ushort)v2 || !v1.HasValue && !v2.HasValue, (Nullable v) => v.HasValue ? (int)(ushort)v : 0, (Nullable v) => v.HasValue ? (Nullable)(ushort)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (ushort)v1 == (ushort)v2 || !v1.HasValue && !v2.HasValue, (Nullable v) => v.HasValue ? (int)(ushort)v : 0, (Nullable v) => v.HasValue ? (Nullable)(ushort)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter( JsonUInt16ReaderWriter.Instance)), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter( JsonUInt16ReaderWriter.Instance), elementMapping: UShortTypeMapping.Default.Clone( comparer: new ValueComparer( @@ -11142,12 +12932,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableUInt32.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUInt32((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUInt32((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableUInt32, 189), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableUInt32, 208), (InternalEntityEntry entry) => entry.GetCurrentValue>(nullableUInt32), - (ValueBuffer valueBuffer) => valueBuffer[189]); + (ValueBuffer valueBuffer) => valueBuffer[208]); nullableUInt32.SetPropertyIndexes( - index: 189, - originalValueIndex: 189, + index: 208, + originalValueIndex: 208, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); @@ -11185,31 +12975,31 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableUInt32Array.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUInt32Array((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUInt32Array((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableUInt32Array, 190), + (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableUInt32Array, 209), (InternalEntityEntry entry) => entry.GetCurrentValue[]>(nullableUInt32Array), - (ValueBuffer valueBuffer) => valueBuffer[190]); + (ValueBuffer valueBuffer) => valueBuffer[209]); nullableUInt32Array.SetPropertyIndexes( - index: 190, - originalValueIndex: 190, + index: 209, + originalValueIndex: 209, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableUInt32Array.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (uint)v1 == (uint)v2 || !v1.HasValue && !v2.HasValue, (Nullable v) => v.HasValue ? (int)(uint)v : 0, (Nullable v) => v.HasValue ? (Nullable)(uint)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (uint)v1 == (uint)v2 || !v1.HasValue && !v2.HasValue, (Nullable v) => v.HasValue ? (int)(uint)v : 0, (Nullable v) => v.HasValue ? (Nullable)(uint)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter( JsonUInt32ReaderWriter.Instance)), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter( JsonUInt32ReaderWriter.Instance), elementMapping: UIntTypeMapping.Default.Clone( comparer: new ValueComparer( @@ -11246,12 +13036,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableUInt64.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUInt64((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUInt64((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableUInt64, 191), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableUInt64, 210), (InternalEntityEntry entry) => entry.GetCurrentValue>(nullableUInt64), - (ValueBuffer valueBuffer) => valueBuffer[191]); + (ValueBuffer valueBuffer) => valueBuffer[210]); nullableUInt64.SetPropertyIndexes( - index: 191, - originalValueIndex: 191, + index: 210, + originalValueIndex: 210, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); @@ -11275,31 +13065,31 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableUInt64Array.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUInt64Array((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUInt64Array((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableUInt64Array, 192), + (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableUInt64Array, 211), (InternalEntityEntry entry) => entry.GetCurrentValue[]>(nullableUInt64Array), - (ValueBuffer valueBuffer) => valueBuffer[192]); + (ValueBuffer valueBuffer) => valueBuffer[211]); nullableUInt64Array.SetPropertyIndexes( - index: 192, - originalValueIndex: 192, + index: 211, + originalValueIndex: 211, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableUInt64Array.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (ulong)v1 == (ulong)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((ulong)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(ulong)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(ulong)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (ulong)v1 == (ulong)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((ulong)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(ulong)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(ulong)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter( JsonUInt64ReaderWriter.Instance)), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter( JsonUInt64ReaderWriter.Instance), elementMapping: SqliteULongTypeMapping.Default); nullableUInt64Array.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUInt64Array", "TestNamespace") }); @@ -11322,12 +13112,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableUInt8.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUInt8((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUInt8((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableUInt8, 193), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(nullableUInt8, 212), (InternalEntityEntry entry) => entry.GetCurrentValue>(nullableUInt8), - (ValueBuffer valueBuffer) => valueBuffer[193]); + (ValueBuffer valueBuffer) => valueBuffer[212]); nullableUInt8.SetPropertyIndexes( - index: 193, - originalValueIndex: 193, + index: 212, + originalValueIndex: 212, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); @@ -11365,31 +13155,31 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableUInt8Array.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUInt8Array((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUInt8Array((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableUInt8Array, 194), + (InternalEntityEntry entry) => entry.ReadOriginalValue[]>(nullableUInt8Array, 213), (InternalEntityEntry entry) => entry.GetCurrentValue[]>(nullableUInt8Array), - (ValueBuffer valueBuffer) => valueBuffer[194]); + (ValueBuffer valueBuffer) => valueBuffer[213]); nullableUInt8Array.SetPropertyIndexes( - index: 194, - originalValueIndex: 194, + index: 213, + originalValueIndex: 213, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableUInt8Array.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new NullableValueTypeListComparer(new ValueComparer( + comparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (byte)v1 == (byte)v2 || !v1.HasValue && !v2.HasValue, (Nullable v) => v.HasValue ? (int)(byte)v : 0, (Nullable v) => v.HasValue ? (Nullable)(byte)v : default(Nullable))), - keyComparer: new NullableValueTypeListComparer(new ValueComparer( + keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (byte)v1 == (byte)v2 || !v1.HasValue && !v2.HasValue, (Nullable v) => v.HasValue ? (int)(byte)v : 0, (Nullable v) => v.HasValue ? (Nullable)(byte)v : default(Nullable))), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonNullableStructCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter( JsonByteReaderWriter.Instance)), - jsonValueReaderWriter: new JsonNullableStructCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter( JsonByteReaderWriter.Instance), elementMapping: ByteTypeMapping.Default.Clone( comparer: new ValueComparer( @@ -11408,6 +13198,85 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas storeTypeName: "INTEGER"))); nullableUInt8Array.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUInt8Array", "TestNamespace") }); + var nullableUInt8NestedCollection = runtimeEntityType.AddProperty( + "NullableUInt8NestedCollection", + typeof(byte?[][]), + propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("NullableUInt8NestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + nullableUInt8NestedCollection.SetGetter( + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUInt8NestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUInt8NestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUInt8NestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUInt8NestedCollection(instance) == null); + nullableUInt8NestedCollection.SetSetter( + (CompiledModelTestBase.ManyTypes entity, Nullable[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUInt8NestedCollection(entity) = value); + nullableUInt8NestedCollection.SetMaterializationSetter( + (CompiledModelTestBase.ManyTypes entity, Nullable[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUInt8NestedCollection(entity) = value); + nullableUInt8NestedCollection.SetAccessors( + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUInt8NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUInt8NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => entry.ReadOriginalValue[][]>(nullableUInt8NestedCollection, 214), + (InternalEntityEntry entry) => entry.GetCurrentValue[][]>(nullableUInt8NestedCollection), + (ValueBuffer valueBuffer) => valueBuffer[214]); + nullableUInt8NestedCollection.SetPropertyIndexes( + index: 214, + originalValueIndex: 214, + shadowIndex: -1, + relationshipIndex: -1, + storeGenerationIndex: -1); + nullableUInt8NestedCollection.TypeMapping = SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfReferenceTypesComparer(new ListOfNullableValueTypesComparer(new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (byte)v1 == (byte)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(byte)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(byte)v : default(Nullable)))), + keyComparer: new ListOfReferenceTypesComparer(new ListOfNullableValueTypesComparer(new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (byte)v1 == (byte)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(byte)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(byte)v : default(Nullable)))), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfNullableStructsReaderWriter( + JsonByteReaderWriter.Instance))), + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfNullableStructsReaderWriter( + JsonByteReaderWriter.Instance)), + elementMapping: SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfNullableValueTypesComparer(new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (byte)v1 == (byte)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(byte)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(byte)v : default(Nullable))), + keyComparer: new ListOfNullableValueTypesComparer(new ValueComparer( + (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (byte)v1 == (byte)v2 || !v1.HasValue && !v2.HasValue, + (Nullable v) => v.HasValue ? (int)(byte)v : 0, + (Nullable v) => v.HasValue ? (Nullable)(byte)v : default(Nullable))), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfNullableStructsReaderWriter( + JsonByteReaderWriter.Instance)), + jsonValueReaderWriter: new JsonCollectionOfNullableStructsReaderWriter( + JsonByteReaderWriter.Instance), + elementMapping: ByteTypeMapping.Default.Clone( + comparer: new ValueComparer( + (byte v1, byte v2) => v1 == v2, + (byte v) => (int)v, + (byte v) => v), + keyComparer: new ValueComparer( + (byte v1, byte v2) => v1 == v2, + (byte v) => (int)v, + (byte v) => v), + providerValueComparer: new ValueComparer( + (byte v1, byte v2) => v1 == v2, + (byte v) => (int)v, + (byte v) => v), + mappingInfo: new RelationalTypeMappingInfo( + storeTypeName: "INTEGER")))); + nullableUInt8NestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUInt8NestedCollection", "TestNamespace") }); + var nullableUri = runtimeEntityType.AddProperty( "NullableUri", typeof(Uri), @@ -11426,35 +13295,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableUri.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUri((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUri((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(nullableUri, 195), + (InternalEntityEntry entry) => entry.ReadOriginalValue(nullableUri, 215), (InternalEntityEntry entry) => entry.GetCurrentValue(nullableUri), - (ValueBuffer valueBuffer) => valueBuffer[195]); + (ValueBuffer valueBuffer) => valueBuffer[215]); nullableUri.SetPropertyIndexes( - index: 195, - originalValueIndex: 195, + index: 215, + originalValueIndex: 215, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableUri.TypeMapping = SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (Uri v1, Uri v2) => v1 == v2, - (Uri v) => v.GetHashCode(), + (Uri v) => ((object)v).GetHashCode(), (Uri v) => v), keyComparer: new ValueComparer( (Uri v1, Uri v2) => v1 == v2, - (Uri v) => v.GetHashCode(), + (Uri v) => ((object)v).GetHashCode(), (Uri v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), converter: new ValueConverter( - (Uri v) => v.ToString(), + (Uri v) => ((object)v).ToString(), (string v) => new Uri(v, UriKind.RelativeOrAbsolute)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (Uri v) => v.ToString(), + (Uri v) => ((object)v).ToString(), (string v) => new Uri(v, UriKind.RelativeOrAbsolute)))); nullableUri.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUri", "TestNamespace") }); @@ -11475,60 +13344,60 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas nullableUriArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUriArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUriArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(nullableUriArray, 196), + (InternalEntityEntry entry) => entry.ReadOriginalValue(nullableUriArray, 216), (InternalEntityEntry entry) => entry.GetCurrentValue(nullableUriArray), - (ValueBuffer valueBuffer) => valueBuffer[196]); + (ValueBuffer valueBuffer) => valueBuffer[216]); nullableUriArray.SetPropertyIndexes( - index: 196, - originalValueIndex: 196, + index: 216, + originalValueIndex: 216, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); nullableUriArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfReferenceTypesComparer(new ValueComparer( (Uri v1, Uri v2) => v1 == v2, - (Uri v) => v.GetHashCode(), + (Uri v) => ((object)v).GetHashCode(), (Uri v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( (Uri v1, Uri v2) => v1 == v2, - (Uri v) => v.GetHashCode(), + (Uri v) => ((object)v).GetHashCode(), (Uri v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (Uri v) => v.ToString(), + (Uri v) => ((object)v).ToString(), (string v) => new Uri(v, UriKind.RelativeOrAbsolute))))), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (Uri v) => v.ToString(), + (Uri v) => ((object)v).ToString(), (string v) => new Uri(v, UriKind.RelativeOrAbsolute)))), elementMapping: SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (Uri v1, Uri v2) => v1 == v2, - (Uri v) => v.GetHashCode(), + (Uri v) => ((object)v).GetHashCode(), (Uri v) => v), keyComparer: new ValueComparer( (Uri v1, Uri v2) => v1 == v2, - (Uri v) => v.GetHashCode(), + (Uri v) => ((object)v).GetHashCode(), (Uri v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), converter: new ValueConverter( - (Uri v) => v.ToString(), + (Uri v) => ((object)v).ToString(), (string v) => new Uri(v, UriKind.RelativeOrAbsolute)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (Uri v) => v.ToString(), + (Uri v) => ((object)v).ToString(), (string v) => new Uri(v, UriKind.RelativeOrAbsolute))))); nullableUriArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUriArray", "TestNamespace") }); @@ -11549,37 +13418,37 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas physicalAddress.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_PhysicalAddress((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_PhysicalAddress((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(physicalAddress, 197), + (InternalEntityEntry entry) => entry.ReadOriginalValue(physicalAddress, 217), (InternalEntityEntry entry) => entry.GetCurrentValue(physicalAddress), - (ValueBuffer valueBuffer) => valueBuffer[197]); + (ValueBuffer valueBuffer) => valueBuffer[217]); physicalAddress.SetPropertyIndexes( - index: 197, - originalValueIndex: 197, + index: 217, + originalValueIndex: 217, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); physicalAddress.TypeMapping = SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), - (PhysicalAddress v) => v.GetHashCode(), + (PhysicalAddress v) => ((object)v).GetHashCode(), (PhysicalAddress v) => v), keyComparer: new ValueComparer( (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), - (PhysicalAddress v) => v.GetHashCode(), + (PhysicalAddress v) => ((object)v).GetHashCode(), (PhysicalAddress v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( size: 20), converter: new ValueConverter( - (PhysicalAddress v) => v.ToString(), + (PhysicalAddress v) => ((object)v).ToString(), (string v) => PhysicalAddress.Parse(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (PhysicalAddress v) => v.ToString(), + (PhysicalAddress v) => ((object)v).ToString(), (string v) => PhysicalAddress.Parse(v)))); physicalAddress.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_PhysicalAddress", "TestNamespace") }); @@ -11600,62 +13469,62 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas physicalAddressArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_PhysicalAddressArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_PhysicalAddressArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(physicalAddressArray, 198), + (InternalEntityEntry entry) => entry.ReadOriginalValue(physicalAddressArray, 218), (InternalEntityEntry entry) => entry.GetCurrentValue(physicalAddressArray), - (ValueBuffer valueBuffer) => valueBuffer[198]); + (ValueBuffer valueBuffer) => valueBuffer[218]); physicalAddressArray.SetPropertyIndexes( - index: 198, - originalValueIndex: 198, + index: 218, + originalValueIndex: 218, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); physicalAddressArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfReferenceTypesComparer(new ValueComparer( (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), - (PhysicalAddress v) => v.GetHashCode(), + (PhysicalAddress v) => ((object)v).GetHashCode(), (PhysicalAddress v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), - (PhysicalAddress v) => v.GetHashCode(), + (PhysicalAddress v) => ((object)v).GetHashCode(), (PhysicalAddress v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (PhysicalAddress v) => v.ToString(), + (PhysicalAddress v) => ((object)v).ToString(), (string v) => PhysicalAddress.Parse(v))))), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (PhysicalAddress v) => v.ToString(), + (PhysicalAddress v) => ((object)v).ToString(), (string v) => PhysicalAddress.Parse(v)))), elementMapping: SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), - (PhysicalAddress v) => v.GetHashCode(), + (PhysicalAddress v) => ((object)v).GetHashCode(), (PhysicalAddress v) => v), keyComparer: new ValueComparer( (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), - (PhysicalAddress v) => v.GetHashCode(), + (PhysicalAddress v) => ((object)v).GetHashCode(), (PhysicalAddress v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( size: 20), converter: new ValueConverter( - (PhysicalAddress v) => v.ToString(), + (PhysicalAddress v) => ((object)v).ToString(), (string v) => PhysicalAddress.Parse(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (PhysicalAddress v) => v.ToString(), + (PhysicalAddress v) => ((object)v).ToString(), (string v) => PhysicalAddress.Parse(v))))); physicalAddressArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_PhysicalAddressArray", "TestNamespace") }); @@ -11677,23 +13546,23 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas physicalAddressToBytesConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_PhysicalAddressToBytesConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_PhysicalAddressToBytesConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(physicalAddressToBytesConverterProperty, 199), + (InternalEntityEntry entry) => entry.ReadOriginalValue(physicalAddressToBytesConverterProperty, 219), (InternalEntityEntry entry) => entry.GetCurrentValue(physicalAddressToBytesConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[199]); + (ValueBuffer valueBuffer) => valueBuffer[219]); physicalAddressToBytesConverterProperty.SetPropertyIndexes( - index: 199, - originalValueIndex: 199, + index: 219, + originalValueIndex: 219, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); physicalAddressToBytesConverterProperty.TypeMapping = SqliteByteArrayTypeMapping.Default.Clone( comparer: new ValueComparer( (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), - (PhysicalAddress v) => v.GetHashCode(), + (PhysicalAddress v) => ((object)v).GetHashCode(), (PhysicalAddress v) => v), keyComparer: new ValueComparer( (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), - (PhysicalAddress v) => v.GetHashCode(), + (PhysicalAddress v) => ((object)v).GetHashCode(), (PhysicalAddress v) => v), providerValueComparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), @@ -11729,37 +13598,37 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas physicalAddressToStringConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_PhysicalAddressToStringConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_PhysicalAddressToStringConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(physicalAddressToStringConverterProperty, 200), + (InternalEntityEntry entry) => entry.ReadOriginalValue(physicalAddressToStringConverterProperty, 220), (InternalEntityEntry entry) => entry.GetCurrentValue(physicalAddressToStringConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[200]); + (ValueBuffer valueBuffer) => valueBuffer[220]); physicalAddressToStringConverterProperty.SetPropertyIndexes( - index: 200, - originalValueIndex: 200, + index: 220, + originalValueIndex: 220, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); physicalAddressToStringConverterProperty.TypeMapping = SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), - (PhysicalAddress v) => v.GetHashCode(), + (PhysicalAddress v) => ((object)v).GetHashCode(), (PhysicalAddress v) => v), keyComparer: new ValueComparer( (PhysicalAddress v1, PhysicalAddress v2) => object.Equals(v1, v2), - (PhysicalAddress v) => v.GetHashCode(), + (PhysicalAddress v) => ((object)v).GetHashCode(), (PhysicalAddress v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( size: 20), converter: new ValueConverter( - (PhysicalAddress v) => v.ToString(), + (PhysicalAddress v) => ((object)v).ToString(), (string v) => PhysicalAddress.Parse(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (PhysicalAddress v) => v.ToString(), + (PhysicalAddress v) => ((object)v).ToString(), (string v) => PhysicalAddress.Parse(v)))); physicalAddressToStringConverterProperty.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_PhysicalAddressToStringConverterProperty", "TestNamespace") }); @@ -11780,12 +13649,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas @string.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_String((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_String((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(@string, 201), + (InternalEntityEntry entry) => entry.ReadOriginalValue(@string, 221), (InternalEntityEntry entry) => entry.GetCurrentValue(@string), - (ValueBuffer valueBuffer) => valueBuffer[201]); + (ValueBuffer valueBuffer) => valueBuffer[221]); @string.SetPropertyIndexes( - index: 201, - originalValueIndex: 201, + index: 221, + originalValueIndex: 221, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); @@ -11809,35 +13678,100 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas stringArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(stringArray, 202), + (InternalEntityEntry entry) => entry.ReadOriginalValue(stringArray, 222), (InternalEntityEntry entry) => entry.GetCurrentValue(stringArray), - (ValueBuffer valueBuffer) => valueBuffer[202]); + (ValueBuffer valueBuffer) => valueBuffer[222]); stringArray.SetPropertyIndexes( - index: 202, - originalValueIndex: 202, + index: 222, + originalValueIndex: 222, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); stringArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfReferenceTypesComparer(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter( JsonStringReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( JsonStringReaderWriter.Instance), elementMapping: SqliteStringTypeMapping.Default); stringArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringArray", "TestNamespace") }); + var stringNestedCollection = runtimeEntityType.AddProperty( + "StringNestedCollection", + typeof(string[][]), + propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("StringNestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + stringNestedCollection.SetGetter( + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringNestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringNestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringNestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringNestedCollection(instance) == null); + stringNestedCollection.SetSetter( + (CompiledModelTestBase.ManyTypes entity, string[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringNestedCollection(entity) = value); + stringNestedCollection.SetMaterializationSetter( + (CompiledModelTestBase.ManyTypes entity, string[][] value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringNestedCollection(entity) = value); + stringNestedCollection.SetAccessors( + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringNestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => entry.ReadOriginalValue(stringNestedCollection, 223), + (InternalEntityEntry entry) => entry.GetCurrentValue(stringNestedCollection), + (ValueBuffer valueBuffer) => valueBuffer[223]); + stringNestedCollection.SetPropertyIndexes( + index: 223, + originalValueIndex: 223, + shadowIndex: -1, + relationshipIndex: -1, + storeGenerationIndex: -1); + stringNestedCollection.TypeMapping = SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfReferenceTypesComparer(new ListOfReferenceTypesComparer(new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v))), + keyComparer: new ListOfReferenceTypesComparer(new ListOfReferenceTypesComparer(new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v))), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfReferencesReaderWriter( + JsonStringReaderWriter.Instance))), + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( + new JsonCollectionOfReferencesReaderWriter( + JsonStringReaderWriter.Instance)), + elementMapping: SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfReferenceTypesComparer(new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v)), + keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v)), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter( + JsonStringReaderWriter.Instance)), + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( + JsonStringReaderWriter.Instance), + elementMapping: SqliteStringTypeMapping.Default)); + stringNestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringNestedCollection", "TestNamespace") }); + var stringToBoolConverterProperty = runtimeEntityType.AddProperty( "StringToBoolConverterProperty", typeof(string), @@ -11856,27 +13790,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas stringToBoolConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringToBoolConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringToBoolConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(stringToBoolConverterProperty, 203), + (InternalEntityEntry entry) => entry.ReadOriginalValue(stringToBoolConverterProperty, 224), (InternalEntityEntry entry) => entry.GetCurrentValue(stringToBoolConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[203]); + (ValueBuffer valueBuffer) => valueBuffer[224]); stringToBoolConverterProperty.SetPropertyIndexes( - index: 203, - originalValueIndex: 203, + index: 224, + originalValueIndex: 224, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); stringToBoolConverterProperty.TypeMapping = BoolTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "INTEGER"), @@ -11908,36 +13842,36 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas stringToBytesConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringToBytesConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringToBytesConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(stringToBytesConverterProperty, 204), + (InternalEntityEntry entry) => entry.ReadOriginalValue(stringToBytesConverterProperty, 225), (InternalEntityEntry entry) => entry.GetCurrentValue(stringToBytesConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[204]); + (ValueBuffer valueBuffer) => valueBuffer[225]); stringToBytesConverterProperty.SetPropertyIndexes( - index: 204, - originalValueIndex: 204, + index: 225, + originalValueIndex: 225, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); stringToBytesConverterProperty.TypeMapping = SqliteByteArrayTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), (byte[] v) => StructuralComparisons.StructuralEqualityComparer.GetHashCode((object)v), (byte[] source) => source.ToArray()), converter: new ValueConverter( - (string v) => Encoding.UTF32.GetBytes(v), - (byte[] v) => Encoding.UTF32.GetString(v)), + (string v) => Encoding.GetEncoding(12000).GetBytes(v), + (byte[] v) => Encoding.GetEncoding(12000).GetString(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( SqliteJsonByteArrayReaderWriter.Instance, new ValueConverter( - (string v) => Encoding.UTF32.GetBytes(v), - (byte[] v) => Encoding.UTF32.GetString(v)))); + (string v) => Encoding.GetEncoding(12000).GetBytes(v), + (byte[] v) => Encoding.GetEncoding(12000).GetString(v)))); stringToBytesConverterProperty.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringToBytesConverterProperty", "TestNamespace") }); var stringToCharConverterProperty = runtimeEntityType.AddProperty( @@ -11958,23 +13892,23 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas stringToCharConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringToCharConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringToCharConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(stringToCharConverterProperty, 205), + (InternalEntityEntry entry) => entry.ReadOriginalValue(stringToCharConverterProperty, 226), (InternalEntityEntry entry) => entry.GetCurrentValue(stringToCharConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[205]); + (ValueBuffer valueBuffer) => valueBuffer[226]); stringToCharConverterProperty.SetPropertyIndexes( - index: 205, - originalValueIndex: 205, + index: 226, + originalValueIndex: 226, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); stringToCharConverterProperty.TypeMapping = CharTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (char v1, char v2) => v1 == v2, @@ -12011,27 +13945,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas stringToDateOnlyConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringToDateOnlyConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringToDateOnlyConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(stringToDateOnlyConverterProperty, 206), + (InternalEntityEntry entry) => entry.ReadOriginalValue(stringToDateOnlyConverterProperty, 227), (InternalEntityEntry entry) => entry.GetCurrentValue(stringToDateOnlyConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[206]); + (ValueBuffer valueBuffer) => valueBuffer[227]); stringToDateOnlyConverterProperty.SetPropertyIndexes( - index: 206, - originalValueIndex: 206, + index: 227, + originalValueIndex: 227, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); stringToDateOnlyConverterProperty.TypeMapping = SqliteDateOnlyTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (DateOnly v1, DateOnly v2) => v1.Equals(v2), - (DateOnly v) => v.GetHashCode(), + (DateOnly v) => ((object)v).GetHashCode(), (DateOnly v) => v), mappingInfo: new RelationalTypeMappingInfo( size: 10), @@ -12063,27 +13997,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas stringToDateTimeConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringToDateTimeConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringToDateTimeConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(stringToDateTimeConverterProperty, 207), + (InternalEntityEntry entry) => entry.ReadOriginalValue(stringToDateTimeConverterProperty, 228), (InternalEntityEntry entry) => entry.GetCurrentValue(stringToDateTimeConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[207]); + (ValueBuffer valueBuffer) => valueBuffer[228]); stringToDateTimeConverterProperty.SetPropertyIndexes( - index: 207, - originalValueIndex: 207, + index: 228, + originalValueIndex: 228, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); stringToDateTimeConverterProperty.TypeMapping = SqliteDateTimeTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v), mappingInfo: new RelationalTypeMappingInfo( size: 48), @@ -12115,27 +14049,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas stringToDateTimeOffsetConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringToDateTimeOffsetConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringToDateTimeOffsetConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(stringToDateTimeOffsetConverterProperty, 208), + (InternalEntityEntry entry) => entry.ReadOriginalValue(stringToDateTimeOffsetConverterProperty, 229), (InternalEntityEntry entry) => entry.GetCurrentValue(stringToDateTimeOffsetConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[208]); + (ValueBuffer valueBuffer) => valueBuffer[229]); stringToDateTimeOffsetConverterProperty.SetPropertyIndexes( - index: 208, - originalValueIndex: 208, + index: 229, + originalValueIndex: 229, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); stringToDateTimeOffsetConverterProperty.TypeMapping = SqliteDateTimeOffsetTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (DateTimeOffset v1, DateTimeOffset v2) => v1.EqualsExact(v2), - (DateTimeOffset v) => v.GetHashCode(), + (DateTimeOffset v) => ((object)v).GetHashCode(), (DateTimeOffset v) => v), mappingInfo: new RelationalTypeMappingInfo( size: 48), @@ -12167,27 +14101,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas stringToDecimalNumberConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringToDecimalNumberConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringToDecimalNumberConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(stringToDecimalNumberConverterProperty, 209), + (InternalEntityEntry entry) => entry.ReadOriginalValue(stringToDecimalNumberConverterProperty, 230), (InternalEntityEntry entry) => entry.GetCurrentValue(stringToDecimalNumberConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[209]); + (ValueBuffer valueBuffer) => valueBuffer[230]); stringToDecimalNumberConverterProperty.SetPropertyIndexes( - index: 209, - originalValueIndex: 209, + index: 230, + originalValueIndex: 230, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); stringToDecimalNumberConverterProperty.TypeMapping = SqliteDecimalTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (decimal v1, decimal v2) => v1 == v2, - (decimal v) => v.GetHashCode(), + (decimal v) => ((object)v).GetHashCode(), (decimal v) => v), mappingInfo: new RelationalTypeMappingInfo( size: 64), @@ -12219,27 +14153,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas stringToDoubleNumberConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringToDoubleNumberConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringToDoubleNumberConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(stringToDoubleNumberConverterProperty, 210), + (InternalEntityEntry entry) => entry.ReadOriginalValue(stringToDoubleNumberConverterProperty, 231), (InternalEntityEntry entry) => entry.GetCurrentValue(stringToDoubleNumberConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[210]); + (ValueBuffer valueBuffer) => valueBuffer[231]); stringToDoubleNumberConverterProperty.SetPropertyIndexes( - index: 210, - originalValueIndex: 210, + index: 231, + originalValueIndex: 231, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); stringToDoubleNumberConverterProperty.TypeMapping = DoubleTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (double v1, double v2) => v1.Equals(v2), - (double v) => v.GetHashCode(), + (double v) => ((object)v).GetHashCode(), (double v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "REAL", @@ -12272,23 +14206,23 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas stringToEnumConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringToEnumConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringToEnumConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(stringToEnumConverterProperty, 211), + (InternalEntityEntry entry) => entry.ReadOriginalValue(stringToEnumConverterProperty, 232), (InternalEntityEntry entry) => entry.GetCurrentValue(stringToEnumConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[211]); + (ValueBuffer valueBuffer) => valueBuffer[232]); stringToEnumConverterProperty.SetPropertyIndexes( - index: 211, - originalValueIndex: 211, + index: 232, + originalValueIndex: 232, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); stringToEnumConverterProperty.TypeMapping = UIntTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (uint v1, uint v2) => v1 == v2, @@ -12298,12 +14232,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas storeTypeName: "INTEGER"), converter: new ValueConverter( (string v) => (uint)StringEnumConverter.ConvertToEnum(v), - (uint value) => ((CompiledModelTestBase.EnumU32)value).ToString()), + (uint value) => ((object)(CompiledModelTestBase.EnumU32)value).ToString()), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonUInt32ReaderWriter.Instance, new ValueConverter( (string v) => (uint)StringEnumConverter.ConvertToEnum(v), - (uint value) => ((CompiledModelTestBase.EnumU32)value).ToString()))); + (uint value) => ((object)(CompiledModelTestBase.EnumU32)value).ToString()))); stringToEnumConverterProperty.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringToEnumConverterProperty", "TestNamespace") }); var stringToGuidConverterProperty = runtimeEntityType.AddProperty( @@ -12323,12 +14257,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas stringToGuidConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringToGuidConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringToGuidConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(stringToGuidConverterProperty, 212), + (InternalEntityEntry entry) => entry.ReadOriginalValue(stringToGuidConverterProperty, 233), (InternalEntityEntry entry) => entry.GetCurrentValue(stringToGuidConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[212]); + (ValueBuffer valueBuffer) => valueBuffer[233]); stringToGuidConverterProperty.SetPropertyIndexes( - index: 212, - originalValueIndex: 212, + index: 233, + originalValueIndex: 233, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); @@ -12353,23 +14287,23 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas stringToIntNumberConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringToIntNumberConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringToIntNumberConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(stringToIntNumberConverterProperty, 213), + (InternalEntityEntry entry) => entry.ReadOriginalValue(stringToIntNumberConverterProperty, 234), (InternalEntityEntry entry) => entry.GetCurrentValue(stringToIntNumberConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[213]); + (ValueBuffer valueBuffer) => valueBuffer[234]); stringToIntNumberConverterProperty.SetPropertyIndexes( - index: 213, - originalValueIndex: 213, + index: 234, + originalValueIndex: 234, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); stringToIntNumberConverterProperty.TypeMapping = IntTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -12406,27 +14340,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas stringToTimeOnlyConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringToTimeOnlyConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringToTimeOnlyConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(stringToTimeOnlyConverterProperty, 214), + (InternalEntityEntry entry) => entry.ReadOriginalValue(stringToTimeOnlyConverterProperty, 235), (InternalEntityEntry entry) => entry.GetCurrentValue(stringToTimeOnlyConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[214]); + (ValueBuffer valueBuffer) => valueBuffer[235]); stringToTimeOnlyConverterProperty.SetPropertyIndexes( - index: 214, - originalValueIndex: 214, + index: 235, + originalValueIndex: 235, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); stringToTimeOnlyConverterProperty.TypeMapping = SqliteTimeOnlyTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (TimeOnly v1, TimeOnly v2) => v1.Equals(v2), - (TimeOnly v) => v.GetHashCode(), + (TimeOnly v) => ((object)v).GetHashCode(), (TimeOnly v) => v), mappingInfo: new RelationalTypeMappingInfo( size: 48), @@ -12458,27 +14392,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas stringToTimeSpanConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringToTimeSpanConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringToTimeSpanConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(stringToTimeSpanConverterProperty, 215), + (InternalEntityEntry entry) => entry.ReadOriginalValue(stringToTimeSpanConverterProperty, 236), (InternalEntityEntry entry) => entry.GetCurrentValue(stringToTimeSpanConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[215]); + (ValueBuffer valueBuffer) => valueBuffer[236]); stringToTimeSpanConverterProperty.SetPropertyIndexes( - index: 215, - originalValueIndex: 215, + index: 236, + originalValueIndex: 236, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); stringToTimeSpanConverterProperty.TypeMapping = TimeSpanTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (TimeSpan v1, TimeSpan v2) => v1.Equals(v2), - (TimeSpan v) => v.GetHashCode(), + (TimeSpan v) => ((object)v).GetHashCode(), (TimeSpan v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "TEXT", @@ -12511,36 +14445,36 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas stringToUriConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringToUriConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringToUriConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(stringToUriConverterProperty, 216), + (InternalEntityEntry entry) => entry.ReadOriginalValue(stringToUriConverterProperty, 237), (InternalEntityEntry entry) => entry.GetCurrentValue(stringToUriConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[216]); + (ValueBuffer valueBuffer) => valueBuffer[237]); stringToUriConverterProperty.SetPropertyIndexes( - index: 216, - originalValueIndex: 216, + index: 237, + originalValueIndex: 237, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); stringToUriConverterProperty.TypeMapping = SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), converter: new ValueConverter( - (string v) => new Uri(v, UriKind.RelativeOrAbsolute).ToString(), - (string v) => new Uri(v, UriKind.RelativeOrAbsolute).ToString()), + (string v) => ((object)new Uri(v, UriKind.RelativeOrAbsolute)).ToString(), + (string v) => ((object)new Uri(v, UriKind.RelativeOrAbsolute)).ToString()), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (string v) => new Uri(v, UriKind.RelativeOrAbsolute).ToString(), - (string v) => new Uri(v, UriKind.RelativeOrAbsolute).ToString()))); + (string v) => ((object)new Uri(v, UriKind.RelativeOrAbsolute)).ToString(), + (string v) => ((object)new Uri(v, UriKind.RelativeOrAbsolute)).ToString()))); stringToUriConverterProperty.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringToUriConverterProperty", "TestNamespace") }); var timeOnly = runtimeEntityType.AddProperty( @@ -12561,12 +14495,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas timeOnly.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_TimeOnly((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_TimeOnly((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(timeOnly, 217), + (InternalEntityEntry entry) => entry.ReadOriginalValue(timeOnly, 238), (InternalEntityEntry entry) => entry.GetCurrentValue(timeOnly), - (ValueBuffer valueBuffer) => valueBuffer[217]); + (ValueBuffer valueBuffer) => valueBuffer[238]); timeOnly.SetPropertyIndexes( - index: 217, - originalValueIndex: 217, + index: 238, + originalValueIndex: 238, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); @@ -12590,31 +14524,31 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas timeOnlyArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_TimeOnlyArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_TimeOnlyArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(timeOnlyArray, 218), + (InternalEntityEntry entry) => entry.ReadOriginalValue(timeOnlyArray, 239), (InternalEntityEntry entry) => entry.GetCurrentValue(timeOnlyArray), - (ValueBuffer valueBuffer) => valueBuffer[218]); + (ValueBuffer valueBuffer) => valueBuffer[239]); timeOnlyArray.SetPropertyIndexes( - index: 218, - originalValueIndex: 218, + index: 239, + originalValueIndex: 239, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); timeOnlyArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer(new ValueComparer( (TimeOnly v1, TimeOnly v2) => v1.Equals(v2), - (TimeOnly v) => v.GetHashCode(), + (TimeOnly v) => ((object)v).GetHashCode(), (TimeOnly v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer(new ValueComparer( (TimeOnly v1, TimeOnly v2) => v1.Equals(v2), - (TimeOnly v) => v.GetHashCode(), + (TimeOnly v) => ((object)v).GetHashCode(), (TimeOnly v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( JsonTimeOnlyReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( JsonTimeOnlyReaderWriter.Instance), elementMapping: SqliteTimeOnlyTypeMapping.Default); timeOnlyArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_TimeOnlyArray", "TestNamespace") }); @@ -12637,27 +14571,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas timeOnlyToStringConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_TimeOnlyToStringConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_TimeOnlyToStringConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(timeOnlyToStringConverterProperty, 219), + (InternalEntityEntry entry) => entry.ReadOriginalValue(timeOnlyToStringConverterProperty, 240), (InternalEntityEntry entry) => entry.GetCurrentValue(timeOnlyToStringConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[219]); + (ValueBuffer valueBuffer) => valueBuffer[240]); timeOnlyToStringConverterProperty.SetPropertyIndexes( - index: 219, - originalValueIndex: 219, + index: 240, + originalValueIndex: 240, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); timeOnlyToStringConverterProperty.TypeMapping = SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (TimeOnly v1, TimeOnly v2) => v1.Equals(v2), - (TimeOnly v) => v.GetHashCode(), + (TimeOnly v) => ((object)v).GetHashCode(), (TimeOnly v) => v), keyComparer: new ValueComparer( (TimeOnly v1, TimeOnly v2) => v1.Equals(v2), - (TimeOnly v) => v.GetHashCode(), + (TimeOnly v) => ((object)v).GetHashCode(), (TimeOnly v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( size: 48), @@ -12690,27 +14624,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas timeOnlyToTicksConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_TimeOnlyToTicksConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_TimeOnlyToTicksConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(timeOnlyToTicksConverterProperty, 220), + (InternalEntityEntry entry) => entry.ReadOriginalValue(timeOnlyToTicksConverterProperty, 241), (InternalEntityEntry entry) => entry.GetCurrentValue(timeOnlyToTicksConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[220]); + (ValueBuffer valueBuffer) => valueBuffer[241]); timeOnlyToTicksConverterProperty.SetPropertyIndexes( - index: 220, - originalValueIndex: 220, + index: 241, + originalValueIndex: 241, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); timeOnlyToTicksConverterProperty.TypeMapping = LongTypeMapping.Default.Clone( comparer: new ValueComparer( (TimeOnly v1, TimeOnly v2) => v1.Equals(v2), - (TimeOnly v) => v.GetHashCode(), + (TimeOnly v) => ((object)v).GetHashCode(), (TimeOnly v) => v), keyComparer: new ValueComparer( (TimeOnly v1, TimeOnly v2) => v1.Equals(v2), - (TimeOnly v) => v.GetHashCode(), + (TimeOnly v) => ((object)v).GetHashCode(), (TimeOnly v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "INTEGER"), @@ -12743,27 +14677,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas timeSpan.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_TimeSpan((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_TimeSpan((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(timeSpan, 221), + (InternalEntityEntry entry) => entry.ReadOriginalValue(timeSpan, 242), (InternalEntityEntry entry) => entry.GetCurrentValue(timeSpan), - (ValueBuffer valueBuffer) => valueBuffer[221]); + (ValueBuffer valueBuffer) => valueBuffer[242]); timeSpan.SetPropertyIndexes( - index: 221, - originalValueIndex: 221, + index: 242, + originalValueIndex: 242, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); timeSpan.TypeMapping = TimeSpanTypeMapping.Default.Clone( comparer: new ValueComparer( (TimeSpan v1, TimeSpan v2) => v1.Equals(v2), - (TimeSpan v) => v.GetHashCode(), + (TimeSpan v) => ((object)v).GetHashCode(), (TimeSpan v) => v), keyComparer: new ValueComparer( (TimeSpan v1, TimeSpan v2) => v1.Equals(v2), - (TimeSpan v) => v.GetHashCode(), + (TimeSpan v) => ((object)v).GetHashCode(), (TimeSpan v) => v), providerValueComparer: new ValueComparer( (TimeSpan v1, TimeSpan v2) => v1.Equals(v2), - (TimeSpan v) => v.GetHashCode(), + (TimeSpan v) => ((object)v).GetHashCode(), (TimeSpan v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "TEXT")); @@ -12786,44 +14720,44 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas timeSpanArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_TimeSpanArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_TimeSpanArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(timeSpanArray, 222), + (InternalEntityEntry entry) => entry.ReadOriginalValue(timeSpanArray, 243), (InternalEntityEntry entry) => entry.GetCurrentValue(timeSpanArray), - (ValueBuffer valueBuffer) => valueBuffer[222]); + (ValueBuffer valueBuffer) => valueBuffer[243]); timeSpanArray.SetPropertyIndexes( - index: 222, - originalValueIndex: 222, + index: 243, + originalValueIndex: 243, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); timeSpanArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer(new ValueComparer( (TimeSpan v1, TimeSpan v2) => v1.Equals(v2), - (TimeSpan v) => v.GetHashCode(), + (TimeSpan v) => ((object)v).GetHashCode(), (TimeSpan v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer(new ValueComparer( (TimeSpan v1, TimeSpan v2) => v1.Equals(v2), - (TimeSpan v) => v.GetHashCode(), + (TimeSpan v) => ((object)v).GetHashCode(), (TimeSpan v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( JsonTimeSpanReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( JsonTimeSpanReaderWriter.Instance), elementMapping: TimeSpanTypeMapping.Default.Clone( comparer: new ValueComparer( (TimeSpan v1, TimeSpan v2) => v1.Equals(v2), - (TimeSpan v) => v.GetHashCode(), + (TimeSpan v) => ((object)v).GetHashCode(), (TimeSpan v) => v), keyComparer: new ValueComparer( (TimeSpan v1, TimeSpan v2) => v1.Equals(v2), - (TimeSpan v) => v.GetHashCode(), + (TimeSpan v) => ((object)v).GetHashCode(), (TimeSpan v) => v), providerValueComparer: new ValueComparer( (TimeSpan v1, TimeSpan v2) => v1.Equals(v2), - (TimeSpan v) => v.GetHashCode(), + (TimeSpan v) => ((object)v).GetHashCode(), (TimeSpan v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "TEXT"))); @@ -12847,27 +14781,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas timeSpanToStringConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_TimeSpanToStringConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_TimeSpanToStringConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(timeSpanToStringConverterProperty, 223), + (InternalEntityEntry entry) => entry.ReadOriginalValue(timeSpanToStringConverterProperty, 244), (InternalEntityEntry entry) => entry.GetCurrentValue(timeSpanToStringConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[223]); + (ValueBuffer valueBuffer) => valueBuffer[244]); timeSpanToStringConverterProperty.SetPropertyIndexes( - index: 223, - originalValueIndex: 223, + index: 244, + originalValueIndex: 244, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); timeSpanToStringConverterProperty.TypeMapping = SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (TimeSpan v1, TimeSpan v2) => v1.Equals(v2), - (TimeSpan v) => v.GetHashCode(), + (TimeSpan v) => ((object)v).GetHashCode(), (TimeSpan v) => v), keyComparer: new ValueComparer( (TimeSpan v1, TimeSpan v2) => v1.Equals(v2), - (TimeSpan v) => v.GetHashCode(), + (TimeSpan v) => ((object)v).GetHashCode(), (TimeSpan v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( size: 48), @@ -12900,27 +14834,27 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas timeSpanToTicksConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_TimeSpanToTicksConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_TimeSpanToTicksConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(timeSpanToTicksConverterProperty, 224), + (InternalEntityEntry entry) => entry.ReadOriginalValue(timeSpanToTicksConverterProperty, 245), (InternalEntityEntry entry) => entry.GetCurrentValue(timeSpanToTicksConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[224]); + (ValueBuffer valueBuffer) => valueBuffer[245]); timeSpanToTicksConverterProperty.SetPropertyIndexes( - index: 224, - originalValueIndex: 224, + index: 245, + originalValueIndex: 245, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); timeSpanToTicksConverterProperty.TypeMapping = LongTypeMapping.Default.Clone( comparer: new ValueComparer( (TimeSpan v1, TimeSpan v2) => v1.Equals(v2), - (TimeSpan v) => v.GetHashCode(), + (TimeSpan v) => ((object)v).GetHashCode(), (TimeSpan v) => v), keyComparer: new ValueComparer( (TimeSpan v1, TimeSpan v2) => v1.Equals(v2), - (TimeSpan v) => v.GetHashCode(), + (TimeSpan v) => ((object)v).GetHashCode(), (TimeSpan v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "INTEGER"), @@ -12953,12 +14887,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas uInt16.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UInt16((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UInt16((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(uInt16, 225), + (InternalEntityEntry entry) => entry.ReadOriginalValue(uInt16, 246), (InternalEntityEntry entry) => entry.GetCurrentValue(uInt16), - (ValueBuffer valueBuffer) => valueBuffer[225]); + (ValueBuffer valueBuffer) => valueBuffer[246]); uInt16.SetPropertyIndexes( - index: 225, - originalValueIndex: 225, + index: 246, + originalValueIndex: 246, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); @@ -12996,31 +14930,31 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas uInt16Array.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UInt16Array((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UInt16Array((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(uInt16Array, 226), + (InternalEntityEntry entry) => entry.ReadOriginalValue(uInt16Array, 247), (InternalEntityEntry entry) => entry.GetCurrentValue(uInt16Array), - (ValueBuffer valueBuffer) => valueBuffer[226]); + (ValueBuffer valueBuffer) => valueBuffer[247]); uInt16Array.SetPropertyIndexes( - index: 226, - originalValueIndex: 226, + index: 247, + originalValueIndex: 247, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); uInt16Array.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer(new ValueComparer( (ushort v1, ushort v2) => v1 == v2, (ushort v) => (int)v, (ushort v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer(new ValueComparer( (ushort v1, ushort v2) => v1 == v2, (ushort v) => (int)v, (ushort v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( JsonUInt16ReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( JsonUInt16ReaderWriter.Instance), elementMapping: UShortTypeMapping.Default.Clone( comparer: new ValueComparer( @@ -13057,12 +14991,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas uInt32.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UInt32((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UInt32((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(uInt32, 227), + (InternalEntityEntry entry) => entry.ReadOriginalValue(uInt32, 248), (InternalEntityEntry entry) => entry.GetCurrentValue(uInt32), - (ValueBuffer valueBuffer) => valueBuffer[227]); + (ValueBuffer valueBuffer) => valueBuffer[248]); uInt32.SetPropertyIndexes( - index: 227, - originalValueIndex: 227, + index: 248, + originalValueIndex: 248, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); @@ -13100,31 +15034,31 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas uInt32Array.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UInt32Array((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UInt32Array((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(uInt32Array, 228), + (InternalEntityEntry entry) => entry.ReadOriginalValue(uInt32Array, 249), (InternalEntityEntry entry) => entry.GetCurrentValue(uInt32Array), - (ValueBuffer valueBuffer) => valueBuffer[228]); + (ValueBuffer valueBuffer) => valueBuffer[249]); uInt32Array.SetPropertyIndexes( - index: 228, - originalValueIndex: 228, + index: 249, + originalValueIndex: 249, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); uInt32Array.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer(new ValueComparer( (uint v1, uint v2) => v1 == v2, (uint v) => (int)v, (uint v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer(new ValueComparer( (uint v1, uint v2) => v1 == v2, (uint v) => (int)v, (uint v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( JsonUInt32ReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( JsonUInt32ReaderWriter.Instance), elementMapping: UIntTypeMapping.Default.Clone( comparer: new ValueComparer( @@ -13161,12 +15095,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas uInt64.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UInt64((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UInt64((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(uInt64, 229), + (InternalEntityEntry entry) => entry.ReadOriginalValue(uInt64, 250), (InternalEntityEntry entry) => entry.GetCurrentValue(uInt64), - (ValueBuffer valueBuffer) => valueBuffer[229]); + (ValueBuffer valueBuffer) => valueBuffer[250]); uInt64.SetPropertyIndexes( - index: 229, - originalValueIndex: 229, + index: 250, + originalValueIndex: 250, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); @@ -13190,31 +15124,31 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas uInt64Array.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UInt64Array((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UInt64Array((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(uInt64Array, 230), + (InternalEntityEntry entry) => entry.ReadOriginalValue(uInt64Array, 251), (InternalEntityEntry entry) => entry.GetCurrentValue(uInt64Array), - (ValueBuffer valueBuffer) => valueBuffer[230]); + (ValueBuffer valueBuffer) => valueBuffer[251]); uInt64Array.SetPropertyIndexes( - index: 230, - originalValueIndex: 230, + index: 251, + originalValueIndex: 251, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); uInt64Array.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer(new ValueComparer( (ulong v1, ulong v2) => v1 == v2, - (ulong v) => v.GetHashCode(), + (ulong v) => ((object)v).GetHashCode(), (ulong v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer(new ValueComparer( (ulong v1, ulong v2) => v1 == v2, - (ulong v) => v.GetHashCode(), + (ulong v) => ((object)v).GetHashCode(), (ulong v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( JsonUInt64ReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( JsonUInt64ReaderWriter.Instance), elementMapping: SqliteULongTypeMapping.Default); uInt64Array.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UInt64Array", "TestNamespace") }); @@ -13237,12 +15171,12 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas uInt8.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UInt8((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UInt8((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(uInt8, 231), + (InternalEntityEntry entry) => entry.ReadOriginalValue(uInt8, 252), (InternalEntityEntry entry) => entry.GetCurrentValue(uInt8), - (ValueBuffer valueBuffer) => valueBuffer[231]); + (ValueBuffer valueBuffer) => valueBuffer[252]); uInt8.SetPropertyIndexes( - index: 231, - originalValueIndex: 231, + index: 252, + originalValueIndex: 252, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); @@ -13280,19 +15214,19 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas uInt8Array.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UInt8Array((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UInt8Array((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(uInt8Array, 232), + (InternalEntityEntry entry) => entry.ReadOriginalValue(uInt8Array, 253), (InternalEntityEntry entry) => entry.GetCurrentValue(uInt8Array), - (ValueBuffer valueBuffer) => valueBuffer[232]); + (ValueBuffer valueBuffer) => valueBuffer[253]); uInt8Array.SetPropertyIndexes( - index: 232, - originalValueIndex: 232, + index: 253, + originalValueIndex: 253, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); uInt8Array.TypeMapping = SqliteByteArrayTypeMapping.Default.Clone( comparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), - (byte[] v) => v.GetHashCode(), + (byte[] v) => ((object)v).GetHashCode(), (byte[] v) => v), keyComparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), @@ -13304,6 +15238,64 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas (byte[] source) => source.ToArray())); uInt8Array.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UInt8Array", "TestNamespace") }); + var uInt8NestedCollection = runtimeEntityType.AddProperty( + "UInt8NestedCollection", + typeof(List), + propertyInfo: typeof(CompiledModelTestBase.ManyTypes).GetProperty("UInt8NestedCollection", BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly), + fieldInfo: typeof(CompiledModelTestBase.ManyTypes).GetField("k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly)); + uInt8NestedCollection.SetGetter( + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UInt8NestedCollection(entity), + (CompiledModelTestBase.ManyTypes entity) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UInt8NestedCollection(entity) == null, + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UInt8NestedCollection(instance), + (CompiledModelTestBase.ManyTypes instance) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UInt8NestedCollection(instance) == null); + uInt8NestedCollection.SetSetter( + (CompiledModelTestBase.ManyTypes entity, List value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UInt8NestedCollection(entity) = value); + uInt8NestedCollection.SetMaterializationSetter( + (CompiledModelTestBase.ManyTypes entity, List value) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UInt8NestedCollection(entity) = value); + uInt8NestedCollection.SetAccessors( + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UInt8NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UInt8NestedCollection((CompiledModelTestBase.ManyTypes)entry.Entity), + (InternalEntityEntry entry) => entry.ReadOriginalValue>(uInt8NestedCollection, 254), + (InternalEntityEntry entry) => entry.GetCurrentValue>(uInt8NestedCollection), + (ValueBuffer valueBuffer) => valueBuffer[254]); + uInt8NestedCollection.SetPropertyIndexes( + index: 254, + originalValueIndex: 254, + shadowIndex: -1, + relationshipIndex: -1, + storeGenerationIndex: -1); + uInt8NestedCollection.TypeMapping = SqliteStringTypeMapping.Default.Clone( + comparer: new ListOfReferenceTypesComparer, byte[]>(new ValueComparer( + (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), + (byte[] v) => ((object)v).GetHashCode(), + (byte[] v) => v)), + keyComparer: new ListOfReferenceTypesComparer, byte[]>(new ValueComparer( + (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), + (byte[] v) => ((object)v).GetHashCode(), + (byte[] v) => v)), + providerValueComparer: new ValueComparer( + (string v1, string v2) => v1 == v2, + (string v) => ((object)v).GetHashCode(), + (string v) => v), + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter, byte[]>( + SqliteJsonByteArrayReaderWriter.Instance)), + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter, byte[]>( + SqliteJsonByteArrayReaderWriter.Instance), + elementMapping: SqliteByteArrayTypeMapping.Default.Clone( + comparer: new ValueComparer( + (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), + (byte[] v) => ((object)v).GetHashCode(), + (byte[] v) => v), + keyComparer: new ValueComparer( + (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), + (byte[] v) => StructuralComparisons.StructuralEqualityComparer.GetHashCode((object)v), + (byte[] source) => source.ToArray()), + providerValueComparer: new ValueComparer( + (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), + (byte[] v) => StructuralComparisons.StructuralEqualityComparer.GetHashCode((object)v), + (byte[] source) => source.ToArray()))); + uInt8NestedCollection.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UInt8NestedCollection", "TestNamespace") }); + var uri = runtimeEntityType.AddProperty( "Uri", typeof(Uri), @@ -13321,35 +15313,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas uri.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Uri((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Uri((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(uri, 233), + (InternalEntityEntry entry) => entry.ReadOriginalValue(uri, 255), (InternalEntityEntry entry) => entry.GetCurrentValue(uri), - (ValueBuffer valueBuffer) => valueBuffer[233]); + (ValueBuffer valueBuffer) => valueBuffer[255]); uri.SetPropertyIndexes( - index: 233, - originalValueIndex: 233, + index: 255, + originalValueIndex: 255, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); uri.TypeMapping = SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (Uri v1, Uri v2) => v1 == v2, - (Uri v) => v.GetHashCode(), + (Uri v) => ((object)v).GetHashCode(), (Uri v) => v), keyComparer: new ValueComparer( (Uri v1, Uri v2) => v1 == v2, - (Uri v) => v.GetHashCode(), + (Uri v) => ((object)v).GetHashCode(), (Uri v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), converter: new ValueConverter( - (Uri v) => v.ToString(), + (Uri v) => ((object)v).ToString(), (string v) => new Uri(v, UriKind.RelativeOrAbsolute)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (Uri v) => v.ToString(), + (Uri v) => ((object)v).ToString(), (string v) => new Uri(v, UriKind.RelativeOrAbsolute)))); uri.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Uri", "TestNamespace") }); @@ -13370,60 +15362,60 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas uriArray.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UriArray((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UriArray((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(uriArray, 234), + (InternalEntityEntry entry) => entry.ReadOriginalValue(uriArray, 256), (InternalEntityEntry entry) => entry.GetCurrentValue(uriArray), - (ValueBuffer valueBuffer) => valueBuffer[234]); + (ValueBuffer valueBuffer) => valueBuffer[256]); uriArray.SetPropertyIndexes( - index: 234, - originalValueIndex: 234, + index: 256, + originalValueIndex: 256, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); uriArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfReferenceTypesComparer(new ValueComparer( (Uri v1, Uri v2) => v1 == v2, - (Uri v) => v.GetHashCode(), + (Uri v) => ((object)v).GetHashCode(), (Uri v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( (Uri v1, Uri v2) => v1 == v2, - (Uri v) => v.GetHashCode(), + (Uri v) => ((object)v).GetHashCode(), (Uri v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (Uri v) => v.ToString(), + (Uri v) => ((object)v).ToString(), (string v) => new Uri(v, UriKind.RelativeOrAbsolute))))), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (Uri v) => v.ToString(), + (Uri v) => ((object)v).ToString(), (string v) => new Uri(v, UriKind.RelativeOrAbsolute)))), elementMapping: SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (Uri v1, Uri v2) => v1 == v2, - (Uri v) => v.GetHashCode(), + (Uri v) => ((object)v).GetHashCode(), (Uri v) => v), keyComparer: new ValueComparer( (Uri v1, Uri v2) => v1 == v2, - (Uri v) => v.GetHashCode(), + (Uri v) => ((object)v).GetHashCode(), (Uri v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), converter: new ValueConverter( - (Uri v) => v.ToString(), + (Uri v) => ((object)v).ToString(), (string v) => new Uri(v, UriKind.RelativeOrAbsolute)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (Uri v) => v.ToString(), + (Uri v) => ((object)v).ToString(), (string v) => new Uri(v, UriKind.RelativeOrAbsolute))))); uriArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UriArray", "TestNamespace") }); @@ -13445,35 +15437,35 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas uriToStringConverterProperty.SetAccessors( (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UriToStringConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), (InternalEntityEntry entry) => UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UriToStringConverterProperty((CompiledModelTestBase.ManyTypes)entry.Entity), - (InternalEntityEntry entry) => entry.ReadOriginalValue(uriToStringConverterProperty, 235), + (InternalEntityEntry entry) => entry.ReadOriginalValue(uriToStringConverterProperty, 257), (InternalEntityEntry entry) => entry.GetCurrentValue(uriToStringConverterProperty), - (ValueBuffer valueBuffer) => valueBuffer[235]); + (ValueBuffer valueBuffer) => valueBuffer[257]); uriToStringConverterProperty.SetPropertyIndexes( - index: 235, - originalValueIndex: 235, + index: 257, + originalValueIndex: 257, shadowIndex: -1, relationshipIndex: -1, storeGenerationIndex: -1); uriToStringConverterProperty.TypeMapping = SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (Uri v1, Uri v2) => v1 == v2, - (Uri v) => v.GetHashCode(), + (Uri v) => ((object)v).GetHashCode(), (Uri v) => v), keyComparer: new ValueComparer( (Uri v1, Uri v2) => v1 == v2, - (Uri v) => v.GetHashCode(), + (Uri v) => ((object)v).GetHashCode(), (Uri v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), converter: new ValueConverter( - (Uri v) => v.ToString(), + (Uri v) => ((object)v).ToString(), (string v) => new Uri(v, UriKind.RelativeOrAbsolute)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (Uri v) => v.ToString(), + (Uri v) => ((object)v).ToString(), (string v) => new Uri(v, UriKind.RelativeOrAbsolute)))); uriToStringConverterProperty.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("ManyTypesEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UriToStringConverterProperty", "TestNamespace") }); @@ -13489,15 +15481,18 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) var id = runtimeEntityType.FindProperty("Id")!; var @bool = runtimeEntityType.FindProperty("Bool")!; var boolArray = runtimeEntityType.FindProperty("BoolArray")!; + var boolNestedCollection = runtimeEntityType.FindProperty("BoolNestedCollection")!; var boolToStringConverterProperty = runtimeEntityType.FindProperty("BoolToStringConverterProperty")!; var boolToTwoValuesConverterProperty = runtimeEntityType.FindProperty("BoolToTwoValuesConverterProperty")!; var boolToZeroOneConverterProperty = runtimeEntityType.FindProperty("BoolToZeroOneConverterProperty")!; var bytes = runtimeEntityType.FindProperty("Bytes")!; var bytesArray = runtimeEntityType.FindProperty("BytesArray")!; + var bytesNestedCollection = runtimeEntityType.FindProperty("BytesNestedCollection")!; var bytesToStringConverterProperty = runtimeEntityType.FindProperty("BytesToStringConverterProperty")!; var castingConverterProperty = runtimeEntityType.FindProperty("CastingConverterProperty")!; var @char = runtimeEntityType.FindProperty("Char")!; var charArray = runtimeEntityType.FindProperty("CharArray")!; + var charNestedCollection = runtimeEntityType.FindProperty("CharNestedCollection")!; var charToStringConverterProperty = runtimeEntityType.FindProperty("CharToStringConverterProperty")!; var dateOnly = runtimeEntityType.FindProperty("DateOnly")!; var dateOnlyArray = runtimeEntityType.FindProperty("DateOnlyArray")!; @@ -13530,6 +15525,7 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) var enum32AsStringArray = runtimeEntityType.FindProperty("Enum32AsStringArray")!; var enum32AsStringCollection = runtimeEntityType.FindProperty("Enum32AsStringCollection")!; var enum32Collection = runtimeEntityType.FindProperty("Enum32Collection")!; + var enum32NestedCollection = runtimeEntityType.FindProperty("Enum32NestedCollection")!; var enum64 = runtimeEntityType.FindProperty("Enum64")!; var enum64Array = runtimeEntityType.FindProperty("Enum64Array")!; var enum64AsString = runtimeEntityType.FindProperty("Enum64AsString")!; @@ -13542,6 +15538,7 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) var enum8AsStringArray = runtimeEntityType.FindProperty("Enum8AsStringArray")!; var enum8AsStringCollection = runtimeEntityType.FindProperty("Enum8AsStringCollection")!; var enum8Collection = runtimeEntityType.FindProperty("Enum8Collection")!; + var enum8NestedCollection = runtimeEntityType.FindProperty("Enum8NestedCollection")!; var enumToNumberConverterProperty = runtimeEntityType.FindProperty("EnumToNumberConverterProperty")!; var enumToStringConverterProperty = runtimeEntityType.FindProperty("EnumToStringConverterProperty")!; var enumU16 = runtimeEntityType.FindProperty("EnumU16")!; @@ -13562,6 +15559,7 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) var enumU64AsStringArray = runtimeEntityType.FindProperty("EnumU64AsStringArray")!; var enumU64AsStringCollection = runtimeEntityType.FindProperty("EnumU64AsStringCollection")!; var enumU64Collection = runtimeEntityType.FindProperty("EnumU64Collection")!; + var enumU64NestedCollection = runtimeEntityType.FindProperty("EnumU64NestedCollection")!; var enumU8 = runtimeEntityType.FindProperty("EnumU8")!; var enumU8Array = runtimeEntityType.FindProperty("EnumU8Array")!; var enumU8AsString = runtimeEntityType.FindProperty("EnumU8AsString")!; @@ -13572,6 +15570,7 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) var floatArray = runtimeEntityType.FindProperty("FloatArray")!; var guid = runtimeEntityType.FindProperty("Guid")!; var guidArray = runtimeEntityType.FindProperty("GuidArray")!; + var guidNestedCollection = runtimeEntityType.FindProperty("GuidNestedCollection")!; var guidToBytesConverterProperty = runtimeEntityType.FindProperty("GuidToBytesConverterProperty")!; var guidToStringConverterProperty = runtimeEntityType.FindProperty("GuidToStringConverterProperty")!; var iPAddress = runtimeEntityType.FindProperty("IPAddress")!; @@ -13582,10 +15581,13 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) var int16Array = runtimeEntityType.FindProperty("Int16Array")!; var int32 = runtimeEntityType.FindProperty("Int32")!; var int32Array = runtimeEntityType.FindProperty("Int32Array")!; + var int32NestedCollection = runtimeEntityType.FindProperty("Int32NestedCollection")!; var int64 = runtimeEntityType.FindProperty("Int64")!; var int64Array = runtimeEntityType.FindProperty("Int64Array")!; + var int64NestedCollection = runtimeEntityType.FindProperty("Int64NestedCollection")!; var int8 = runtimeEntityType.FindProperty("Int8")!; var int8Array = runtimeEntityType.FindProperty("Int8Array")!; + var int8NestedCollection = runtimeEntityType.FindProperty("Int8NestedCollection")!; var intNumberToBytesConverterProperty = runtimeEntityType.FindProperty("IntNumberToBytesConverterProperty")!; var intNumberToStringConverterProperty = runtimeEntityType.FindProperty("IntNumberToStringConverterProperty")!; var nullIntToNullStringConverterProperty = runtimeEntityType.FindProperty("NullIntToNullStringConverterProperty")!; @@ -13593,6 +15595,7 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) var nullableBoolArray = runtimeEntityType.FindProperty("NullableBoolArray")!; var nullableBytes = runtimeEntityType.FindProperty("NullableBytes")!; var nullableBytesArray = runtimeEntityType.FindProperty("NullableBytesArray")!; + var nullableBytesNestedCollection = runtimeEntityType.FindProperty("NullableBytesNestedCollection")!; var nullableChar = runtimeEntityType.FindProperty("NullableChar")!; var nullableCharArray = runtimeEntityType.FindProperty("NullableCharArray")!; var nullableDateOnly = runtimeEntityType.FindProperty("NullableDateOnly")!; @@ -13615,6 +15618,7 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) var nullableEnum32AsStringArray = runtimeEntityType.FindProperty("NullableEnum32AsStringArray")!; var nullableEnum32AsStringCollection = runtimeEntityType.FindProperty("NullableEnum32AsStringCollection")!; var nullableEnum32Collection = runtimeEntityType.FindProperty("NullableEnum32Collection")!; + var nullableEnum32NestedCollection = runtimeEntityType.FindProperty("NullableEnum32NestedCollection")!; var nullableEnum64 = runtimeEntityType.FindProperty("NullableEnum64")!; var nullableEnum64Array = runtimeEntityType.FindProperty("NullableEnum64Array")!; var nullableEnum64AsString = runtimeEntityType.FindProperty("NullableEnum64AsString")!; @@ -13627,6 +15631,7 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) var nullableEnum8AsStringArray = runtimeEntityType.FindProperty("NullableEnum8AsStringArray")!; var nullableEnum8AsStringCollection = runtimeEntityType.FindProperty("NullableEnum8AsStringCollection")!; var nullableEnum8Collection = runtimeEntityType.FindProperty("NullableEnum8Collection")!; + var nullableEnum8NestedCollection = runtimeEntityType.FindProperty("NullableEnum8NestedCollection")!; var nullableEnumU16 = runtimeEntityType.FindProperty("NullableEnumU16")!; var nullableEnumU16Array = runtimeEntityType.FindProperty("NullableEnumU16Array")!; var nullableEnumU16AsString = runtimeEntityType.FindProperty("NullableEnumU16AsString")!; @@ -13645,6 +15650,7 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) var nullableEnumU64AsStringArray = runtimeEntityType.FindProperty("NullableEnumU64AsStringArray")!; var nullableEnumU64AsStringCollection = runtimeEntityType.FindProperty("NullableEnumU64AsStringCollection")!; var nullableEnumU64Collection = runtimeEntityType.FindProperty("NullableEnumU64Collection")!; + var nullableEnumU64NestedCollection = runtimeEntityType.FindProperty("NullableEnumU64NestedCollection")!; var nullableEnumU8 = runtimeEntityType.FindProperty("NullableEnumU8")!; var nullableEnumU8Array = runtimeEntityType.FindProperty("NullableEnumU8Array")!; var nullableEnumU8AsString = runtimeEntityType.FindProperty("NullableEnumU8AsString")!; @@ -13655,20 +15661,25 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) var nullableFloatArray = runtimeEntityType.FindProperty("NullableFloatArray")!; var nullableGuid = runtimeEntityType.FindProperty("NullableGuid")!; var nullableGuidArray = runtimeEntityType.FindProperty("NullableGuidArray")!; + var nullableGuidNestedCollection = runtimeEntityType.FindProperty("NullableGuidNestedCollection")!; var nullableIPAddress = runtimeEntityType.FindProperty("NullableIPAddress")!; var nullableIPAddressArray = runtimeEntityType.FindProperty("NullableIPAddressArray")!; var nullableInt16 = runtimeEntityType.FindProperty("NullableInt16")!; var nullableInt16Array = runtimeEntityType.FindProperty("NullableInt16Array")!; var nullableInt32 = runtimeEntityType.FindProperty("NullableInt32")!; var nullableInt32Array = runtimeEntityType.FindProperty("NullableInt32Array")!; + var nullableInt32NestedCollection = runtimeEntityType.FindProperty("NullableInt32NestedCollection")!; var nullableInt64 = runtimeEntityType.FindProperty("NullableInt64")!; var nullableInt64Array = runtimeEntityType.FindProperty("NullableInt64Array")!; + var nullableInt64NestedCollection = runtimeEntityType.FindProperty("NullableInt64NestedCollection")!; var nullableInt8 = runtimeEntityType.FindProperty("NullableInt8")!; var nullableInt8Array = runtimeEntityType.FindProperty("NullableInt8Array")!; var nullablePhysicalAddress = runtimeEntityType.FindProperty("NullablePhysicalAddress")!; var nullablePhysicalAddressArray = runtimeEntityType.FindProperty("NullablePhysicalAddressArray")!; + var nullablePhysicalAddressNestedCollection = runtimeEntityType.FindProperty("NullablePhysicalAddressNestedCollection")!; var nullableString = runtimeEntityType.FindProperty("NullableString")!; var nullableStringArray = runtimeEntityType.FindProperty("NullableStringArray")!; + var nullableStringNestedCollection = runtimeEntityType.FindProperty("NullableStringNestedCollection")!; var nullableTimeOnly = runtimeEntityType.FindProperty("NullableTimeOnly")!; var nullableTimeOnlyArray = runtimeEntityType.FindProperty("NullableTimeOnlyArray")!; var nullableTimeSpan = runtimeEntityType.FindProperty("NullableTimeSpan")!; @@ -13681,6 +15692,7 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) var nullableUInt64Array = runtimeEntityType.FindProperty("NullableUInt64Array")!; var nullableUInt8 = runtimeEntityType.FindProperty("NullableUInt8")!; var nullableUInt8Array = runtimeEntityType.FindProperty("NullableUInt8Array")!; + var nullableUInt8NestedCollection = runtimeEntityType.FindProperty("NullableUInt8NestedCollection")!; var nullableUri = runtimeEntityType.FindProperty("NullableUri")!; var nullableUriArray = runtimeEntityType.FindProperty("NullableUriArray")!; var physicalAddress = runtimeEntityType.FindProperty("PhysicalAddress")!; @@ -13689,6 +15701,7 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) var physicalAddressToStringConverterProperty = runtimeEntityType.FindProperty("PhysicalAddressToStringConverterProperty")!; var @string = runtimeEntityType.FindProperty("String")!; var stringArray = runtimeEntityType.FindProperty("StringArray")!; + var stringNestedCollection = runtimeEntityType.FindProperty("StringNestedCollection")!; var stringToBoolConverterProperty = runtimeEntityType.FindProperty("StringToBoolConverterProperty")!; var stringToBytesConverterProperty = runtimeEntityType.FindProperty("StringToBytesConverterProperty")!; var stringToCharConverterProperty = runtimeEntityType.FindProperty("StringToCharConverterProperty")!; @@ -13719,6 +15732,7 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) var uInt64Array = runtimeEntityType.FindProperty("UInt64Array")!; var uInt8 = runtimeEntityType.FindProperty("UInt8")!; var uInt8Array = runtimeEntityType.FindProperty("UInt8Array")!; + var uInt8NestedCollection = runtimeEntityType.FindProperty("UInt8NestedCollection")!; var uri = runtimeEntityType.FindProperty("Uri")!; var uriArray = runtimeEntityType.FindProperty("UriArray")!; var uriToStringConverterProperty = runtimeEntityType.FindProperty("UriToStringConverterProperty")!; @@ -13726,24 +15740,26 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (CompiledModelTestBase.ManyTypes)source.Entity; - var liftedArg = (ISnapshot)new Snapshot(((ValueComparer)id.GetValueComparer()).Snapshot(source.GetCurrentValue(id)), ((ValueComparer)@bool.GetValueComparer()).Snapshot(source.GetCurrentValue(@bool)), (IEnumerable)source.GetCurrentValue(boolArray) == null ? null : (bool[])((ValueComparer>)boolArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(boolArray)), ((ValueComparer)boolToStringConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(boolToStringConverterProperty)), ((ValueComparer)boolToTwoValuesConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(boolToTwoValuesConverterProperty)), ((ValueComparer)boolToZeroOneConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(boolToZeroOneConverterProperty)), source.GetCurrentValue(bytes) == null ? null : ((ValueComparer)bytes.GetValueComparer()).Snapshot(source.GetCurrentValue(bytes)), (IEnumerable)source.GetCurrentValue(bytesArray) == null ? null : (byte[][])((ValueComparer>)bytesArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(bytesArray)), source.GetCurrentValue(bytesToStringConverterProperty) == null ? null : ((ValueComparer)bytesToStringConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(bytesToStringConverterProperty)), ((ValueComparer)castingConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(castingConverterProperty)), ((ValueComparer)@char.GetValueComparer()).Snapshot(source.GetCurrentValue(@char)), (IEnumerable)source.GetCurrentValue(charArray) == null ? null : (char[])((ValueComparer>)charArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(charArray)), ((ValueComparer)charToStringConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(charToStringConverterProperty)), ((ValueComparer)dateOnly.GetValueComparer()).Snapshot(source.GetCurrentValue(dateOnly)), (IEnumerable)source.GetCurrentValue(dateOnlyArray) == null ? null : (DateOnly[])((ValueComparer>)dateOnlyArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(dateOnlyArray)), ((ValueComparer)dateOnlyToStringConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(dateOnlyToStringConverterProperty)), ((ValueComparer)dateTime.GetValueComparer()).Snapshot(source.GetCurrentValue(dateTime)), (IEnumerable)source.GetCurrentValue(dateTimeArray) == null ? null : (DateTime[])((ValueComparer>)dateTimeArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(dateTimeArray)), ((ValueComparer)dateTimeOffsetToBinaryConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(dateTimeOffsetToBinaryConverterProperty)), ((ValueComparer)dateTimeOffsetToBytesConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(dateTimeOffsetToBytesConverterProperty)), ((ValueComparer)dateTimeOffsetToStringConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(dateTimeOffsetToStringConverterProperty)), ((ValueComparer)dateTimeToBinaryConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(dateTimeToBinaryConverterProperty)), ((ValueComparer)dateTimeToStringConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(dateTimeToStringConverterProperty)), ((ValueComparer)dateTimeToTicksConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(dateTimeToTicksConverterProperty)), ((ValueComparer)@decimal.GetValueComparer()).Snapshot(source.GetCurrentValue(@decimal)), (IEnumerable)source.GetCurrentValue(decimalArray) == null ? null : (decimal[])((ValueComparer>)decimalArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(decimalArray)), ((ValueComparer)decimalNumberToBytesConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(decimalNumberToBytesConverterProperty)), ((ValueComparer)decimalNumberToStringConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(decimalNumberToStringConverterProperty)), ((ValueComparer)@double.GetValueComparer()).Snapshot(source.GetCurrentValue(@double)), (IEnumerable)source.GetCurrentValue(doubleArray) == null ? null : (double[])((ValueComparer>)doubleArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(doubleArray))); + var liftedArg = (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetValueComparer()).Snapshot(source.GetCurrentValue(id)), ((ValueComparer)((IProperty)@bool).GetValueComparer()).Snapshot(source.GetCurrentValue(@bool)), (IEnumerable)source.GetCurrentValue(boolArray) == null ? null : (bool[])((ValueComparer>)((IProperty)boolArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(boolArray)), (object)source.GetCurrentValue(boolNestedCollection) == null ? null : (bool[][])((ValueComparer)((IProperty)boolNestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue(boolNestedCollection)), ((ValueComparer)((IProperty)boolToStringConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(boolToStringConverterProperty)), ((ValueComparer)((IProperty)boolToTwoValuesConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(boolToTwoValuesConverterProperty)), ((ValueComparer)((IProperty)boolToZeroOneConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(boolToZeroOneConverterProperty)), source.GetCurrentValue(bytes) == null ? null : ((ValueComparer)((IProperty)bytes).GetValueComparer()).Snapshot(source.GetCurrentValue(bytes)), (object)source.GetCurrentValue(bytesArray) == null ? null : (byte[][])((ValueComparer)((IProperty)bytesArray).GetValueComparer()).Snapshot((object)source.GetCurrentValue(bytesArray)), (object)source.GetCurrentValue(bytesNestedCollection) == null ? null : (byte[][][])((ValueComparer)((IProperty)bytesNestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue(bytesNestedCollection)), source.GetCurrentValue(bytesToStringConverterProperty) == null ? null : ((ValueComparer)((IProperty)bytesToStringConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(bytesToStringConverterProperty)), ((ValueComparer)((IProperty)castingConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(castingConverterProperty)), ((ValueComparer)((IProperty)@char).GetValueComparer()).Snapshot(source.GetCurrentValue(@char)), (IEnumerable)source.GetCurrentValue(charArray) == null ? null : (char[])((ValueComparer>)((IProperty)charArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(charArray)), (object)source.GetCurrentValue(charNestedCollection) == null ? null : (char[][])((ValueComparer)((IProperty)charNestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue(charNestedCollection)), ((ValueComparer)((IProperty)charToStringConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(charToStringConverterProperty)), ((ValueComparer)((IProperty)dateOnly).GetValueComparer()).Snapshot(source.GetCurrentValue(dateOnly)), (IEnumerable)source.GetCurrentValue(dateOnlyArray) == null ? null : (DateOnly[])((ValueComparer>)((IProperty)dateOnlyArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(dateOnlyArray)), ((ValueComparer)((IProperty)dateOnlyToStringConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(dateOnlyToStringConverterProperty)), ((ValueComparer)((IProperty)dateTime).GetValueComparer()).Snapshot(source.GetCurrentValue(dateTime)), (IEnumerable)source.GetCurrentValue(dateTimeArray) == null ? null : (DateTime[])((ValueComparer>)((IProperty)dateTimeArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(dateTimeArray)), ((ValueComparer)((IProperty)dateTimeOffsetToBinaryConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(dateTimeOffsetToBinaryConverterProperty)), ((ValueComparer)((IProperty)dateTimeOffsetToBytesConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(dateTimeOffsetToBytesConverterProperty)), ((ValueComparer)((IProperty)dateTimeOffsetToStringConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(dateTimeOffsetToStringConverterProperty)), ((ValueComparer)((IProperty)dateTimeToBinaryConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(dateTimeToBinaryConverterProperty)), ((ValueComparer)((IProperty)dateTimeToStringConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(dateTimeToStringConverterProperty)), ((ValueComparer)((IProperty)dateTimeToTicksConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(dateTimeToTicksConverterProperty)), ((ValueComparer)((IProperty)@decimal).GetValueComparer()).Snapshot(source.GetCurrentValue(@decimal)), (IEnumerable)source.GetCurrentValue(decimalArray) == null ? null : (decimal[])((ValueComparer>)((IProperty)decimalArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(decimalArray)), ((ValueComparer)((IProperty)decimalNumberToBytesConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(decimalNumberToBytesConverterProperty))); var entity0 = (CompiledModelTestBase.ManyTypes)source.Entity; - var liftedArg0 = (ISnapshot)new Snapshot, List, CompiledModelTestBase.Enum32, CompiledModelTestBase.Enum32[], CompiledModelTestBase.Enum32, CompiledModelTestBase.Enum32[], List, List, CompiledModelTestBase.Enum64, CompiledModelTestBase.Enum64[], CompiledModelTestBase.Enum64, CompiledModelTestBase.Enum64[], List, List, CompiledModelTestBase.Enum8, CompiledModelTestBase.Enum8[], CompiledModelTestBase.Enum8, CompiledModelTestBase.Enum8[], List, List, CompiledModelTestBase.Enum32, CompiledModelTestBase.Enum32, CompiledModelTestBase.EnumU16, CompiledModelTestBase.EnumU16[]>(((ValueComparer)doubleNumberToBytesConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(doubleNumberToBytesConverterProperty)), ((ValueComparer)doubleNumberToStringConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(doubleNumberToStringConverterProperty)), ((ValueComparer)enum16.GetValueComparer()).Snapshot(source.GetCurrentValue(enum16)), (IEnumerable)source.GetCurrentValue(enum16Array) == null ? null : (CompiledModelTestBase.Enum16[])((ValueComparer>)enum16Array.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enum16Array)), ((ValueComparer)enum16AsString.GetValueComparer()).Snapshot(source.GetCurrentValue(enum16AsString)), (IEnumerable)source.GetCurrentValue(enum16AsStringArray) == null ? null : (CompiledModelTestBase.Enum16[])((ValueComparer>)enum16AsStringArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enum16AsStringArray)), (IEnumerable)source.GetCurrentValue>(enum16AsStringCollection) == null ? null : (List)((ValueComparer>)enum16AsStringCollection.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enum16AsStringCollection)), (IEnumerable)source.GetCurrentValue>(enum16Collection) == null ? null : (List)((ValueComparer>)enum16Collection.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enum16Collection)), ((ValueComparer)enum32.GetValueComparer()).Snapshot(source.GetCurrentValue(enum32)), (IEnumerable)source.GetCurrentValue(enum32Array) == null ? null : (CompiledModelTestBase.Enum32[])((ValueComparer>)enum32Array.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enum32Array)), ((ValueComparer)enum32AsString.GetValueComparer()).Snapshot(source.GetCurrentValue(enum32AsString)), (IEnumerable)source.GetCurrentValue(enum32AsStringArray) == null ? null : (CompiledModelTestBase.Enum32[])((ValueComparer>)enum32AsStringArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enum32AsStringArray)), (IEnumerable)source.GetCurrentValue>(enum32AsStringCollection) == null ? null : (List)((ValueComparer>)enum32AsStringCollection.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enum32AsStringCollection)), (IEnumerable)source.GetCurrentValue>(enum32Collection) == null ? null : (List)((ValueComparer>)enum32Collection.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enum32Collection)), ((ValueComparer)enum64.GetValueComparer()).Snapshot(source.GetCurrentValue(enum64)), (IEnumerable)source.GetCurrentValue(enum64Array) == null ? null : (CompiledModelTestBase.Enum64[])((ValueComparer>)enum64Array.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enum64Array)), ((ValueComparer)enum64AsString.GetValueComparer()).Snapshot(source.GetCurrentValue(enum64AsString)), (IEnumerable)source.GetCurrentValue(enum64AsStringArray) == null ? null : (CompiledModelTestBase.Enum64[])((ValueComparer>)enum64AsStringArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enum64AsStringArray)), (IEnumerable)source.GetCurrentValue>(enum64AsStringCollection) == null ? null : (List)((ValueComparer>)enum64AsStringCollection.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enum64AsStringCollection)), (IEnumerable)source.GetCurrentValue>(enum64Collection) == null ? null : (List)((ValueComparer>)enum64Collection.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enum64Collection)), ((ValueComparer)enum8.GetValueComparer()).Snapshot(source.GetCurrentValue(enum8)), (IEnumerable)source.GetCurrentValue(enum8Array) == null ? null : (CompiledModelTestBase.Enum8[])((ValueComparer>)enum8Array.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enum8Array)), ((ValueComparer)enum8AsString.GetValueComparer()).Snapshot(source.GetCurrentValue(enum8AsString)), (IEnumerable)source.GetCurrentValue(enum8AsStringArray) == null ? null : (CompiledModelTestBase.Enum8[])((ValueComparer>)enum8AsStringArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enum8AsStringArray)), (IEnumerable)source.GetCurrentValue>(enum8AsStringCollection) == null ? null : (List)((ValueComparer>)enum8AsStringCollection.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enum8AsStringCollection)), (IEnumerable)source.GetCurrentValue>(enum8Collection) == null ? null : (List)((ValueComparer>)enum8Collection.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enum8Collection)), ((ValueComparer)enumToNumberConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(enumToNumberConverterProperty)), ((ValueComparer)enumToStringConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(enumToStringConverterProperty)), ((ValueComparer)enumU16.GetValueComparer()).Snapshot(source.GetCurrentValue(enumU16)), (IEnumerable)source.GetCurrentValue(enumU16Array) == null ? null : (CompiledModelTestBase.EnumU16[])((ValueComparer>)enumU16Array.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enumU16Array))); + var liftedArg0 = (ISnapshot)new Snapshot, List, CompiledModelTestBase.Enum32, CompiledModelTestBase.Enum32[], CompiledModelTestBase.Enum32, CompiledModelTestBase.Enum32[], List, List, List[][], CompiledModelTestBase.Enum64, CompiledModelTestBase.Enum64[], CompiledModelTestBase.Enum64, CompiledModelTestBase.Enum64[], List, List, CompiledModelTestBase.Enum8, CompiledModelTestBase.Enum8[], CompiledModelTestBase.Enum8, CompiledModelTestBase.Enum8[], List, List>(((ValueComparer)((IProperty)decimalNumberToStringConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(decimalNumberToStringConverterProperty)), ((ValueComparer)((IProperty)@double).GetValueComparer()).Snapshot(source.GetCurrentValue(@double)), (IEnumerable)source.GetCurrentValue(doubleArray) == null ? null : (double[])((ValueComparer>)((IProperty)doubleArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(doubleArray)), ((ValueComparer)((IProperty)doubleNumberToBytesConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(doubleNumberToBytesConverterProperty)), ((ValueComparer)((IProperty)doubleNumberToStringConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(doubleNumberToStringConverterProperty)), ((ValueComparer)((IProperty)enum16).GetValueComparer()).Snapshot(source.GetCurrentValue(enum16)), (IEnumerable)source.GetCurrentValue(enum16Array) == null ? null : (CompiledModelTestBase.Enum16[])((ValueComparer>)((IProperty)enum16Array).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enum16Array)), ((ValueComparer)((IProperty)enum16AsString).GetValueComparer()).Snapshot(source.GetCurrentValue(enum16AsString)), (IEnumerable)source.GetCurrentValue(enum16AsStringArray) == null ? null : (CompiledModelTestBase.Enum16[])((ValueComparer>)((IProperty)enum16AsStringArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enum16AsStringArray)), (IEnumerable)source.GetCurrentValue>(enum16AsStringCollection) == null ? null : (List)((ValueComparer>)((IProperty)enum16AsStringCollection).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enum16AsStringCollection)), (IEnumerable)source.GetCurrentValue>(enum16Collection) == null ? null : (List)((ValueComparer>)((IProperty)enum16Collection).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enum16Collection)), ((ValueComparer)((IProperty)enum32).GetValueComparer()).Snapshot(source.GetCurrentValue(enum32)), (IEnumerable)source.GetCurrentValue(enum32Array) == null ? null : (CompiledModelTestBase.Enum32[])((ValueComparer>)((IProperty)enum32Array).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enum32Array)), ((ValueComparer)((IProperty)enum32AsString).GetValueComparer()).Snapshot(source.GetCurrentValue(enum32AsString)), (IEnumerable)source.GetCurrentValue(enum32AsStringArray) == null ? null : (CompiledModelTestBase.Enum32[])((ValueComparer>)((IProperty)enum32AsStringArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enum32AsStringArray)), (IEnumerable)source.GetCurrentValue>(enum32AsStringCollection) == null ? null : (List)((ValueComparer>)((IProperty)enum32AsStringCollection).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enum32AsStringCollection)), (IEnumerable)source.GetCurrentValue>(enum32Collection) == null ? null : (List)((ValueComparer>)((IProperty)enum32Collection).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enum32Collection)), (object)source.GetCurrentValue[][]>(enum32NestedCollection) == null ? null : (List[][])((ValueComparer)((IProperty)enum32NestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue[][]>(enum32NestedCollection)), ((ValueComparer)((IProperty)enum64).GetValueComparer()).Snapshot(source.GetCurrentValue(enum64)), (IEnumerable)source.GetCurrentValue(enum64Array) == null ? null : (CompiledModelTestBase.Enum64[])((ValueComparer>)((IProperty)enum64Array).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enum64Array)), ((ValueComparer)((IProperty)enum64AsString).GetValueComparer()).Snapshot(source.GetCurrentValue(enum64AsString)), (IEnumerable)source.GetCurrentValue(enum64AsStringArray) == null ? null : (CompiledModelTestBase.Enum64[])((ValueComparer>)((IProperty)enum64AsStringArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enum64AsStringArray)), (IEnumerable)source.GetCurrentValue>(enum64AsStringCollection) == null ? null : (List)((ValueComparer>)((IProperty)enum64AsStringCollection).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enum64AsStringCollection)), (IEnumerable)source.GetCurrentValue>(enum64Collection) == null ? null : (List)((ValueComparer>)((IProperty)enum64Collection).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enum64Collection)), ((ValueComparer)((IProperty)enum8).GetValueComparer()).Snapshot(source.GetCurrentValue(enum8)), (IEnumerable)source.GetCurrentValue(enum8Array) == null ? null : (CompiledModelTestBase.Enum8[])((ValueComparer>)((IProperty)enum8Array).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enum8Array)), ((ValueComparer)((IProperty)enum8AsString).GetValueComparer()).Snapshot(source.GetCurrentValue(enum8AsString)), (IEnumerable)source.GetCurrentValue(enum8AsStringArray) == null ? null : (CompiledModelTestBase.Enum8[])((ValueComparer>)((IProperty)enum8AsStringArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enum8AsStringArray)), (IEnumerable)source.GetCurrentValue>(enum8AsStringCollection) == null ? null : (List)((ValueComparer>)((IProperty)enum8AsStringCollection).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enum8AsStringCollection)), (IEnumerable)source.GetCurrentValue>(enum8Collection) == null ? null : (List)((ValueComparer>)((IProperty)enum8Collection).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enum8Collection))); var entity1 = (CompiledModelTestBase.ManyTypes)source.Entity; - var liftedArg1 = (ISnapshot)new Snapshot, List, CompiledModelTestBase.EnumU32, CompiledModelTestBase.EnumU32[], CompiledModelTestBase.EnumU32, CompiledModelTestBase.EnumU32[], List, List, CompiledModelTestBase.EnumU64, CompiledModelTestBase.EnumU64[], CompiledModelTestBase.EnumU64, CompiledModelTestBase.EnumU64[], List, List, CompiledModelTestBase.EnumU8, CompiledModelTestBase.EnumU8[], CompiledModelTestBase.EnumU8, CompiledModelTestBase.EnumU8[], List, List, float, float[], Guid, Guid[], Guid, Guid, IPAddress, IPAddress[]>(((ValueComparer)enumU16AsString.GetValueComparer()).Snapshot(source.GetCurrentValue(enumU16AsString)), (IEnumerable)source.GetCurrentValue(enumU16AsStringArray) == null ? null : (CompiledModelTestBase.EnumU16[])((ValueComparer>)enumU16AsStringArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enumU16AsStringArray)), (IEnumerable)source.GetCurrentValue>(enumU16AsStringCollection) == null ? null : (List)((ValueComparer>)enumU16AsStringCollection.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enumU16AsStringCollection)), (IEnumerable)source.GetCurrentValue>(enumU16Collection) == null ? null : (List)((ValueComparer>)enumU16Collection.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enumU16Collection)), ((ValueComparer)enumU32.GetValueComparer()).Snapshot(source.GetCurrentValue(enumU32)), (IEnumerable)source.GetCurrentValue(enumU32Array) == null ? null : (CompiledModelTestBase.EnumU32[])((ValueComparer>)enumU32Array.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enumU32Array)), ((ValueComparer)enumU32AsString.GetValueComparer()).Snapshot(source.GetCurrentValue(enumU32AsString)), (IEnumerable)source.GetCurrentValue(enumU32AsStringArray) == null ? null : (CompiledModelTestBase.EnumU32[])((ValueComparer>)enumU32AsStringArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enumU32AsStringArray)), (IEnumerable)source.GetCurrentValue>(enumU32AsStringCollection) == null ? null : (List)((ValueComparer>)enumU32AsStringCollection.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enumU32AsStringCollection)), (IEnumerable)source.GetCurrentValue>(enumU32Collection) == null ? null : (List)((ValueComparer>)enumU32Collection.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enumU32Collection)), ((ValueComparer)enumU64.GetValueComparer()).Snapshot(source.GetCurrentValue(enumU64)), (IEnumerable)source.GetCurrentValue(enumU64Array) == null ? null : (CompiledModelTestBase.EnumU64[])((ValueComparer>)enumU64Array.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enumU64Array)), ((ValueComparer)enumU64AsString.GetValueComparer()).Snapshot(source.GetCurrentValue(enumU64AsString)), (IEnumerable)source.GetCurrentValue(enumU64AsStringArray) == null ? null : (CompiledModelTestBase.EnumU64[])((ValueComparer>)enumU64AsStringArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enumU64AsStringArray)), (IEnumerable)source.GetCurrentValue>(enumU64AsStringCollection) == null ? null : (List)((ValueComparer>)enumU64AsStringCollection.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enumU64AsStringCollection)), (IEnumerable)source.GetCurrentValue>(enumU64Collection) == null ? null : (List)((ValueComparer>)enumU64Collection.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enumU64Collection)), ((ValueComparer)enumU8.GetValueComparer()).Snapshot(source.GetCurrentValue(enumU8)), (IEnumerable)source.GetCurrentValue(enumU8Array) == null ? null : (CompiledModelTestBase.EnumU8[])((ValueComparer>)enumU8Array.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enumU8Array)), ((ValueComparer)enumU8AsString.GetValueComparer()).Snapshot(source.GetCurrentValue(enumU8AsString)), (IEnumerable)source.GetCurrentValue(enumU8AsStringArray) == null ? null : (CompiledModelTestBase.EnumU8[])((ValueComparer>)enumU8AsStringArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enumU8AsStringArray)), (IEnumerable)source.GetCurrentValue>(enumU8AsStringCollection) == null ? null : (List)((ValueComparer>)enumU8AsStringCollection.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enumU8AsStringCollection)), (IEnumerable)source.GetCurrentValue>(enumU8Collection) == null ? null : (List)((ValueComparer>)enumU8Collection.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enumU8Collection)), ((ValueComparer)@float.GetValueComparer()).Snapshot(source.GetCurrentValue(@float)), (IEnumerable)source.GetCurrentValue(floatArray) == null ? null : (float[])((ValueComparer>)floatArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(floatArray)), ((ValueComparer)guid.GetValueComparer()).Snapshot(source.GetCurrentValue(guid)), (IEnumerable)source.GetCurrentValue(guidArray) == null ? null : (Guid[])((ValueComparer>)guidArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(guidArray)), ((ValueComparer)guidToBytesConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(guidToBytesConverterProperty)), ((ValueComparer)guidToStringConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(guidToStringConverterProperty)), source.GetCurrentValue(iPAddress) == null ? null : ((ValueComparer)iPAddress.GetValueComparer()).Snapshot(source.GetCurrentValue(iPAddress)), (IEnumerable)source.GetCurrentValue(iPAddressArray) == null ? null : (IPAddress[])((ValueComparer>)iPAddressArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(iPAddressArray))); + var liftedArg1 = (ISnapshot)new Snapshot, List, CompiledModelTestBase.EnumU32, CompiledModelTestBase.EnumU32[], CompiledModelTestBase.EnumU32, CompiledModelTestBase.EnumU32[], List, List, CompiledModelTestBase.EnumU64, CompiledModelTestBase.EnumU64[], CompiledModelTestBase.EnumU64, CompiledModelTestBase.EnumU64[], List, List, CompiledModelTestBase.EnumU64[][], CompiledModelTestBase.EnumU8, CompiledModelTestBase.EnumU8[], CompiledModelTestBase.EnumU8, CompiledModelTestBase.EnumU8[], List, List, float, float[]>((object)source.GetCurrentValue(enum8NestedCollection) == null ? null : (CompiledModelTestBase.Enum8[][])((ValueComparer)((IProperty)enum8NestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue(enum8NestedCollection)), ((ValueComparer)((IProperty)enumToNumberConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(enumToNumberConverterProperty)), ((ValueComparer)((IProperty)enumToStringConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(enumToStringConverterProperty)), ((ValueComparer)((IProperty)enumU16).GetValueComparer()).Snapshot(source.GetCurrentValue(enumU16)), (IEnumerable)source.GetCurrentValue(enumU16Array) == null ? null : (CompiledModelTestBase.EnumU16[])((ValueComparer>)((IProperty)enumU16Array).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enumU16Array)), ((ValueComparer)((IProperty)enumU16AsString).GetValueComparer()).Snapshot(source.GetCurrentValue(enumU16AsString)), (IEnumerable)source.GetCurrentValue(enumU16AsStringArray) == null ? null : (CompiledModelTestBase.EnumU16[])((ValueComparer>)((IProperty)enumU16AsStringArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enumU16AsStringArray)), (IEnumerable)source.GetCurrentValue>(enumU16AsStringCollection) == null ? null : (List)((ValueComparer>)((IProperty)enumU16AsStringCollection).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enumU16AsStringCollection)), (IEnumerable)source.GetCurrentValue>(enumU16Collection) == null ? null : (List)((ValueComparer>)((IProperty)enumU16Collection).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enumU16Collection)), ((ValueComparer)((IProperty)enumU32).GetValueComparer()).Snapshot(source.GetCurrentValue(enumU32)), (IEnumerable)source.GetCurrentValue(enumU32Array) == null ? null : (CompiledModelTestBase.EnumU32[])((ValueComparer>)((IProperty)enumU32Array).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enumU32Array)), ((ValueComparer)((IProperty)enumU32AsString).GetValueComparer()).Snapshot(source.GetCurrentValue(enumU32AsString)), (IEnumerable)source.GetCurrentValue(enumU32AsStringArray) == null ? null : (CompiledModelTestBase.EnumU32[])((ValueComparer>)((IProperty)enumU32AsStringArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enumU32AsStringArray)), (IEnumerable)source.GetCurrentValue>(enumU32AsStringCollection) == null ? null : (List)((ValueComparer>)((IProperty)enumU32AsStringCollection).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enumU32AsStringCollection)), (IEnumerable)source.GetCurrentValue>(enumU32Collection) == null ? null : (List)((ValueComparer>)((IProperty)enumU32Collection).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enumU32Collection)), ((ValueComparer)((IProperty)enumU64).GetValueComparer()).Snapshot(source.GetCurrentValue(enumU64)), (IEnumerable)source.GetCurrentValue(enumU64Array) == null ? null : (CompiledModelTestBase.EnumU64[])((ValueComparer>)((IProperty)enumU64Array).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enumU64Array)), ((ValueComparer)((IProperty)enumU64AsString).GetValueComparer()).Snapshot(source.GetCurrentValue(enumU64AsString)), (IEnumerable)source.GetCurrentValue(enumU64AsStringArray) == null ? null : (CompiledModelTestBase.EnumU64[])((ValueComparer>)((IProperty)enumU64AsStringArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enumU64AsStringArray)), (IEnumerable)source.GetCurrentValue>(enumU64AsStringCollection) == null ? null : (List)((ValueComparer>)((IProperty)enumU64AsStringCollection).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enumU64AsStringCollection)), (IEnumerable)source.GetCurrentValue>(enumU64Collection) == null ? null : (List)((ValueComparer>)((IProperty)enumU64Collection).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enumU64Collection)), (object)source.GetCurrentValue(enumU64NestedCollection) == null ? null : (CompiledModelTestBase.EnumU64[][])((ValueComparer)((IProperty)enumU64NestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue(enumU64NestedCollection)), ((ValueComparer)((IProperty)enumU8).GetValueComparer()).Snapshot(source.GetCurrentValue(enumU8)), (IEnumerable)source.GetCurrentValue(enumU8Array) == null ? null : (CompiledModelTestBase.EnumU8[])((ValueComparer>)((IProperty)enumU8Array).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enumU8Array)), ((ValueComparer)((IProperty)enumU8AsString).GetValueComparer()).Snapshot(source.GetCurrentValue(enumU8AsString)), (IEnumerable)source.GetCurrentValue(enumU8AsStringArray) == null ? null : (CompiledModelTestBase.EnumU8[])((ValueComparer>)((IProperty)enumU8AsStringArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(enumU8AsStringArray)), (IEnumerable)source.GetCurrentValue>(enumU8AsStringCollection) == null ? null : (List)((ValueComparer>)((IProperty)enumU8AsStringCollection).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enumU8AsStringCollection)), (IEnumerable)source.GetCurrentValue>(enumU8Collection) == null ? null : (List)((ValueComparer>)((IProperty)enumU8Collection).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(enumU8Collection)), ((ValueComparer)((IProperty)@float).GetValueComparer()).Snapshot(source.GetCurrentValue(@float)), (IEnumerable)source.GetCurrentValue(floatArray) == null ? null : (float[])((ValueComparer>)((IProperty)floatArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(floatArray))); var entity2 = (CompiledModelTestBase.ManyTypes)source.Entity; - var liftedArg2 = (ISnapshot)new Snapshot, Nullable, Nullable[], byte[], byte[][], Nullable, Nullable[], Nullable, Nullable[], Nullable, Nullable[], Nullable, Nullable[], Nullable, Nullable[], Nullable, Nullable[], Nullable>(source.GetCurrentValue(iPAddressToBytesConverterProperty) == null ? null : ((ValueComparer)iPAddressToBytesConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(iPAddressToBytesConverterProperty)), source.GetCurrentValue(iPAddressToStringConverterProperty) == null ? null : ((ValueComparer)iPAddressToStringConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(iPAddressToStringConverterProperty)), ((ValueComparer)int16.GetValueComparer()).Snapshot(source.GetCurrentValue(int16)), (IEnumerable)source.GetCurrentValue(int16Array) == null ? null : (short[])((ValueComparer>)int16Array.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(int16Array)), ((ValueComparer)int32.GetValueComparer()).Snapshot(source.GetCurrentValue(int32)), (IEnumerable)source.GetCurrentValue(int32Array) == null ? null : (int[])((ValueComparer>)int32Array.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(int32Array)), ((ValueComparer)int64.GetValueComparer()).Snapshot(source.GetCurrentValue(int64)), (IEnumerable)source.GetCurrentValue(int64Array) == null ? null : (long[])((ValueComparer>)int64Array.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(int64Array)), ((ValueComparer)int8.GetValueComparer()).Snapshot(source.GetCurrentValue(int8)), (IEnumerable)source.GetCurrentValue(int8Array) == null ? null : (sbyte[])((ValueComparer>)int8Array.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(int8Array)), ((ValueComparer)intNumberToBytesConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(intNumberToBytesConverterProperty)), ((ValueComparer)intNumberToStringConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(intNumberToStringConverterProperty)), source.GetCurrentValue>(nullIntToNullStringConverterProperty) == null ? null : ((ValueComparer>)nullIntToNullStringConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullIntToNullStringConverterProperty)), source.GetCurrentValue>(nullableBool) == null ? null : ((ValueComparer>)nullableBool.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableBool)), (IEnumerable>)source.GetCurrentValue[]>(nullableBoolArray) == null ? null : (Nullable[])((ValueComparer>>)nullableBoolArray.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableBoolArray)), source.GetCurrentValue(nullableBytes) == null ? null : ((ValueComparer)nullableBytes.GetValueComparer()).Snapshot(source.GetCurrentValue(nullableBytes)), (IEnumerable)source.GetCurrentValue(nullableBytesArray) == null ? null : (byte[][])((ValueComparer>)nullableBytesArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(nullableBytesArray)), source.GetCurrentValue>(nullableChar) == null ? null : ((ValueComparer>)nullableChar.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableChar)), (IEnumerable>)source.GetCurrentValue[]>(nullableCharArray) == null ? null : (Nullable[])((ValueComparer>>)nullableCharArray.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableCharArray)), source.GetCurrentValue>(nullableDateOnly) == null ? null : ((ValueComparer>)nullableDateOnly.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableDateOnly)), (IEnumerable>)source.GetCurrentValue[]>(nullableDateOnlyArray) == null ? null : (Nullable[])((ValueComparer>>)nullableDateOnlyArray.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableDateOnlyArray)), source.GetCurrentValue>(nullableDateTime) == null ? null : ((ValueComparer>)nullableDateTime.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableDateTime)), (IEnumerable>)source.GetCurrentValue[]>(nullableDateTimeArray) == null ? null : (Nullable[])((ValueComparer>>)nullableDateTimeArray.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableDateTimeArray)), source.GetCurrentValue>(nullableDecimal) == null ? null : ((ValueComparer>)nullableDecimal.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableDecimal)), (IEnumerable>)source.GetCurrentValue[]>(nullableDecimalArray) == null ? null : (Nullable[])((ValueComparer>>)nullableDecimalArray.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableDecimalArray)), source.GetCurrentValue>(nullableDouble) == null ? null : ((ValueComparer>)nullableDouble.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableDouble)), (IEnumerable>)source.GetCurrentValue[]>(nullableDoubleArray) == null ? null : (Nullable[])((ValueComparer>>)nullableDoubleArray.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableDoubleArray)), source.GetCurrentValue>(nullableEnum16) == null ? null : ((ValueComparer>)nullableEnum16.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnum16)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnum16Array) == null ? null : (Nullable[])((ValueComparer>>)nullableEnum16Array.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnum16Array)), source.GetCurrentValue>(nullableEnum16AsString) == null ? null : ((ValueComparer>)nullableEnum16AsString.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnum16AsString))); + var liftedArg2 = (ISnapshot)new Snapshot, Guid, Guid, IPAddress, IPAddress[], IPAddress, IPAddress, short, short[], int, int[], int[][], long, long[], IList[], sbyte, sbyte[], sbyte[][][], int, int, Nullable, Nullable, Nullable[], byte[], byte[][], byte[][][], Nullable, Nullable[]>(((ValueComparer)((IProperty)guid).GetValueComparer()).Snapshot(source.GetCurrentValue(guid)), (IEnumerable)source.GetCurrentValue(guidArray) == null ? null : (Guid[])((ValueComparer>)((IProperty)guidArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(guidArray)), (object)source.GetCurrentValue>(guidNestedCollection) == null ? null : (ICollection)((ValueComparer)((IProperty)guidNestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(guidNestedCollection)), ((ValueComparer)((IProperty)guidToBytesConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(guidToBytesConverterProperty)), ((ValueComparer)((IProperty)guidToStringConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(guidToStringConverterProperty)), source.GetCurrentValue(iPAddress) == null ? null : ((ValueComparer)((IProperty)iPAddress).GetValueComparer()).Snapshot(source.GetCurrentValue(iPAddress)), (object)source.GetCurrentValue(iPAddressArray) == null ? null : (IPAddress[])((ValueComparer)((IProperty)iPAddressArray).GetValueComparer()).Snapshot((object)source.GetCurrentValue(iPAddressArray)), source.GetCurrentValue(iPAddressToBytesConverterProperty) == null ? null : ((ValueComparer)((IProperty)iPAddressToBytesConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(iPAddressToBytesConverterProperty)), source.GetCurrentValue(iPAddressToStringConverterProperty) == null ? null : ((ValueComparer)((IProperty)iPAddressToStringConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(iPAddressToStringConverterProperty)), ((ValueComparer)((IProperty)int16).GetValueComparer()).Snapshot(source.GetCurrentValue(int16)), (IEnumerable)source.GetCurrentValue(int16Array) == null ? null : (short[])((ValueComparer>)((IProperty)int16Array).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(int16Array)), ((ValueComparer)((IProperty)int32).GetValueComparer()).Snapshot(source.GetCurrentValue(int32)), (IEnumerable)source.GetCurrentValue(int32Array) == null ? null : (int[])((ValueComparer>)((IProperty)int32Array).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(int32Array)), (object)source.GetCurrentValue(int32NestedCollection) == null ? null : (int[][])((ValueComparer)((IProperty)int32NestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue(int32NestedCollection)), ((ValueComparer)((IProperty)int64).GetValueComparer()).Snapshot(source.GetCurrentValue(int64)), (IEnumerable)source.GetCurrentValue(int64Array) == null ? null : (long[])((ValueComparer>)((IProperty)int64Array).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(int64Array)), (object)source.GetCurrentValue[]>(int64NestedCollection) == null ? null : (IList[])((ValueComparer)((IProperty)int64NestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue[]>(int64NestedCollection)), ((ValueComparer)((IProperty)int8).GetValueComparer()).Snapshot(source.GetCurrentValue(int8)), (IEnumerable)source.GetCurrentValue(int8Array) == null ? null : (sbyte[])((ValueComparer>)((IProperty)int8Array).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(int8Array)), (object)source.GetCurrentValue(int8NestedCollection) == null ? null : (sbyte[][][])((ValueComparer)((IProperty)int8NestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue(int8NestedCollection)), ((ValueComparer)((IProperty)intNumberToBytesConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(intNumberToBytesConverterProperty)), ((ValueComparer)((IProperty)intNumberToStringConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(intNumberToStringConverterProperty)), source.GetCurrentValue>(nullIntToNullStringConverterProperty) == null ? null : ((ValueComparer>)((IProperty)nullIntToNullStringConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullIntToNullStringConverterProperty)), source.GetCurrentValue>(nullableBool) == null ? null : ((ValueComparer>)((IProperty)nullableBool).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableBool)), (IEnumerable>)source.GetCurrentValue[]>(nullableBoolArray) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableBoolArray).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableBoolArray)), source.GetCurrentValue(nullableBytes) == null ? null : ((ValueComparer)((IProperty)nullableBytes).GetValueComparer()).Snapshot(source.GetCurrentValue(nullableBytes)), (object)source.GetCurrentValue(nullableBytesArray) == null ? null : (byte[][])((ValueComparer)((IProperty)nullableBytesArray).GetValueComparer()).Snapshot((object)source.GetCurrentValue(nullableBytesArray)), (object)source.GetCurrentValue(nullableBytesNestedCollection) == null ? null : (byte[][][])((ValueComparer)((IProperty)nullableBytesNestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue(nullableBytesNestedCollection)), source.GetCurrentValue>(nullableChar) == null ? null : ((ValueComparer>)((IProperty)nullableChar).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableChar)), (IEnumerable>)source.GetCurrentValue[]>(nullableCharArray) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableCharArray).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableCharArray))); var entity3 = (CompiledModelTestBase.ManyTypes)source.Entity; - var liftedArg3 = (ISnapshot)new Snapshot[], List>, List>, Nullable, Nullable[], Nullable, Nullable[], List>, List>, Nullable, Nullable[], Nullable, Nullable[], List>, List>, Nullable, Nullable[], Nullable, Nullable[], List>, List>, Nullable, Nullable[], Nullable, Nullable[], List>, List>, Nullable, Nullable[], Nullable>((IEnumerable>)source.GetCurrentValue[]>(nullableEnum16AsStringArray) == null ? null : (Nullable[])((ValueComparer>>)nullableEnum16AsStringArray.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnum16AsStringArray)), (IEnumerable>)source.GetCurrentValue>>(nullableEnum16AsStringCollection) == null ? null : (List>)((ValueComparer>>)nullableEnum16AsStringCollection.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnum16AsStringCollection)), (IEnumerable>)source.GetCurrentValue>>(nullableEnum16Collection) == null ? null : (List>)((ValueComparer>>)nullableEnum16Collection.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnum16Collection)), source.GetCurrentValue>(nullableEnum32) == null ? null : ((ValueComparer>)nullableEnum32.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnum32)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnum32Array) == null ? null : (Nullable[])((ValueComparer>>)nullableEnum32Array.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnum32Array)), source.GetCurrentValue>(nullableEnum32AsString) == null ? null : ((ValueComparer>)nullableEnum32AsString.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnum32AsString)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnum32AsStringArray) == null ? null : (Nullable[])((ValueComparer>>)nullableEnum32AsStringArray.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnum32AsStringArray)), (IEnumerable>)source.GetCurrentValue>>(nullableEnum32AsStringCollection) == null ? null : (List>)((ValueComparer>>)nullableEnum32AsStringCollection.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnum32AsStringCollection)), (IEnumerable>)source.GetCurrentValue>>(nullableEnum32Collection) == null ? null : (List>)((ValueComparer>>)nullableEnum32Collection.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnum32Collection)), source.GetCurrentValue>(nullableEnum64) == null ? null : ((ValueComparer>)nullableEnum64.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnum64)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnum64Array) == null ? null : (Nullable[])((ValueComparer>>)nullableEnum64Array.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnum64Array)), source.GetCurrentValue>(nullableEnum64AsString) == null ? null : ((ValueComparer>)nullableEnum64AsString.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnum64AsString)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnum64AsStringArray) == null ? null : (Nullable[])((ValueComparer>>)nullableEnum64AsStringArray.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnum64AsStringArray)), (IEnumerable>)source.GetCurrentValue>>(nullableEnum64AsStringCollection) == null ? null : (List>)((ValueComparer>>)nullableEnum64AsStringCollection.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnum64AsStringCollection)), (IEnumerable>)source.GetCurrentValue>>(nullableEnum64Collection) == null ? null : (List>)((ValueComparer>>)nullableEnum64Collection.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnum64Collection)), source.GetCurrentValue>(nullableEnum8) == null ? null : ((ValueComparer>)nullableEnum8.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnum8)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnum8Array) == null ? null : (Nullable[])((ValueComparer>>)nullableEnum8Array.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnum8Array)), source.GetCurrentValue>(nullableEnum8AsString) == null ? null : ((ValueComparer>)nullableEnum8AsString.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnum8AsString)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnum8AsStringArray) == null ? null : (Nullable[])((ValueComparer>>)nullableEnum8AsStringArray.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnum8AsStringArray)), (IEnumerable>)source.GetCurrentValue>>(nullableEnum8AsStringCollection) == null ? null : (List>)((ValueComparer>>)nullableEnum8AsStringCollection.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnum8AsStringCollection)), (IEnumerable>)source.GetCurrentValue>>(nullableEnum8Collection) == null ? null : (List>)((ValueComparer>>)nullableEnum8Collection.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnum8Collection)), source.GetCurrentValue>(nullableEnumU16) == null ? null : ((ValueComparer>)nullableEnumU16.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnumU16)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnumU16Array) == null ? null : (Nullable[])((ValueComparer>>)nullableEnumU16Array.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnumU16Array)), source.GetCurrentValue>(nullableEnumU16AsString) == null ? null : ((ValueComparer>)nullableEnumU16AsString.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnumU16AsString)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnumU16AsStringArray) == null ? null : (Nullable[])((ValueComparer>>)nullableEnumU16AsStringArray.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnumU16AsStringArray)), (IEnumerable>)source.GetCurrentValue>>(nullableEnumU16AsStringCollection) == null ? null : (List>)((ValueComparer>>)nullableEnumU16AsStringCollection.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnumU16AsStringCollection)), (IEnumerable>)source.GetCurrentValue>>(nullableEnumU16Collection) == null ? null : (List>)((ValueComparer>>)nullableEnumU16Collection.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnumU16Collection)), source.GetCurrentValue>(nullableEnumU32) == null ? null : ((ValueComparer>)nullableEnumU32.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnumU32)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnumU32Array) == null ? null : (Nullable[])((ValueComparer>>)nullableEnumU32Array.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnumU32Array)), source.GetCurrentValue>(nullableEnumU32AsString) == null ? null : ((ValueComparer>)nullableEnumU32AsString.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnumU32AsString))); + var liftedArg3 = (ISnapshot)new Snapshot, Nullable[], Nullable, Nullable[], Nullable, Nullable[], Nullable, Nullable[], Nullable, Nullable[], Nullable, Nullable[], List>, List>, Nullable, Nullable[], Nullable, Nullable[], List>, List>, Nullable[][][], Nullable, Nullable[], Nullable, Nullable[], List>, List>, Nullable, Nullable[], Nullable>(source.GetCurrentValue>(nullableDateOnly) == null ? null : ((ValueComparer>)((IProperty)nullableDateOnly).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableDateOnly)), (IEnumerable>)source.GetCurrentValue[]>(nullableDateOnlyArray) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableDateOnlyArray).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableDateOnlyArray)), source.GetCurrentValue>(nullableDateTime) == null ? null : ((ValueComparer>)((IProperty)nullableDateTime).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableDateTime)), (IEnumerable>)source.GetCurrentValue[]>(nullableDateTimeArray) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableDateTimeArray).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableDateTimeArray)), source.GetCurrentValue>(nullableDecimal) == null ? null : ((ValueComparer>)((IProperty)nullableDecimal).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableDecimal)), (IEnumerable>)source.GetCurrentValue[]>(nullableDecimalArray) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableDecimalArray).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableDecimalArray)), source.GetCurrentValue>(nullableDouble) == null ? null : ((ValueComparer>)((IProperty)nullableDouble).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableDouble)), (IEnumerable>)source.GetCurrentValue[]>(nullableDoubleArray) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableDoubleArray).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableDoubleArray)), source.GetCurrentValue>(nullableEnum16) == null ? null : ((ValueComparer>)((IProperty)nullableEnum16).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnum16)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnum16Array) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableEnum16Array).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnum16Array)), source.GetCurrentValue>(nullableEnum16AsString) == null ? null : ((ValueComparer>)((IProperty)nullableEnum16AsString).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnum16AsString)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnum16AsStringArray) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableEnum16AsStringArray).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnum16AsStringArray)), (IEnumerable>)source.GetCurrentValue>>(nullableEnum16AsStringCollection) == null ? null : (List>)((ValueComparer>>)((IProperty)nullableEnum16AsStringCollection).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnum16AsStringCollection)), (IEnumerable>)source.GetCurrentValue>>(nullableEnum16Collection) == null ? null : (List>)((ValueComparer>>)((IProperty)nullableEnum16Collection).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnum16Collection)), source.GetCurrentValue>(nullableEnum32) == null ? null : ((ValueComparer>)((IProperty)nullableEnum32).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnum32)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnum32Array) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableEnum32Array).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnum32Array)), source.GetCurrentValue>(nullableEnum32AsString) == null ? null : ((ValueComparer>)((IProperty)nullableEnum32AsString).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnum32AsString)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnum32AsStringArray) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableEnum32AsStringArray).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnum32AsStringArray)), (IEnumerable>)source.GetCurrentValue>>(nullableEnum32AsStringCollection) == null ? null : (List>)((ValueComparer>>)((IProperty)nullableEnum32AsStringCollection).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnum32AsStringCollection)), (IEnumerable>)source.GetCurrentValue>>(nullableEnum32Collection) == null ? null : (List>)((ValueComparer>>)((IProperty)nullableEnum32Collection).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnum32Collection)), (object)source.GetCurrentValue[][][]>(nullableEnum32NestedCollection) == null ? null : (Nullable[][][])((ValueComparer)((IProperty)nullableEnum32NestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue[][][]>(nullableEnum32NestedCollection)), source.GetCurrentValue>(nullableEnum64) == null ? null : ((ValueComparer>)((IProperty)nullableEnum64).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnum64)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnum64Array) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableEnum64Array).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnum64Array)), source.GetCurrentValue>(nullableEnum64AsString) == null ? null : ((ValueComparer>)((IProperty)nullableEnum64AsString).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnum64AsString)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnum64AsStringArray) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableEnum64AsStringArray).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnum64AsStringArray)), (IEnumerable>)source.GetCurrentValue>>(nullableEnum64AsStringCollection) == null ? null : (List>)((ValueComparer>>)((IProperty)nullableEnum64AsStringCollection).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnum64AsStringCollection)), (IEnumerable>)source.GetCurrentValue>>(nullableEnum64Collection) == null ? null : (List>)((ValueComparer>>)((IProperty)nullableEnum64Collection).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnum64Collection)), source.GetCurrentValue>(nullableEnum8) == null ? null : ((ValueComparer>)((IProperty)nullableEnum8).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnum8)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnum8Array) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableEnum8Array).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnum8Array)), source.GetCurrentValue>(nullableEnum8AsString) == null ? null : ((ValueComparer>)((IProperty)nullableEnum8AsString).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnum8AsString))); var entity4 = (CompiledModelTestBase.ManyTypes)source.Entity; - var liftedArg4 = (ISnapshot)new Snapshot[], List>, List>, Nullable, Nullable[], Nullable, Nullable[], List>, List>, Nullable, Nullable[], Nullable, Nullable[], List>, List>, Nullable, Nullable[], Nullable, Nullable[], IPAddress, IPAddress[], Nullable, Nullable[], Nullable, Nullable[], Nullable, Nullable[], Nullable, Nullable[], PhysicalAddress>((IEnumerable>)source.GetCurrentValue[]>(nullableEnumU32AsStringArray) == null ? null : (Nullable[])((ValueComparer>>)nullableEnumU32AsStringArray.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnumU32AsStringArray)), (IEnumerable>)source.GetCurrentValue>>(nullableEnumU32AsStringCollection) == null ? null : (List>)((ValueComparer>>)nullableEnumU32AsStringCollection.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnumU32AsStringCollection)), (IEnumerable>)source.GetCurrentValue>>(nullableEnumU32Collection) == null ? null : (List>)((ValueComparer>>)nullableEnumU32Collection.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnumU32Collection)), source.GetCurrentValue>(nullableEnumU64) == null ? null : ((ValueComparer>)nullableEnumU64.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnumU64)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnumU64Array) == null ? null : (Nullable[])((ValueComparer>>)nullableEnumU64Array.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnumU64Array)), source.GetCurrentValue>(nullableEnumU64AsString) == null ? null : ((ValueComparer>)nullableEnumU64AsString.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnumU64AsString)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnumU64AsStringArray) == null ? null : (Nullable[])((ValueComparer>>)nullableEnumU64AsStringArray.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnumU64AsStringArray)), (IEnumerable>)source.GetCurrentValue>>(nullableEnumU64AsStringCollection) == null ? null : (List>)((ValueComparer>>)nullableEnumU64AsStringCollection.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnumU64AsStringCollection)), (IEnumerable>)source.GetCurrentValue>>(nullableEnumU64Collection) == null ? null : (List>)((ValueComparer>>)nullableEnumU64Collection.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnumU64Collection)), source.GetCurrentValue>(nullableEnumU8) == null ? null : ((ValueComparer>)nullableEnumU8.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnumU8)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnumU8Array) == null ? null : (Nullable[])((ValueComparer>>)nullableEnumU8Array.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnumU8Array)), source.GetCurrentValue>(nullableEnumU8AsString) == null ? null : ((ValueComparer>)nullableEnumU8AsString.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnumU8AsString)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnumU8AsStringArray) == null ? null : (Nullable[])((ValueComparer>>)nullableEnumU8AsStringArray.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnumU8AsStringArray)), (IEnumerable>)source.GetCurrentValue>>(nullableEnumU8AsStringCollection) == null ? null : (List>)((ValueComparer>>)nullableEnumU8AsStringCollection.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnumU8AsStringCollection)), (IEnumerable>)source.GetCurrentValue>>(nullableEnumU8Collection) == null ? null : (List>)((ValueComparer>>)nullableEnumU8Collection.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnumU8Collection)), source.GetCurrentValue>(nullableFloat) == null ? null : ((ValueComparer>)nullableFloat.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableFloat)), (IEnumerable>)source.GetCurrentValue[]>(nullableFloatArray) == null ? null : (Nullable[])((ValueComparer>>)nullableFloatArray.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableFloatArray)), source.GetCurrentValue>(nullableGuid) == null ? null : ((ValueComparer>)nullableGuid.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableGuid)), (IEnumerable>)source.GetCurrentValue[]>(nullableGuidArray) == null ? null : (Nullable[])((ValueComparer>>)nullableGuidArray.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableGuidArray)), source.GetCurrentValue(nullableIPAddress) == null ? null : ((ValueComparer)nullableIPAddress.GetValueComparer()).Snapshot(source.GetCurrentValue(nullableIPAddress)), (IEnumerable)source.GetCurrentValue(nullableIPAddressArray) == null ? null : (IPAddress[])((ValueComparer>)nullableIPAddressArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(nullableIPAddressArray)), source.GetCurrentValue>(nullableInt16) == null ? null : ((ValueComparer>)nullableInt16.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableInt16)), (IEnumerable>)source.GetCurrentValue[]>(nullableInt16Array) == null ? null : (Nullable[])((ValueComparer>>)nullableInt16Array.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableInt16Array)), source.GetCurrentValue>(nullableInt32) == null ? null : ((ValueComparer>)nullableInt32.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableInt32)), (IEnumerable>)source.GetCurrentValue[]>(nullableInt32Array) == null ? null : (Nullable[])((ValueComparer>>)nullableInt32Array.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableInt32Array)), source.GetCurrentValue>(nullableInt64) == null ? null : ((ValueComparer>)nullableInt64.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableInt64)), (IEnumerable>)source.GetCurrentValue[]>(nullableInt64Array) == null ? null : (Nullable[])((ValueComparer>>)nullableInt64Array.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableInt64Array)), source.GetCurrentValue>(nullableInt8) == null ? null : ((ValueComparer>)nullableInt8.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableInt8)), (IEnumerable>)source.GetCurrentValue[]>(nullableInt8Array) == null ? null : (Nullable[])((ValueComparer>>)nullableInt8Array.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableInt8Array)), source.GetCurrentValue(nullablePhysicalAddress) == null ? null : ((ValueComparer)nullablePhysicalAddress.GetValueComparer()).Snapshot(source.GetCurrentValue(nullablePhysicalAddress))); + var liftedArg4 = (ISnapshot)new Snapshot[], List>, List>, Nullable[][], Nullable, Nullable[], Nullable, Nullable[], List>, List>, Nullable, Nullable[], Nullable, Nullable[], List>, List>, Nullable, Nullable[], Nullable, Nullable[], List>, List>, Nullable[][], Nullable, Nullable[], Nullable, Nullable[], List>, List>, Nullable>((IEnumerable>)source.GetCurrentValue[]>(nullableEnum8AsStringArray) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableEnum8AsStringArray).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnum8AsStringArray)), (IEnumerable>)source.GetCurrentValue>>(nullableEnum8AsStringCollection) == null ? null : (List>)((ValueComparer>>)((IProperty)nullableEnum8AsStringCollection).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnum8AsStringCollection)), (IEnumerable>)source.GetCurrentValue>>(nullableEnum8Collection) == null ? null : (List>)((ValueComparer>>)((IProperty)nullableEnum8Collection).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnum8Collection)), (object)source.GetCurrentValue[][]>(nullableEnum8NestedCollection) == null ? null : (Nullable[][])((ValueComparer)((IProperty)nullableEnum8NestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue[][]>(nullableEnum8NestedCollection)), source.GetCurrentValue>(nullableEnumU16) == null ? null : ((ValueComparer>)((IProperty)nullableEnumU16).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnumU16)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnumU16Array) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableEnumU16Array).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnumU16Array)), source.GetCurrentValue>(nullableEnumU16AsString) == null ? null : ((ValueComparer>)((IProperty)nullableEnumU16AsString).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnumU16AsString)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnumU16AsStringArray) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableEnumU16AsStringArray).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnumU16AsStringArray)), (IEnumerable>)source.GetCurrentValue>>(nullableEnumU16AsStringCollection) == null ? null : (List>)((ValueComparer>>)((IProperty)nullableEnumU16AsStringCollection).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnumU16AsStringCollection)), (IEnumerable>)source.GetCurrentValue>>(nullableEnumU16Collection) == null ? null : (List>)((ValueComparer>>)((IProperty)nullableEnumU16Collection).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnumU16Collection)), source.GetCurrentValue>(nullableEnumU32) == null ? null : ((ValueComparer>)((IProperty)nullableEnumU32).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnumU32)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnumU32Array) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableEnumU32Array).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnumU32Array)), source.GetCurrentValue>(nullableEnumU32AsString) == null ? null : ((ValueComparer>)((IProperty)nullableEnumU32AsString).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnumU32AsString)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnumU32AsStringArray) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableEnumU32AsStringArray).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnumU32AsStringArray)), (IEnumerable>)source.GetCurrentValue>>(nullableEnumU32AsStringCollection) == null ? null : (List>)((ValueComparer>>)((IProperty)nullableEnumU32AsStringCollection).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnumU32AsStringCollection)), (IEnumerable>)source.GetCurrentValue>>(nullableEnumU32Collection) == null ? null : (List>)((ValueComparer>>)((IProperty)nullableEnumU32Collection).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnumU32Collection)), source.GetCurrentValue>(nullableEnumU64) == null ? null : ((ValueComparer>)((IProperty)nullableEnumU64).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnumU64)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnumU64Array) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableEnumU64Array).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnumU64Array)), source.GetCurrentValue>(nullableEnumU64AsString) == null ? null : ((ValueComparer>)((IProperty)nullableEnumU64AsString).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnumU64AsString)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnumU64AsStringArray) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableEnumU64AsStringArray).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnumU64AsStringArray)), (IEnumerable>)source.GetCurrentValue>>(nullableEnumU64AsStringCollection) == null ? null : (List>)((ValueComparer>>)((IProperty)nullableEnumU64AsStringCollection).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnumU64AsStringCollection)), (IEnumerable>)source.GetCurrentValue>>(nullableEnumU64Collection) == null ? null : (List>)((ValueComparer>>)((IProperty)nullableEnumU64Collection).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnumU64Collection)), (object)source.GetCurrentValue[][]>(nullableEnumU64NestedCollection) == null ? null : (Nullable[][])((ValueComparer)((IProperty)nullableEnumU64NestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue[][]>(nullableEnumU64NestedCollection)), source.GetCurrentValue>(nullableEnumU8) == null ? null : ((ValueComparer>)((IProperty)nullableEnumU8).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnumU8)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnumU8Array) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableEnumU8Array).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnumU8Array)), source.GetCurrentValue>(nullableEnumU8AsString) == null ? null : ((ValueComparer>)((IProperty)nullableEnumU8AsString).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableEnumU8AsString)), (IEnumerable>)source.GetCurrentValue[]>(nullableEnumU8AsStringArray) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableEnumU8AsStringArray).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableEnumU8AsStringArray)), (IEnumerable>)source.GetCurrentValue>>(nullableEnumU8AsStringCollection) == null ? null : (List>)((ValueComparer>>)((IProperty)nullableEnumU8AsStringCollection).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnumU8AsStringCollection)), (IEnumerable>)source.GetCurrentValue>>(nullableEnumU8Collection) == null ? null : (List>)((ValueComparer>>)((IProperty)nullableEnumU8Collection).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue>>(nullableEnumU8Collection)), source.GetCurrentValue>(nullableFloat) == null ? null : ((ValueComparer>)((IProperty)nullableFloat).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableFloat))); var entity5 = (CompiledModelTestBase.ManyTypes)source.Entity; - var liftedArg5 = (ISnapshot)new Snapshot, Nullable[], Nullable, Nullable[], Nullable, Nullable[], Nullable, Nullable[], Nullable, Nullable[], Nullable, Nullable[], Uri, Uri[], PhysicalAddress, PhysicalAddress[], PhysicalAddress, PhysicalAddress, string, string[], string, string, string, string, string, string, string>((IEnumerable)source.GetCurrentValue(nullablePhysicalAddressArray) == null ? null : (PhysicalAddress[])((ValueComparer>)nullablePhysicalAddressArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(nullablePhysicalAddressArray)), source.GetCurrentValue(nullableString) == null ? null : ((ValueComparer)nullableString.GetValueComparer()).Snapshot(source.GetCurrentValue(nullableString)), (IEnumerable)source.GetCurrentValue(nullableStringArray) == null ? null : (string[])((ValueComparer>)nullableStringArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(nullableStringArray)), source.GetCurrentValue>(nullableTimeOnly) == null ? null : ((ValueComparer>)nullableTimeOnly.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableTimeOnly)), (IEnumerable>)source.GetCurrentValue[]>(nullableTimeOnlyArray) == null ? null : (Nullable[])((ValueComparer>>)nullableTimeOnlyArray.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableTimeOnlyArray)), source.GetCurrentValue>(nullableTimeSpan) == null ? null : ((ValueComparer>)nullableTimeSpan.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableTimeSpan)), (IEnumerable>)source.GetCurrentValue[]>(nullableTimeSpanArray) == null ? null : (Nullable[])((ValueComparer>>)nullableTimeSpanArray.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableTimeSpanArray)), source.GetCurrentValue>(nullableUInt16) == null ? null : ((ValueComparer>)nullableUInt16.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableUInt16)), (IEnumerable>)source.GetCurrentValue[]>(nullableUInt16Array) == null ? null : (Nullable[])((ValueComparer>>)nullableUInt16Array.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableUInt16Array)), source.GetCurrentValue>(nullableUInt32) == null ? null : ((ValueComparer>)nullableUInt32.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableUInt32)), (IEnumerable>)source.GetCurrentValue[]>(nullableUInt32Array) == null ? null : (Nullable[])((ValueComparer>>)nullableUInt32Array.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableUInt32Array)), source.GetCurrentValue>(nullableUInt64) == null ? null : ((ValueComparer>)nullableUInt64.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableUInt64)), (IEnumerable>)source.GetCurrentValue[]>(nullableUInt64Array) == null ? null : (Nullable[])((ValueComparer>>)nullableUInt64Array.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableUInt64Array)), source.GetCurrentValue>(nullableUInt8) == null ? null : ((ValueComparer>)nullableUInt8.GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableUInt8)), (IEnumerable>)source.GetCurrentValue[]>(nullableUInt8Array) == null ? null : (Nullable[])((ValueComparer>>)nullableUInt8Array.GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableUInt8Array)), source.GetCurrentValue(nullableUri) == null ? null : ((ValueComparer)nullableUri.GetValueComparer()).Snapshot(source.GetCurrentValue(nullableUri)), (IEnumerable)source.GetCurrentValue(nullableUriArray) == null ? null : (Uri[])((ValueComparer>)nullableUriArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(nullableUriArray)), source.GetCurrentValue(physicalAddress) == null ? null : ((ValueComparer)physicalAddress.GetValueComparer()).Snapshot(source.GetCurrentValue(physicalAddress)), (IEnumerable)source.GetCurrentValue(physicalAddressArray) == null ? null : (PhysicalAddress[])((ValueComparer>)physicalAddressArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(physicalAddressArray)), source.GetCurrentValue(physicalAddressToBytesConverterProperty) == null ? null : ((ValueComparer)physicalAddressToBytesConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(physicalAddressToBytesConverterProperty)), source.GetCurrentValue(physicalAddressToStringConverterProperty) == null ? null : ((ValueComparer)physicalAddressToStringConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(physicalAddressToStringConverterProperty)), source.GetCurrentValue(@string) == null ? null : ((ValueComparer)@string.GetValueComparer()).Snapshot(source.GetCurrentValue(@string)), (IEnumerable)source.GetCurrentValue(stringArray) == null ? null : (string[])((ValueComparer>)stringArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(stringArray)), source.GetCurrentValue(stringToBoolConverterProperty) == null ? null : ((ValueComparer)stringToBoolConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(stringToBoolConverterProperty)), source.GetCurrentValue(stringToBytesConverterProperty) == null ? null : ((ValueComparer)stringToBytesConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(stringToBytesConverterProperty)), source.GetCurrentValue(stringToCharConverterProperty) == null ? null : ((ValueComparer)stringToCharConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(stringToCharConverterProperty)), source.GetCurrentValue(stringToDateOnlyConverterProperty) == null ? null : ((ValueComparer)stringToDateOnlyConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(stringToDateOnlyConverterProperty)), source.GetCurrentValue(stringToDateTimeConverterProperty) == null ? null : ((ValueComparer)stringToDateTimeConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(stringToDateTimeConverterProperty)), source.GetCurrentValue(stringToDateTimeOffsetConverterProperty) == null ? null : ((ValueComparer)stringToDateTimeOffsetConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(stringToDateTimeOffsetConverterProperty)), source.GetCurrentValue(stringToDecimalNumberConverterProperty) == null ? null : ((ValueComparer)stringToDecimalNumberConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(stringToDecimalNumberConverterProperty))); + var liftedArg5 = (ISnapshot)new Snapshot[], Nullable, Nullable[], Nullable[][], IPAddress, IPAddress[], Nullable, Nullable[], Nullable, Nullable[], Nullable[][], Nullable, Nullable[], List[][]>, Nullable, Nullable[], PhysicalAddress, PhysicalAddress[], IEnumerable, string, string[], string[][], Nullable, Nullable[], Nullable, Nullable[], Nullable, Nullable[], Nullable, Nullable[]>((IEnumerable>)source.GetCurrentValue[]>(nullableFloatArray) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableFloatArray).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableFloatArray)), source.GetCurrentValue>(nullableGuid) == null ? null : ((ValueComparer>)((IProperty)nullableGuid).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableGuid)), (IEnumerable>)source.GetCurrentValue[]>(nullableGuidArray) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableGuidArray).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableGuidArray)), (object)source.GetCurrentValue[][]>(nullableGuidNestedCollection) == null ? null : (Nullable[][])((ValueComparer)((IProperty)nullableGuidNestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue[][]>(nullableGuidNestedCollection)), source.GetCurrentValue(nullableIPAddress) == null ? null : ((ValueComparer)((IProperty)nullableIPAddress).GetValueComparer()).Snapshot(source.GetCurrentValue(nullableIPAddress)), (object)source.GetCurrentValue(nullableIPAddressArray) == null ? null : (IPAddress[])((ValueComparer)((IProperty)nullableIPAddressArray).GetValueComparer()).Snapshot((object)source.GetCurrentValue(nullableIPAddressArray)), source.GetCurrentValue>(nullableInt16) == null ? null : ((ValueComparer>)((IProperty)nullableInt16).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableInt16)), (IEnumerable>)source.GetCurrentValue[]>(nullableInt16Array) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableInt16Array).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableInt16Array)), source.GetCurrentValue>(nullableInt32) == null ? null : ((ValueComparer>)((IProperty)nullableInt32).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableInt32)), (IEnumerable>)source.GetCurrentValue[]>(nullableInt32Array) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableInt32Array).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableInt32Array)), (object)source.GetCurrentValue[][]>(nullableInt32NestedCollection) == null ? null : (Nullable[][])((ValueComparer)((IProperty)nullableInt32NestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue[][]>(nullableInt32NestedCollection)), source.GetCurrentValue>(nullableInt64) == null ? null : ((ValueComparer>)((IProperty)nullableInt64).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableInt64)), (IEnumerable>)source.GetCurrentValue[]>(nullableInt64Array) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableInt64Array).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableInt64Array)), (object)source.GetCurrentValue[][]>>(nullableInt64NestedCollection) == null ? null : (List[][]>)((ValueComparer)((IProperty)nullableInt64NestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue[][]>>(nullableInt64NestedCollection)), source.GetCurrentValue>(nullableInt8) == null ? null : ((ValueComparer>)((IProperty)nullableInt8).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableInt8)), (IEnumerable>)source.GetCurrentValue[]>(nullableInt8Array) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableInt8Array).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableInt8Array)), source.GetCurrentValue(nullablePhysicalAddress) == null ? null : ((ValueComparer)((IProperty)nullablePhysicalAddress).GetValueComparer()).Snapshot(source.GetCurrentValue(nullablePhysicalAddress)), (object)source.GetCurrentValue(nullablePhysicalAddressArray) == null ? null : (PhysicalAddress[])((ValueComparer)((IProperty)nullablePhysicalAddressArray).GetValueComparer()).Snapshot((object)source.GetCurrentValue(nullablePhysicalAddressArray)), (object)source.GetCurrentValue>(nullablePhysicalAddressNestedCollection) == null ? null : (IEnumerable)((ValueComparer)((IProperty)nullablePhysicalAddressNestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(nullablePhysicalAddressNestedCollection)), source.GetCurrentValue(nullableString) == null ? null : ((ValueComparer)((IProperty)nullableString).GetValueComparer()).Snapshot(source.GetCurrentValue(nullableString)), (object)source.GetCurrentValue(nullableStringArray) == null ? null : (string[])((ValueComparer)((IProperty)nullableStringArray).GetValueComparer()).Snapshot((object)source.GetCurrentValue(nullableStringArray)), (object)source.GetCurrentValue(nullableStringNestedCollection) == null ? null : (string[][])((ValueComparer)((IProperty)nullableStringNestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue(nullableStringNestedCollection)), source.GetCurrentValue>(nullableTimeOnly) == null ? null : ((ValueComparer>)((IProperty)nullableTimeOnly).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableTimeOnly)), (IEnumerable>)source.GetCurrentValue[]>(nullableTimeOnlyArray) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableTimeOnlyArray).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableTimeOnlyArray)), source.GetCurrentValue>(nullableTimeSpan) == null ? null : ((ValueComparer>)((IProperty)nullableTimeSpan).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableTimeSpan)), (IEnumerable>)source.GetCurrentValue[]>(nullableTimeSpanArray) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableTimeSpanArray).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableTimeSpanArray)), source.GetCurrentValue>(nullableUInt16) == null ? null : ((ValueComparer>)((IProperty)nullableUInt16).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableUInt16)), (IEnumerable>)source.GetCurrentValue[]>(nullableUInt16Array) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableUInt16Array).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableUInt16Array)), source.GetCurrentValue>(nullableUInt32) == null ? null : ((ValueComparer>)((IProperty)nullableUInt32).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableUInt32)), (IEnumerable>)source.GetCurrentValue[]>(nullableUInt32Array) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableUInt32Array).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableUInt32Array))); var entity6 = (CompiledModelTestBase.ManyTypes)source.Entity; - return (ISnapshot)new MultiSnapshot(new ISnapshot[] { liftedArg, liftedArg0, liftedArg1, liftedArg2, liftedArg3, liftedArg4, liftedArg5, (ISnapshot)new Snapshot(source.GetCurrentValue(stringToDoubleNumberConverterProperty) == null ? null : ((ValueComparer)stringToDoubleNumberConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(stringToDoubleNumberConverterProperty)), source.GetCurrentValue(stringToEnumConverterProperty) == null ? null : ((ValueComparer)stringToEnumConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(stringToEnumConverterProperty)), source.GetCurrentValue(stringToGuidConverterProperty) == null ? null : ((ValueComparer)stringToGuidConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(stringToGuidConverterProperty)), source.GetCurrentValue(stringToIntNumberConverterProperty) == null ? null : ((ValueComparer)stringToIntNumberConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(stringToIntNumberConverterProperty)), source.GetCurrentValue(stringToTimeOnlyConverterProperty) == null ? null : ((ValueComparer)stringToTimeOnlyConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(stringToTimeOnlyConverterProperty)), source.GetCurrentValue(stringToTimeSpanConverterProperty) == null ? null : ((ValueComparer)stringToTimeSpanConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(stringToTimeSpanConverterProperty)), source.GetCurrentValue(stringToUriConverterProperty) == null ? null : ((ValueComparer)stringToUriConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(stringToUriConverterProperty)), ((ValueComparer)timeOnly.GetValueComparer()).Snapshot(source.GetCurrentValue(timeOnly)), (IEnumerable)source.GetCurrentValue(timeOnlyArray) == null ? null : (TimeOnly[])((ValueComparer>)timeOnlyArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(timeOnlyArray)), ((ValueComparer)timeOnlyToStringConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(timeOnlyToStringConverterProperty)), ((ValueComparer)timeOnlyToTicksConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(timeOnlyToTicksConverterProperty)), ((ValueComparer)timeSpan.GetValueComparer()).Snapshot(source.GetCurrentValue(timeSpan)), (IEnumerable)source.GetCurrentValue(timeSpanArray) == null ? null : (TimeSpan[])((ValueComparer>)timeSpanArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(timeSpanArray)), ((ValueComparer)timeSpanToStringConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(timeSpanToStringConverterProperty)), ((ValueComparer)timeSpanToTicksConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(timeSpanToTicksConverterProperty)), ((ValueComparer)uInt16.GetValueComparer()).Snapshot(source.GetCurrentValue(uInt16)), (IEnumerable)source.GetCurrentValue(uInt16Array) == null ? null : (ushort[])((ValueComparer>)uInt16Array.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(uInt16Array)), ((ValueComparer)uInt32.GetValueComparer()).Snapshot(source.GetCurrentValue(uInt32)), (IEnumerable)source.GetCurrentValue(uInt32Array) == null ? null : (uint[])((ValueComparer>)uInt32Array.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(uInt32Array)), ((ValueComparer)uInt64.GetValueComparer()).Snapshot(source.GetCurrentValue(uInt64)), (IEnumerable)source.GetCurrentValue(uInt64Array) == null ? null : (ulong[])((ValueComparer>)uInt64Array.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(uInt64Array)), ((ValueComparer)uInt8.GetValueComparer()).Snapshot(source.GetCurrentValue(uInt8)), source.GetCurrentValue(uInt8Array) == null ? null : ((ValueComparer)uInt8Array.GetValueComparer()).Snapshot(source.GetCurrentValue(uInt8Array)), source.GetCurrentValue(uri) == null ? null : ((ValueComparer)uri.GetValueComparer()).Snapshot(source.GetCurrentValue(uri)), (IEnumerable)source.GetCurrentValue(uriArray) == null ? null : (Uri[])((ValueComparer>)uriArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(uriArray)), source.GetCurrentValue(uriToStringConverterProperty) == null ? null : ((ValueComparer)uriToStringConverterProperty.GetValueComparer()).Snapshot(source.GetCurrentValue(uriToStringConverterProperty))) }); + var liftedArg6 = (ISnapshot)new Snapshot, Nullable[], Nullable, Nullable[], Nullable[][], Uri, Uri[], PhysicalAddress, PhysicalAddress[], PhysicalAddress, PhysicalAddress, string, string[], string[][], string, string, string, string, string, string, string, string, string, string, string, string, string, string, TimeOnly, TimeOnly[]>(source.GetCurrentValue>(nullableUInt64) == null ? null : ((ValueComparer>)((IProperty)nullableUInt64).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableUInt64)), (IEnumerable>)source.GetCurrentValue[]>(nullableUInt64Array) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableUInt64Array).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableUInt64Array)), source.GetCurrentValue>(nullableUInt8) == null ? null : ((ValueComparer>)((IProperty)nullableUInt8).GetValueComparer()).Snapshot(source.GetCurrentValue>(nullableUInt8)), (IEnumerable>)source.GetCurrentValue[]>(nullableUInt8Array) == null ? null : (Nullable[])((ValueComparer>>)((IProperty)nullableUInt8Array).GetValueComparer()).Snapshot((IEnumerable>)source.GetCurrentValue[]>(nullableUInt8Array)), (object)source.GetCurrentValue[][]>(nullableUInt8NestedCollection) == null ? null : (Nullable[][])((ValueComparer)((IProperty)nullableUInt8NestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue[][]>(nullableUInt8NestedCollection)), source.GetCurrentValue(nullableUri) == null ? null : ((ValueComparer)((IProperty)nullableUri).GetValueComparer()).Snapshot(source.GetCurrentValue(nullableUri)), (object)source.GetCurrentValue(nullableUriArray) == null ? null : (Uri[])((ValueComparer)((IProperty)nullableUriArray).GetValueComparer()).Snapshot((object)source.GetCurrentValue(nullableUriArray)), source.GetCurrentValue(physicalAddress) == null ? null : ((ValueComparer)((IProperty)physicalAddress).GetValueComparer()).Snapshot(source.GetCurrentValue(physicalAddress)), (object)source.GetCurrentValue(physicalAddressArray) == null ? null : (PhysicalAddress[])((ValueComparer)((IProperty)physicalAddressArray).GetValueComparer()).Snapshot((object)source.GetCurrentValue(physicalAddressArray)), source.GetCurrentValue(physicalAddressToBytesConverterProperty) == null ? null : ((ValueComparer)((IProperty)physicalAddressToBytesConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(physicalAddressToBytesConverterProperty)), source.GetCurrentValue(physicalAddressToStringConverterProperty) == null ? null : ((ValueComparer)((IProperty)physicalAddressToStringConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(physicalAddressToStringConverterProperty)), source.GetCurrentValue(@string) == null ? null : ((ValueComparer)((IProperty)@string).GetValueComparer()).Snapshot(source.GetCurrentValue(@string)), (object)source.GetCurrentValue(stringArray) == null ? null : (string[])((ValueComparer)((IProperty)stringArray).GetValueComparer()).Snapshot((object)source.GetCurrentValue(stringArray)), (object)source.GetCurrentValue(stringNestedCollection) == null ? null : (string[][])((ValueComparer)((IProperty)stringNestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue(stringNestedCollection)), source.GetCurrentValue(stringToBoolConverterProperty) == null ? null : ((ValueComparer)((IProperty)stringToBoolConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(stringToBoolConverterProperty)), source.GetCurrentValue(stringToBytesConverterProperty) == null ? null : ((ValueComparer)((IProperty)stringToBytesConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(stringToBytesConverterProperty)), source.GetCurrentValue(stringToCharConverterProperty) == null ? null : ((ValueComparer)((IProperty)stringToCharConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(stringToCharConverterProperty)), source.GetCurrentValue(stringToDateOnlyConverterProperty) == null ? null : ((ValueComparer)((IProperty)stringToDateOnlyConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(stringToDateOnlyConverterProperty)), source.GetCurrentValue(stringToDateTimeConverterProperty) == null ? null : ((ValueComparer)((IProperty)stringToDateTimeConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(stringToDateTimeConverterProperty)), source.GetCurrentValue(stringToDateTimeOffsetConverterProperty) == null ? null : ((ValueComparer)((IProperty)stringToDateTimeOffsetConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(stringToDateTimeOffsetConverterProperty)), source.GetCurrentValue(stringToDecimalNumberConverterProperty) == null ? null : ((ValueComparer)((IProperty)stringToDecimalNumberConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(stringToDecimalNumberConverterProperty)), source.GetCurrentValue(stringToDoubleNumberConverterProperty) == null ? null : ((ValueComparer)((IProperty)stringToDoubleNumberConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(stringToDoubleNumberConverterProperty)), source.GetCurrentValue(stringToEnumConverterProperty) == null ? null : ((ValueComparer)((IProperty)stringToEnumConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(stringToEnumConverterProperty)), source.GetCurrentValue(stringToGuidConverterProperty) == null ? null : ((ValueComparer)((IProperty)stringToGuidConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(stringToGuidConverterProperty)), source.GetCurrentValue(stringToIntNumberConverterProperty) == null ? null : ((ValueComparer)((IProperty)stringToIntNumberConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(stringToIntNumberConverterProperty)), source.GetCurrentValue(stringToTimeOnlyConverterProperty) == null ? null : ((ValueComparer)((IProperty)stringToTimeOnlyConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(stringToTimeOnlyConverterProperty)), source.GetCurrentValue(stringToTimeSpanConverterProperty) == null ? null : ((ValueComparer)((IProperty)stringToTimeSpanConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(stringToTimeSpanConverterProperty)), source.GetCurrentValue(stringToUriConverterProperty) == null ? null : ((ValueComparer)((IProperty)stringToUriConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(stringToUriConverterProperty)), ((ValueComparer)((IProperty)timeOnly).GetValueComparer()).Snapshot(source.GetCurrentValue(timeOnly)), (IEnumerable)source.GetCurrentValue(timeOnlyArray) == null ? null : (TimeOnly[])((ValueComparer>)((IProperty)timeOnlyArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(timeOnlyArray))); + var entity7 = (CompiledModelTestBase.ManyTypes)source.Entity; + return (ISnapshot)new MultiSnapshot(new ISnapshot[] { liftedArg, liftedArg0, liftedArg1, liftedArg2, liftedArg3, liftedArg4, liftedArg5, liftedArg6, (ISnapshot)new Snapshot, Uri, Uri[], Uri>(((ValueComparer)((IProperty)timeOnlyToStringConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(timeOnlyToStringConverterProperty)), ((ValueComparer)((IProperty)timeOnlyToTicksConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(timeOnlyToTicksConverterProperty)), ((ValueComparer)((IProperty)timeSpan).GetValueComparer()).Snapshot(source.GetCurrentValue(timeSpan)), (IEnumerable)source.GetCurrentValue(timeSpanArray) == null ? null : (TimeSpan[])((ValueComparer>)((IProperty)timeSpanArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(timeSpanArray)), ((ValueComparer)((IProperty)timeSpanToStringConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(timeSpanToStringConverterProperty)), ((ValueComparer)((IProperty)timeSpanToTicksConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(timeSpanToTicksConverterProperty)), ((ValueComparer)((IProperty)uInt16).GetValueComparer()).Snapshot(source.GetCurrentValue(uInt16)), (IEnumerable)source.GetCurrentValue(uInt16Array) == null ? null : (ushort[])((ValueComparer>)((IProperty)uInt16Array).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(uInt16Array)), ((ValueComparer)((IProperty)uInt32).GetValueComparer()).Snapshot(source.GetCurrentValue(uInt32)), (IEnumerable)source.GetCurrentValue(uInt32Array) == null ? null : (uint[])((ValueComparer>)((IProperty)uInt32Array).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(uInt32Array)), ((ValueComparer)((IProperty)uInt64).GetValueComparer()).Snapshot(source.GetCurrentValue(uInt64)), (IEnumerable)source.GetCurrentValue(uInt64Array) == null ? null : (ulong[])((ValueComparer>)((IProperty)uInt64Array).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(uInt64Array)), ((ValueComparer)((IProperty)uInt8).GetValueComparer()).Snapshot(source.GetCurrentValue(uInt8)), source.GetCurrentValue(uInt8Array) == null ? null : ((ValueComparer)((IProperty)uInt8Array).GetValueComparer()).Snapshot(source.GetCurrentValue(uInt8Array)), (object)source.GetCurrentValue>(uInt8NestedCollection) == null ? null : (List)((ValueComparer)((IProperty)uInt8NestedCollection).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(uInt8NestedCollection)), source.GetCurrentValue(uri) == null ? null : ((ValueComparer)((IProperty)uri).GetValueComparer()).Snapshot(source.GetCurrentValue(uri)), (object)source.GetCurrentValue(uriArray) == null ? null : (Uri[])((ValueComparer)((IProperty)uriArray).GetValueComparer()).Snapshot((object)source.GetCurrentValue(uriArray)), source.GetCurrentValue(uriToStringConverterProperty) == null ? null : ((ValueComparer)((IProperty)uriToStringConverterProperty).GetValueComparer()).Snapshot(source.GetCurrentValue(uriToStringConverterProperty))) }); }); runtimeEntityType.SetStoreGeneratedValuesFactory( - () => (ISnapshot)new Snapshot(((ValueComparer)id.GetValueComparer()).Snapshot(default(CompiledModelTestBase.ManyTypesId)))); + () => (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetValueComparer()).Snapshot(default(CompiledModelTestBase.ManyTypesId)))); runtimeEntityType.SetTemporaryValuesFactory( (InternalEntityEntry source) => (ISnapshot)new Snapshot(default(CompiledModelTestBase.ManyTypesId))); runtimeEntityType.SetShadowValuesFactory( @@ -13753,14 +15769,14 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) runtimeEntityType.SetRelationshipSnapshotFactory( (InternalEntityEntry source) => { - var entity = (CompiledModelTestBase.ManyTypes)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)id.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(id))); + var entity8 = (CompiledModelTestBase.ManyTypes)source.Entity; + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(id))); }); runtimeEntityType.Counts = new PropertyCounts( - propertyCount: 236, + propertyCount: 258, navigationCount: 0, complexPropertyCount: 0, - originalValueCount: 236, + originalValueCount: 258, shadowCount: 0, relationshipCount: 1, storeGeneratedCount: 1); @@ -13785,6 +15801,9 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref bool[] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BoolArray(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] + public static extern ref bool[][] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BoolNestedCollection(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref bool UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BoolToStringConverterProperty(CompiledModelTestBase.ManyTypes @this); @@ -13800,6 +15819,9 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref byte[][] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BytesArray(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] + public static extern ref byte[][][] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BytesNestedCollection(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref byte[] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_BytesToStringConverterProperty(CompiledModelTestBase.ManyTypes @this); @@ -13812,6 +15834,9 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref char[] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_CharArray(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] + public static extern ref char[][] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_CharNestedCollection(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref char UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_CharToStringConverterProperty(CompiledModelTestBase.ManyTypes @this); @@ -13908,6 +15933,9 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref List UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum32Collection(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] + public static extern ref List[][] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum32NestedCollection(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref CompiledModelTestBase.Enum64 UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum64(CompiledModelTestBase.ManyTypes @this); @@ -13944,6 +15972,9 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref List UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum8Collection(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] + public static extern ref CompiledModelTestBase.Enum8[][] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Enum8NestedCollection(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref CompiledModelTestBase.Enum32 UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumToNumberConverterProperty(CompiledModelTestBase.ManyTypes @this); @@ -14004,6 +16035,9 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref List UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU64Collection(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] + public static extern ref CompiledModelTestBase.EnumU64[][] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU64NestedCollection(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref CompiledModelTestBase.EnumU8 UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_EnumU8(CompiledModelTestBase.ManyTypes @this); @@ -14034,6 +16068,9 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref Guid[] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_GuidArray(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] + public static extern ref ICollection UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_GuidNestedCollection(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref Guid UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_GuidToBytesConverterProperty(CompiledModelTestBase.ManyTypes @this); @@ -14064,18 +16101,27 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref int[] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int32Array(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] + public static extern ref int[][] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int32NestedCollection(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref long UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int64(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref long[] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int64Array(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] + public static extern ref IList[] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int64NestedCollection(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref sbyte UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int8(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref sbyte[] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int8Array(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] + public static extern ref sbyte[][][] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Int8NestedCollection(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref int UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_IntNumberToBytesConverterProperty(CompiledModelTestBase.ManyTypes @this); @@ -14097,6 +16143,9 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref byte[][] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableBytesArray(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] + public static extern ref byte[][][] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableBytesNestedCollection(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref char? UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableChar(CompiledModelTestBase.ManyTypes @this); @@ -14163,6 +16212,9 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref List UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum32Collection(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] + public static extern ref CompiledModelTestBase.Enum32?[][][] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum32NestedCollection(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref CompiledModelTestBase.Enum64? UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum64(CompiledModelTestBase.ManyTypes @this); @@ -14199,6 +16251,9 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref List UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum8Collection(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] + public static extern ref CompiledModelTestBase.Enum8?[][] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnum8NestedCollection(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref CompiledModelTestBase.EnumU16? UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU16(CompiledModelTestBase.ManyTypes @this); @@ -14253,6 +16308,9 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref List UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU64Collection(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] + public static extern ref CompiledModelTestBase.EnumU64?[][] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU64NestedCollection(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref CompiledModelTestBase.EnumU8? UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableEnumU8(CompiledModelTestBase.ManyTypes @this); @@ -14283,6 +16341,9 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref Guid?[] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableGuidArray(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] + public static extern ref Guid?[][] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableGuidNestedCollection(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref IPAddress UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableIPAddress(CompiledModelTestBase.ManyTypes @this); @@ -14301,12 +16362,18 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref int?[] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt32Array(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] + public static extern ref int?[][] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt32NestedCollection(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref long? UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt64(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref long?[] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt64Array(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] + public static extern ref List UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt64NestedCollection(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref sbyte? UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableInt8(CompiledModelTestBase.ManyTypes @this); @@ -14319,12 +16386,18 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref PhysicalAddress[] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullablePhysicalAddressArray(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] + public static extern ref IEnumerable UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullablePhysicalAddressNestedCollection(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref string UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableString(CompiledModelTestBase.ManyTypes @this); [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref string[] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableStringArray(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] + public static extern ref string[][] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableStringNestedCollection(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref TimeOnly? UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableTimeOnly(CompiledModelTestBase.ManyTypes @this); @@ -14361,6 +16434,9 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref byte?[] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUInt8Array(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] + public static extern ref byte?[][] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUInt8NestedCollection(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref Uri UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_NullableUri(CompiledModelTestBase.ManyTypes @this); @@ -14385,6 +16461,9 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref string[] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringArray(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] + public static extern ref string[][] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringNestedCollection(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref string UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_StringToBoolConverterProperty(CompiledModelTestBase.ManyTypes @this); @@ -14475,6 +16554,9 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref byte[] UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UInt8Array(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] + public static extern ref List UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_UInt8NestedCollection(CompiledModelTestBase.ManyTypes @this); + [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "k__BackingField")] public static extern ref Uri UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_ManyTypes_Uri(CompiledModelTestBase.ManyTypes @this); diff --git a/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/BigModel_with_JSON_columns/OwnedType0EntityType.cs b/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/BigModel_with_JSON_columns/OwnedType0EntityType.cs index 0de658e74d1..216f2eac0d3 100644 --- a/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/BigModel_with_JSON_columns/OwnedType0EntityType.cs +++ b/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/BigModel_with_JSON_columns/OwnedType0EntityType.cs @@ -51,15 +51,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas principalDerivedId.TypeMapping = LongTypeMapping.Default.Clone( comparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), keyComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "INTEGER")); @@ -210,52 +210,52 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas relationshipIndex: -1, storeGenerationIndex: -1); refTypeArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfReferenceTypesComparer(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)))), elementMapping: SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), keyComparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( size: 45), converter: new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))); refTypeArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("OwnedType0EntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_OwnedType__refTypeArray", "TestNamespace") }); @@ -287,21 +287,21 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas relationshipIndex: -1, storeGenerationIndex: -1); refTypeEnumerable.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfReferenceTypesComparer, string>(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfReferenceTypesComparer, string>(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, string>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter, string>( JsonStringReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, string>( + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter, string>( JsonStringReaderWriter.Instance), elementMapping: SqliteStringTypeMapping.Default); refTypeEnumerable.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("OwnedType0EntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_OwnedType__refTypeEnumerable", "TestNamespace") }); @@ -334,21 +334,21 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas relationshipIndex: -1, storeGenerationIndex: -1); refTypeIList.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfReferenceTypesComparer, string>(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfReferenceTypesComparer, string>(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, string>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter, string>( JsonStringReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, string>( + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter, string>( JsonStringReaderWriter.Instance), elementMapping: SqliteStringTypeMapping.Default); refTypeIList.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("OwnedType0EntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_OwnedType__refTypeIList", "TestNamespace") }); @@ -381,52 +381,52 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas relationshipIndex: -1, storeGenerationIndex: -1); refTypeList.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfReferenceTypesComparer, IPAddress>(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfReferenceTypesComparer, IPAddress>(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, IPAddress>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter, IPAddress>( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, IPAddress>( + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter, IPAddress>( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)))), elementMapping: SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), keyComparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( size: 45), converter: new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))); refTypeList.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("OwnedType0EntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_OwnedType__refTypeList", "TestNamespace") }); @@ -458,21 +458,21 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas relationshipIndex: -1, storeGenerationIndex: -1); valueTypeArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer(new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer(new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( SqliteJsonDateTimeReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( SqliteJsonDateTimeReaderWriter.Instance), elementMapping: SqliteDateTimeTypeMapping.Default); valueTypeArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("OwnedType0EntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_OwnedType__valueTypeArray", "TestNamespace") }); @@ -505,21 +505,21 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas relationshipIndex: -1, storeGenerationIndex: -1); valueTypeEnumerable.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer, byte>(new ValueComparer( (byte v1, byte v2) => v1 == v2, (byte v) => (int)v, (byte v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer, byte>(new ValueComparer( (byte v1, byte v2) => v1 == v2, (byte v) => (int)v, (byte v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, byte>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter, byte>( JsonByteReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, byte>( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, byte>( JsonByteReaderWriter.Instance), elementMapping: ByteTypeMapping.Default.Clone( comparer: new ValueComparer( @@ -566,21 +566,21 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas relationshipIndex: -1, storeGenerationIndex: -1); valueTypeIList.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer, byte>(new ValueComparer( (byte v1, byte v2) => v1 == v2, (byte v) => (int)v, (byte v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer, byte>(new ValueComparer( (byte v1, byte v2) => v1 == v2, (byte v) => (int)v, (byte v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, byte>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter, byte>( JsonByteReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, byte>( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, byte>( JsonByteReaderWriter.Instance), elementMapping: ByteTypeMapping.Default.Clone( comparer: new ValueComparer( @@ -627,21 +627,21 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas relationshipIndex: -1, storeGenerationIndex: -1); valueTypeList.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer, short>(new ValueComparer( (short v1, short v2) => v1 == v2, (short v) => (int)v, (short v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer, short>(new ValueComparer( (short v1, short v2) => v1 == v2, (short v) => (int)v, (short v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, short>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter, short>( JsonInt16ReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, short>( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, short>( JsonInt16ReaderWriter.Instance), elementMapping: ShortTypeMapping.Default.Clone( comparer: new ValueComparer( @@ -742,11 +742,11 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) runtimeEntityType.SetOriginalValuesFactory( (InternalEntityEntry source) => { - var entity = (CompiledModelTestBase.OwnedType)source.Entity; - return (ISnapshot)new Snapshot, IList, List, DateTime[], IEnumerable, IList, List>(((ValueComparer)principalDerivedId.GetValueComparer()).Snapshot(source.GetCurrentValue(principalDerivedId)), ((ValueComparer)principalDerivedAlternateId.GetValueComparer()).Snapshot(source.GetCurrentValue(principalDerivedAlternateId)), ((ValueComparer)id.GetValueComparer()).Snapshot(source.GetCurrentValue(id)), source.GetCurrentValue(details) == null ? null : ((ValueComparer)details.GetValueComparer()).Snapshot(source.GetCurrentValue(details)), ((ValueComparer)number.GetValueComparer()).Snapshot(source.GetCurrentValue(number)), (IEnumerable)source.GetCurrentValue(refTypeArray) == null ? null : (IPAddress[])((ValueComparer>)refTypeArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(refTypeArray)), source.GetCurrentValue>(refTypeEnumerable) == null ? null : ((ValueComparer>)refTypeEnumerable.GetValueComparer()).Snapshot(source.GetCurrentValue>(refTypeEnumerable)), (IEnumerable)source.GetCurrentValue>(refTypeIList) == null ? null : (IList)((ValueComparer>)refTypeIList.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(refTypeIList)), (IEnumerable)source.GetCurrentValue>(refTypeList) == null ? null : (List)((ValueComparer>)refTypeList.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(refTypeList)), (IEnumerable)source.GetCurrentValue(valueTypeArray) == null ? null : (DateTime[])((ValueComparer>)valueTypeArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(valueTypeArray)), source.GetCurrentValue>(valueTypeEnumerable) == null ? null : ((ValueComparer>)valueTypeEnumerable.GetValueComparer()).Snapshot(source.GetCurrentValue>(valueTypeEnumerable)), (IEnumerable)source.GetCurrentValue>(valueTypeIList) == null ? null : (IList)((ValueComparer>)valueTypeIList.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeIList)), (IEnumerable)source.GetCurrentValue>(valueTypeList) == null ? null : (List)((ValueComparer>)valueTypeList.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeList))); + var entity8 = (CompiledModelTestBase.OwnedType)source.Entity; + return (ISnapshot)new Snapshot, IList, List, DateTime[], IEnumerable, IList, List>(((ValueComparer)((IProperty)principalDerivedId).GetValueComparer()).Snapshot(source.GetCurrentValue(principalDerivedId)), ((ValueComparer)((IProperty)principalDerivedAlternateId).GetValueComparer()).Snapshot(source.GetCurrentValue(principalDerivedAlternateId)), ((ValueComparer)((IProperty)id).GetValueComparer()).Snapshot(source.GetCurrentValue(id)), source.GetCurrentValue(details) == null ? null : ((ValueComparer)((IProperty)details).GetValueComparer()).Snapshot(source.GetCurrentValue(details)), ((ValueComparer)((IProperty)number).GetValueComparer()).Snapshot(source.GetCurrentValue(number)), (object)source.GetCurrentValue(refTypeArray) == null ? null : (IPAddress[])((ValueComparer)((IProperty)refTypeArray).GetValueComparer()).Snapshot((object)source.GetCurrentValue(refTypeArray)), (object)source.GetCurrentValue>(refTypeEnumerable) == null ? null : (IEnumerable)((ValueComparer)((IProperty)refTypeEnumerable).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeEnumerable)), (object)source.GetCurrentValue>(refTypeIList) == null ? null : (IList)((ValueComparer)((IProperty)refTypeIList).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeIList)), (object)source.GetCurrentValue>(refTypeList) == null ? null : (List)((ValueComparer)((IProperty)refTypeList).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeList)), (IEnumerable)source.GetCurrentValue(valueTypeArray) == null ? null : (DateTime[])((ValueComparer>)((IProperty)valueTypeArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(valueTypeArray)), source.GetCurrentValue>(valueTypeEnumerable) == null ? null : ((ValueComparer>)((IProperty)valueTypeEnumerable).GetValueComparer()).Snapshot(source.GetCurrentValue>(valueTypeEnumerable)), (IEnumerable)source.GetCurrentValue>(valueTypeIList) == null ? null : (IList)((ValueComparer>)((IProperty)valueTypeIList).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeIList)), (IEnumerable)source.GetCurrentValue>(valueTypeList) == null ? null : (List)((ValueComparer>)((IProperty)valueTypeList).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeList))); }); runtimeEntityType.SetStoreGeneratedValuesFactory( - () => (ISnapshot)new Snapshot(((ValueComparer)principalDerivedId.GetValueComparer()).Snapshot(default(long)), ((ValueComparer)principalDerivedAlternateId.GetValueComparer()).Snapshot(default(Guid)), ((ValueComparer)id.GetValueComparer()).Snapshot(default(int)))); + () => (ISnapshot)new Snapshot(((ValueComparer)((IProperty)principalDerivedId).GetValueComparer()).Snapshot(default(long)), ((ValueComparer)((IProperty)principalDerivedAlternateId).GetValueComparer()).Snapshot(default(Guid)), ((ValueComparer)((IProperty)id).GetValueComparer()).Snapshot(default(int)))); runtimeEntityType.SetTemporaryValuesFactory( (InternalEntityEntry source) => (ISnapshot)new Snapshot(default(long), default(Guid), default(int))); runtimeEntityType.SetShadowValuesFactory( @@ -756,8 +756,8 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) runtimeEntityType.SetRelationshipSnapshotFactory( (InternalEntityEntry source) => { - var entity = (CompiledModelTestBase.OwnedType)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)principalDerivedId.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalDerivedId)), ((ValueComparer)principalDerivedAlternateId.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalDerivedAlternateId)), ((ValueComparer)id.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(id))); + var entity8 = (CompiledModelTestBase.OwnedType)source.Entity; + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)principalDerivedId).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalDerivedId)), ((ValueComparer)((IProperty)principalDerivedAlternateId).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalDerivedAlternateId)), ((ValueComparer)((IProperty)id).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(id))); }); runtimeEntityType.Counts = new PropertyCounts( propertyCount: 13, diff --git a/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/BigModel_with_JSON_columns/OwnedTypeEntityType.cs b/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/BigModel_with_JSON_columns/OwnedTypeEntityType.cs index 2047f9b6bd5..210bd2191ba 100644 --- a/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/BigModel_with_JSON_columns/OwnedTypeEntityType.cs +++ b/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/BigModel_with_JSON_columns/OwnedTypeEntityType.cs @@ -53,15 +53,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas principalBaseId.TypeMapping = LongTypeMapping.Default.Clone( comparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), keyComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "INTEGER")); @@ -187,52 +187,52 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas relationshipIndex: -1, storeGenerationIndex: -1); refTypeArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfReferenceTypesComparer(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)))), elementMapping: SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), keyComparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( size: 45), converter: new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))); refTypeArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("OwnedTypeEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_OwnedType__refTypeArray", "TestNamespace") }); @@ -265,21 +265,21 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas relationshipIndex: -1, storeGenerationIndex: -1); refTypeEnumerable.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfReferenceTypesComparer, string>(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfReferenceTypesComparer, string>(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, string>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter, string>( JsonStringReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, string>( + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter, string>( JsonStringReaderWriter.Instance), elementMapping: SqliteStringTypeMapping.Default); refTypeEnumerable.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("OwnedTypeEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_OwnedType__refTypeEnumerable", "TestNamespace") }); @@ -313,21 +313,21 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas relationshipIndex: -1, storeGenerationIndex: -1); refTypeIList.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfReferenceTypesComparer, string>(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfReferenceTypesComparer, string>(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, string>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter, string>( JsonStringReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, string>( + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter, string>( JsonStringReaderWriter.Instance), elementMapping: SqliteStringTypeMapping.Default); refTypeIList.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("OwnedTypeEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_OwnedType__refTypeIList", "TestNamespace") }); @@ -361,52 +361,52 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas relationshipIndex: -1, storeGenerationIndex: -1); refTypeList.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfReferenceTypesComparer, IPAddress>(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfReferenceTypesComparer, IPAddress>(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, IPAddress>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter, IPAddress>( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, IPAddress>( + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter, IPAddress>( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)))), elementMapping: SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), keyComparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( size: 45), converter: new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))); refTypeList.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("OwnedTypeEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_OwnedType__refTypeList", "TestNamespace") }); @@ -439,21 +439,21 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas relationshipIndex: -1, storeGenerationIndex: -1); valueTypeArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer(new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer(new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( SqliteJsonDateTimeReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( SqliteJsonDateTimeReaderWriter.Instance), elementMapping: SqliteDateTimeTypeMapping.Default); valueTypeArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("OwnedTypeEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_OwnedType__valueTypeArray", "TestNamespace") }); @@ -487,21 +487,21 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas relationshipIndex: -1, storeGenerationIndex: -1); valueTypeEnumerable.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer, byte>(new ValueComparer( (byte v1, byte v2) => v1 == v2, (byte v) => (int)v, (byte v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer, byte>(new ValueComparer( (byte v1, byte v2) => v1 == v2, (byte v) => (int)v, (byte v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, byte>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter, byte>( JsonByteReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, byte>( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, byte>( JsonByteReaderWriter.Instance), elementMapping: ByteTypeMapping.Default.Clone( comparer: new ValueComparer( @@ -549,21 +549,21 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas relationshipIndex: -1, storeGenerationIndex: -1); valueTypeIList.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer, byte>(new ValueComparer( (byte v1, byte v2) => v1 == v2, (byte v) => (int)v, (byte v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer, byte>(new ValueComparer( (byte v1, byte v2) => v1 == v2, (byte v) => (int)v, (byte v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, byte>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter, byte>( JsonByteReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, byte>( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, byte>( JsonByteReaderWriter.Instance), elementMapping: ByteTypeMapping.Default.Clone( comparer: new ValueComparer( @@ -611,21 +611,21 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas relationshipIndex: -1, storeGenerationIndex: -1); valueTypeList.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer, short>(new ValueComparer( (short v1, short v2) => v1 == v2, (short v) => (int)v, (short v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer, short>(new ValueComparer( (short v1, short v2) => v1 == v2, (short v) => (int)v, (short v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, short>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter, short>( JsonInt16ReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, short>( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, short>( JsonInt16ReaderWriter.Instance), elementMapping: ShortTypeMapping.Default.Clone( comparer: new ValueComparer( @@ -724,11 +724,11 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) runtimeEntityType.SetOriginalValuesFactory( (InternalEntityEntry source) => { - var entity = (CompiledModelTestBase.OwnedType)source.Entity; - return (ISnapshot)new Snapshot, IList, List, DateTime[], IEnumerable, IList, List>(((ValueComparer)principalBaseId.GetValueComparer()).Snapshot(source.GetCurrentValue(principalBaseId)), ((ValueComparer)principalBaseAlternateId.GetValueComparer()).Snapshot(source.GetCurrentValue(principalBaseAlternateId)), source.GetCurrentValue(details) == null ? null : ((ValueComparer)details.GetValueComparer()).Snapshot(source.GetCurrentValue(details)), ((ValueComparer)number.GetValueComparer()).Snapshot(source.GetCurrentValue(number)), (IEnumerable)source.GetCurrentValue(refTypeArray) == null ? null : (IPAddress[])((ValueComparer>)refTypeArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(refTypeArray)), source.GetCurrentValue>(refTypeEnumerable) == null ? null : ((ValueComparer>)refTypeEnumerable.GetValueComparer()).Snapshot(source.GetCurrentValue>(refTypeEnumerable)), (IEnumerable)source.GetCurrentValue>(refTypeIList) == null ? null : (IList)((ValueComparer>)refTypeIList.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(refTypeIList)), (IEnumerable)source.GetCurrentValue>(refTypeList) == null ? null : (List)((ValueComparer>)refTypeList.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(refTypeList)), (IEnumerable)source.GetCurrentValue(valueTypeArray) == null ? null : (DateTime[])((ValueComparer>)valueTypeArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(valueTypeArray)), source.GetCurrentValue>(valueTypeEnumerable) == null ? null : ((ValueComparer>)valueTypeEnumerable.GetValueComparer()).Snapshot(source.GetCurrentValue>(valueTypeEnumerable)), (IEnumerable)source.GetCurrentValue>(valueTypeIList) == null ? null : (IList)((ValueComparer>)valueTypeIList.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeIList)), (IEnumerable)source.GetCurrentValue>(valueTypeList) == null ? null : (List)((ValueComparer>)valueTypeList.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeList))); + var entity8 = (CompiledModelTestBase.OwnedType)source.Entity; + return (ISnapshot)new Snapshot, IList, List, DateTime[], IEnumerable, IList, List>(((ValueComparer)((IProperty)principalBaseId).GetValueComparer()).Snapshot(source.GetCurrentValue(principalBaseId)), ((ValueComparer)((IProperty)principalBaseAlternateId).GetValueComparer()).Snapshot(source.GetCurrentValue(principalBaseAlternateId)), source.GetCurrentValue(details) == null ? null : ((ValueComparer)((IProperty)details).GetValueComparer()).Snapshot(source.GetCurrentValue(details)), ((ValueComparer)((IProperty)number).GetValueComparer()).Snapshot(source.GetCurrentValue(number)), (object)source.GetCurrentValue(refTypeArray) == null ? null : (IPAddress[])((ValueComparer)((IProperty)refTypeArray).GetValueComparer()).Snapshot((object)source.GetCurrentValue(refTypeArray)), (object)source.GetCurrentValue>(refTypeEnumerable) == null ? null : (IEnumerable)((ValueComparer)((IProperty)refTypeEnumerable).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeEnumerable)), (object)source.GetCurrentValue>(refTypeIList) == null ? null : (IList)((ValueComparer)((IProperty)refTypeIList).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeIList)), (object)source.GetCurrentValue>(refTypeList) == null ? null : (List)((ValueComparer)((IProperty)refTypeList).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeList)), (IEnumerable)source.GetCurrentValue(valueTypeArray) == null ? null : (DateTime[])((ValueComparer>)((IProperty)valueTypeArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(valueTypeArray)), source.GetCurrentValue>(valueTypeEnumerable) == null ? null : ((ValueComparer>)((IProperty)valueTypeEnumerable).GetValueComparer()).Snapshot(source.GetCurrentValue>(valueTypeEnumerable)), (IEnumerable)source.GetCurrentValue>(valueTypeIList) == null ? null : (IList)((ValueComparer>)((IProperty)valueTypeIList).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeIList)), (IEnumerable)source.GetCurrentValue>(valueTypeList) == null ? null : (List)((ValueComparer>)((IProperty)valueTypeList).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeList))); }); runtimeEntityType.SetStoreGeneratedValuesFactory( - () => (ISnapshot)new Snapshot(((ValueComparer)principalBaseId.GetValueComparer()).Snapshot(default(long)), ((ValueComparer)principalBaseAlternateId.GetValueComparer()).Snapshot(default(Guid)))); + () => (ISnapshot)new Snapshot(((ValueComparer)((IProperty)principalBaseId).GetValueComparer()).Snapshot(default(long)), ((ValueComparer)((IProperty)principalBaseAlternateId).GetValueComparer()).Snapshot(default(Guid)))); runtimeEntityType.SetTemporaryValuesFactory( (InternalEntityEntry source) => (ISnapshot)new Snapshot(default(long), default(Guid))); runtimeEntityType.SetShadowValuesFactory( @@ -738,8 +738,8 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) runtimeEntityType.SetRelationshipSnapshotFactory( (InternalEntityEntry source) => { - var entity = (CompiledModelTestBase.OwnedType)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)principalBaseId.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalBaseId)), ((ValueComparer)principalBaseAlternateId.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalBaseAlternateId))); + var entity8 = (CompiledModelTestBase.OwnedType)source.Entity; + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)principalBaseId).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalBaseId)), ((ValueComparer)((IProperty)principalBaseAlternateId).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalBaseAlternateId))); }); runtimeEntityType.Counts = new PropertyCounts( propertyCount: 12, diff --git a/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/BigModel_with_JSON_columns/PrincipalBaseEntityType.cs b/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/BigModel_with_JSON_columns/PrincipalBaseEntityType.cs index ce133ff6d7c..594e2a0c89a 100644 --- a/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/BigModel_with_JSON_columns/PrincipalBaseEntityType.cs +++ b/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/BigModel_with_JSON_columns/PrincipalBaseEntityType.cs @@ -72,15 +72,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas id.TypeMapping = LongTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable)), providerValueComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && (long)v1 == (long)v2 || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((long)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(long)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(long)v : default(Nullable)), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "INTEGER")); @@ -162,11 +162,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum1.TypeMapping = IntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.AnEnum v1, CompiledModelTestBase.AnEnum v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.AnEnum v) => v.GetHashCode(), + (CompiledModelTestBase.AnEnum v) => ((object)v).GetHashCode(), (CompiledModelTestBase.AnEnum v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.AnEnum v1, CompiledModelTestBase.AnEnum v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.AnEnum v) => v.GetHashCode(), + (CompiledModelTestBase.AnEnum v) => ((object)v).GetHashCode(), (CompiledModelTestBase.AnEnum v) => v), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -215,11 +215,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas enum2.TypeMapping = IntTypeMapping.Default.Clone( comparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.AnEnum)v1, (object)(CompiledModelTestBase.AnEnum)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.AnEnum)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.AnEnum)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.AnEnum)v : default(Nullable)), keyComparer: new ValueComparer( (Nullable v1, Nullable v2) => v1.HasValue && v2.HasValue && object.Equals((object)(CompiledModelTestBase.AnEnum)v1, (object)(CompiledModelTestBase.AnEnum)v2) || !v1.HasValue && !v2.HasValue, - (Nullable v) => v.HasValue ? ((CompiledModelTestBase.AnEnum)v).GetHashCode() : 0, + (Nullable v) => v.HasValue ? ((object)(CompiledModelTestBase.AnEnum)v).GetHashCode() : 0, (Nullable v) => v.HasValue ? (Nullable)(CompiledModelTestBase.AnEnum)v : default(Nullable)), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -266,11 +266,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas flagsEnum1.TypeMapping = IntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.AFlagsEnum v1, CompiledModelTestBase.AFlagsEnum v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.AFlagsEnum v) => v.GetHashCode(), + (CompiledModelTestBase.AFlagsEnum v) => ((object)v).GetHashCode(), (CompiledModelTestBase.AFlagsEnum v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.AFlagsEnum v1, CompiledModelTestBase.AFlagsEnum v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.AFlagsEnum v) => v.GetHashCode(), + (CompiledModelTestBase.AFlagsEnum v) => ((object)v).GetHashCode(), (CompiledModelTestBase.AFlagsEnum v) => v), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -319,11 +319,11 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas flagsEnum2.TypeMapping = IntTypeMapping.Default.Clone( comparer: new ValueComparer( (CompiledModelTestBase.AFlagsEnum v1, CompiledModelTestBase.AFlagsEnum v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.AFlagsEnum v) => v.GetHashCode(), + (CompiledModelTestBase.AFlagsEnum v) => ((object)v).GetHashCode(), (CompiledModelTestBase.AFlagsEnum v) => v), keyComparer: new ValueComparer( (CompiledModelTestBase.AFlagsEnum v1, CompiledModelTestBase.AFlagsEnum v2) => object.Equals((object)v1, (object)v2), - (CompiledModelTestBase.AFlagsEnum v) => v.GetHashCode(), + (CompiledModelTestBase.AFlagsEnum v) => ((object)v).GetHashCode(), (CompiledModelTestBase.AFlagsEnum v) => v), providerValueComparer: new ValueComparer( (int v1, int v2) => v1 == v2, @@ -388,52 +388,52 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas relationshipIndex: -1, storeGenerationIndex: -1); refTypeArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfReferenceTypesComparer(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfReferenceTypesComparer(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)))), elementMapping: SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), keyComparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( size: 45), converter: new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))); refTypeArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("PrincipalBaseEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalBase_RefTypeArray", "TestNamespace") }); @@ -465,21 +465,21 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas relationshipIndex: -1, storeGenerationIndex: -1); refTypeEnumerable.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfReferenceTypesComparer, string>(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfReferenceTypesComparer, string>(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, string>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter, string>( JsonStringReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, string>( + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter, string>( JsonStringReaderWriter.Instance), elementMapping: SqliteStringTypeMapping.Default); refTypeEnumerable.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("PrincipalBaseEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalBase_RefTypeEnumerable", "TestNamespace") }); @@ -512,21 +512,21 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas relationshipIndex: -1, storeGenerationIndex: -1); refTypeIList.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfReferenceTypesComparer, string>(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfReferenceTypesComparer, string>(new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, string>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter, string>( JsonStringReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, string>( + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter, string>( JsonStringReaderWriter.Instance), elementMapping: SqliteStringTypeMapping.Default); refTypeIList.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("PrincipalBaseEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalBase_RefTypeIList", "TestNamespace") }); @@ -559,52 +559,52 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas relationshipIndex: -1, storeGenerationIndex: -1); refTypeList.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfReferenceTypesComparer, IPAddress>(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfReferenceTypesComparer, IPAddress>(new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, IPAddress>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfReferencesReaderWriter, IPAddress>( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, IPAddress>( + jsonValueReaderWriter: new JsonCollectionOfReferencesReaderWriter, IPAddress>( new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)))), elementMapping: SqliteStringTypeMapping.Default.Clone( comparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), keyComparer: new ValueComparer( (IPAddress v1, IPAddress v2) => v1 == null && v2 == null || v1 != null && v2 != null && v1.Equals(v2), - (IPAddress v) => v.GetHashCode(), + (IPAddress v) => ((object)v).GetHashCode(), (IPAddress v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( size: 45), converter: new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v)), jsonValueReaderWriter: new JsonConvertedValueReaderWriter( JsonStringReaderWriter.Instance, new ValueConverter( - (IPAddress v) => v.ToString(), + (IPAddress v) => ((object)v).ToString(), (string v) => IPAddress.Parse(v))))); refTypeList.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("PrincipalBaseEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalBase_RefTypeList", "TestNamespace") }); @@ -636,21 +636,21 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas relationshipIndex: -1, storeGenerationIndex: -1); valueTypeArray.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer(new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer(new ValueComparer( (DateTime v1, DateTime v2) => v1.Equals(v2), - (DateTime v) => v.GetHashCode(), + (DateTime v) => ((object)v).GetHashCode(), (DateTime v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter( SqliteJsonDateTimeReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter( SqliteJsonDateTimeReaderWriter.Instance), elementMapping: SqliteDateTimeTypeMapping.Default); valueTypeArray.AddRuntimeAnnotation("UnsafeAccessors", new[] { ("PrincipalBaseEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalBase_ValueTypeArray", "TestNamespace") }); @@ -683,21 +683,21 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas relationshipIndex: -1, storeGenerationIndex: -1); valueTypeEnumerable.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer, byte>(new ValueComparer( (byte v1, byte v2) => v1 == v2, (byte v) => (int)v, (byte v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer, byte>(new ValueComparer( (byte v1, byte v2) => v1 == v2, (byte v) => (int)v, (byte v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, byte>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter, byte>( JsonByteReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, byte>( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, byte>( JsonByteReaderWriter.Instance), elementMapping: ByteTypeMapping.Default.Clone( comparer: new ValueComparer( @@ -744,21 +744,21 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas relationshipIndex: -1, storeGenerationIndex: -1); valueTypeIList.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer, byte>(new ValueComparer( (byte v1, byte v2) => v1 == v2, (byte v) => (int)v, (byte v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer, byte>(new ValueComparer( (byte v1, byte v2) => v1 == v2, (byte v) => (int)v, (byte v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, byte>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter, byte>( JsonByteReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, byte>( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, byte>( JsonByteReaderWriter.Instance), elementMapping: ByteTypeMapping.Default.Clone( comparer: new ValueComparer( @@ -805,21 +805,21 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas relationshipIndex: -1, storeGenerationIndex: -1); valueTypeList.TypeMapping = SqliteStringTypeMapping.Default.Clone( - comparer: new ListComparer(new ValueComparer( + comparer: new ListOfValueTypesComparer, short>(new ValueComparer( (short v1, short v2) => v1 == v2, (short v) => (int)v, (short v) => v)), - keyComparer: new ListComparer(new ValueComparer( + keyComparer: new ListOfValueTypesComparer, short>(new ValueComparer( (short v1, short v2) => v1 == v2, (short v) => (int)v, (short v) => v)), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), - converter: new CollectionToJsonStringConverter(new JsonCollectionReaderWriter, List, short>( + converter: new CollectionToJsonStringConverter(new JsonCollectionOfStructsReaderWriter, short>( JsonInt16ReaderWriter.Instance)), - jsonValueReaderWriter: new JsonCollectionReaderWriter, List, short>( + jsonValueReaderWriter: new JsonCollectionOfStructsReaderWriter, short>( JsonInt16ReaderWriter.Instance), elementMapping: ShortTypeMapping.Default.Clone( comparer: new ValueComparer( @@ -927,11 +927,11 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) runtimeEntityType.SetOriginalValuesFactory( (InternalEntityEntry source) => { - var entity = (CompiledModelTestBase.PrincipalBase)source.Entity; - return (ISnapshot)new Snapshot, Guid, string, CompiledModelTestBase.AnEnum, Nullable, CompiledModelTestBase.AFlagsEnum, CompiledModelTestBase.AFlagsEnum, Point, IPAddress[], IEnumerable, IList, List, DateTime[], IEnumerable, IList, List>(source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)id.GetValueComparer()).Snapshot(source.GetCurrentValue>(id)), ((ValueComparer)alternateId.GetValueComparer()).Snapshot(source.GetCurrentValue(alternateId)), source.GetCurrentValue(discriminator) == null ? null : ((ValueComparer)discriminator.GetValueComparer()).Snapshot(source.GetCurrentValue(discriminator)), ((ValueComparer)enum1.GetValueComparer()).Snapshot(source.GetCurrentValue(enum1)), source.GetCurrentValue>(enum2) == null ? null : ((ValueComparer>)enum2.GetValueComparer()).Snapshot(source.GetCurrentValue>(enum2)), ((ValueComparer)flagsEnum1.GetValueComparer()).Snapshot(source.GetCurrentValue(flagsEnum1)), ((ValueComparer)flagsEnum2.GetValueComparer()).Snapshot(source.GetCurrentValue(flagsEnum2)), source.GetCurrentValue(point) == null ? null : ((ValueComparer)point.GetValueComparer()).Snapshot(source.GetCurrentValue(point)), (IEnumerable)source.GetCurrentValue(refTypeArray) == null ? null : (IPAddress[])((ValueComparer>)refTypeArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(refTypeArray)), source.GetCurrentValue>(refTypeEnumerable) == null ? null : ((ValueComparer>)refTypeEnumerable.GetValueComparer()).Snapshot(source.GetCurrentValue>(refTypeEnumerable)), (IEnumerable)source.GetCurrentValue>(refTypeIList) == null ? null : (IList)((ValueComparer>)refTypeIList.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(refTypeIList)), (IEnumerable)source.GetCurrentValue>(refTypeList) == null ? null : (List)((ValueComparer>)refTypeList.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(refTypeList)), (IEnumerable)source.GetCurrentValue(valueTypeArray) == null ? null : (DateTime[])((ValueComparer>)valueTypeArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(valueTypeArray)), source.GetCurrentValue>(valueTypeEnumerable) == null ? null : ((ValueComparer>)valueTypeEnumerable.GetValueComparer()).Snapshot(source.GetCurrentValue>(valueTypeEnumerable)), (IEnumerable)source.GetCurrentValue>(valueTypeIList) == null ? null : (IList)((ValueComparer>)valueTypeIList.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeIList)), (IEnumerable)source.GetCurrentValue>(valueTypeList) == null ? null : (List)((ValueComparer>)valueTypeList.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeList))); + var entity8 = (CompiledModelTestBase.PrincipalBase)source.Entity; + return (ISnapshot)new Snapshot, Guid, string, CompiledModelTestBase.AnEnum, Nullable, CompiledModelTestBase.AFlagsEnum, CompiledModelTestBase.AFlagsEnum, Point, IPAddress[], IEnumerable, IList, List, DateTime[], IEnumerable, IList, List>(source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)((IProperty)id).GetValueComparer()).Snapshot(source.GetCurrentValue>(id)), ((ValueComparer)((IProperty)alternateId).GetValueComparer()).Snapshot(source.GetCurrentValue(alternateId)), source.GetCurrentValue(discriminator) == null ? null : ((ValueComparer)((IProperty)discriminator).GetValueComparer()).Snapshot(source.GetCurrentValue(discriminator)), ((ValueComparer)((IProperty)enum1).GetValueComparer()).Snapshot(source.GetCurrentValue(enum1)), source.GetCurrentValue>(enum2) == null ? null : ((ValueComparer>)((IProperty)enum2).GetValueComparer()).Snapshot(source.GetCurrentValue>(enum2)), ((ValueComparer)((IProperty)flagsEnum1).GetValueComparer()).Snapshot(source.GetCurrentValue(flagsEnum1)), ((ValueComparer)((IProperty)flagsEnum2).GetValueComparer()).Snapshot(source.GetCurrentValue(flagsEnum2)), source.GetCurrentValue(point) == null ? null : ((ValueComparer)((IProperty)point).GetValueComparer()).Snapshot(source.GetCurrentValue(point)), (object)source.GetCurrentValue(refTypeArray) == null ? null : (IPAddress[])((ValueComparer)((IProperty)refTypeArray).GetValueComparer()).Snapshot((object)source.GetCurrentValue(refTypeArray)), (object)source.GetCurrentValue>(refTypeEnumerable) == null ? null : (IEnumerable)((ValueComparer)((IProperty)refTypeEnumerable).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeEnumerable)), (object)source.GetCurrentValue>(refTypeIList) == null ? null : (IList)((ValueComparer)((IProperty)refTypeIList).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeIList)), (object)source.GetCurrentValue>(refTypeList) == null ? null : (List)((ValueComparer)((IProperty)refTypeList).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeList)), (IEnumerable)source.GetCurrentValue(valueTypeArray) == null ? null : (DateTime[])((ValueComparer>)((IProperty)valueTypeArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(valueTypeArray)), source.GetCurrentValue>(valueTypeEnumerable) == null ? null : ((ValueComparer>)((IProperty)valueTypeEnumerable).GetValueComparer()).Snapshot(source.GetCurrentValue>(valueTypeEnumerable)), (IEnumerable)source.GetCurrentValue>(valueTypeIList) == null ? null : (IList)((ValueComparer>)((IProperty)valueTypeIList).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeIList)), (IEnumerable)source.GetCurrentValue>(valueTypeList) == null ? null : (List)((ValueComparer>)((IProperty)valueTypeList).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeList))); }); runtimeEntityType.SetStoreGeneratedValuesFactory( - () => (ISnapshot)new Snapshot(default(Point) == null ? null : ((ValueComparer)point.GetValueComparer()).Snapshot(default(Point)))); + () => (ISnapshot)new Snapshot(default(Point) == null ? null : ((ValueComparer)((IProperty)point).GetValueComparer()).Snapshot(default(Point)))); runtimeEntityType.SetTemporaryValuesFactory( (InternalEntityEntry source) => (ISnapshot)new Snapshot(default(Point))); runtimeEntityType.SetShadowValuesFactory( @@ -941,8 +941,8 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) runtimeEntityType.SetRelationshipSnapshotFactory( (InternalEntityEntry source) => { - var entity = (CompiledModelTestBase.PrincipalBase)source.Entity; - return (ISnapshot)new Snapshot, Guid, object, object>(source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)id.GetKeyValueComparer()).Snapshot(source.GetCurrentValue>(id)), ((ValueComparer)alternateId.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(alternateId)), UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalBase__ownedField(entity), null); + var entity8 = (CompiledModelTestBase.PrincipalBase)source.Entity; + return (ISnapshot)new Snapshot, Guid, object, object>(source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)((IProperty)id).GetKeyValueComparer()).Snapshot(source.GetCurrentValue>(id)), ((ValueComparer)((IProperty)alternateId).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(alternateId)), UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalBase__ownedField(entity8), null); }); runtimeEntityType.Counts = new PropertyCounts( propertyCount: 16, diff --git a/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/BigModel_with_JSON_columns/PrincipalBasePrincipalDerivedDependentBasebyteEntityType.cs b/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/BigModel_with_JSON_columns/PrincipalBasePrincipalDerivedDependentBasebyteEntityType.cs index a3fc99262a4..a3d011b003d 100644 --- a/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/BigModel_with_JSON_columns/PrincipalBasePrincipalDerivedDependentBasebyteEntityType.cs +++ b/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/BigModel_with_JSON_columns/PrincipalBasePrincipalDerivedDependentBasebyteEntityType.cs @@ -41,10 +41,10 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas propertyInfo: runtimeEntityType.FindIndexerPropertyInfo(), afterSaveBehavior: PropertySaveBehavior.Throw); derivedsId.SetGetter( - (Dictionary entity) => (entity.ContainsKey("DerivedsId") ? entity["DerivedsId"] : null) == null ? 0L : (long)(entity.ContainsKey("DerivedsId") ? entity["DerivedsId"] : null), - (Dictionary entity) => (entity.ContainsKey("DerivedsId") ? entity["DerivedsId"] : null) == null, - (Dictionary instance) => (instance.ContainsKey("DerivedsId") ? instance["DerivedsId"] : null) == null ? 0L : (long)(instance.ContainsKey("DerivedsId") ? instance["DerivedsId"] : null), - (Dictionary instance) => (instance.ContainsKey("DerivedsId") ? instance["DerivedsId"] : null) == null); + (Dictionary entity) => (((IDictionary)entity).ContainsKey("DerivedsId") ? entity["DerivedsId"] : null) == null ? 0L : (long)(((IDictionary)entity).ContainsKey("DerivedsId") ? entity["DerivedsId"] : null), + (Dictionary entity) => (((IDictionary)entity).ContainsKey("DerivedsId") ? entity["DerivedsId"] : null) == null, + (Dictionary instance) => (((IDictionary)instance).ContainsKey("DerivedsId") ? instance["DerivedsId"] : null) == null ? 0L : (long)(((IDictionary)instance).ContainsKey("DerivedsId") ? instance["DerivedsId"] : null), + (Dictionary instance) => (((IDictionary)instance).ContainsKey("DerivedsId") ? instance["DerivedsId"] : null) == null); derivedsId.SetSetter( (Dictionary entity, long value) => entity["DerivedsId"] = (object)value); derivedsId.SetMaterializationSetter( @@ -59,13 +59,13 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas else { { - if (entry.FlaggedAsTemporary(0) && (((Dictionary)entry.Entity).ContainsKey("DerivedsId") ? ((Dictionary)entry.Entity)["DerivedsId"] : null) == null) + if (entry.FlaggedAsTemporary(0) && (((IDictionary)(Dictionary)entry.Entity).ContainsKey("DerivedsId") ? ((Dictionary)entry.Entity)["DerivedsId"] : null) == null) { return entry.ReadTemporaryValue(0); } else { - var nullableValue = ((Dictionary)entry.Entity).ContainsKey("DerivedsId") ? ((Dictionary)entry.Entity)["DerivedsId"] : null; + var nullableValue = ((IDictionary)(Dictionary)entry.Entity).ContainsKey("DerivedsId") ? ((Dictionary)entry.Entity)["DerivedsId"] : null; return nullableValue == null ? default(long) : (long)nullableValue; } } @@ -73,7 +73,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas }, (InternalEntityEntry entry) => { - var nullableValue = ((Dictionary)entry.Entity).ContainsKey("DerivedsId") ? ((Dictionary)entry.Entity)["DerivedsId"] : null; + var nullableValue = ((IDictionary)(Dictionary)entry.Entity).ContainsKey("DerivedsId") ? ((Dictionary)entry.Entity)["DerivedsId"] : null; return nullableValue == null ? default(long) : (long)nullableValue; }, (InternalEntityEntry entry) => entry.ReadOriginalValue(derivedsId, 0), @@ -88,15 +88,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas derivedsId.TypeMapping = LongTypeMapping.Default.Clone( comparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), keyComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "INTEGER")); @@ -108,10 +108,10 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas propertyInfo: runtimeEntityType.FindIndexerPropertyInfo(), afterSaveBehavior: PropertySaveBehavior.Throw); derivedsAlternateId.SetGetter( - (Dictionary entity) => (entity.ContainsKey("DerivedsAlternateId") ? entity["DerivedsAlternateId"] : null) == null ? new Guid("00000000-0000-0000-0000-000000000000") : (Guid)(entity.ContainsKey("DerivedsAlternateId") ? entity["DerivedsAlternateId"] : null), - (Dictionary entity) => (entity.ContainsKey("DerivedsAlternateId") ? entity["DerivedsAlternateId"] : null) == null, - (Dictionary instance) => (instance.ContainsKey("DerivedsAlternateId") ? instance["DerivedsAlternateId"] : null) == null ? new Guid("00000000-0000-0000-0000-000000000000") : (Guid)(instance.ContainsKey("DerivedsAlternateId") ? instance["DerivedsAlternateId"] : null), - (Dictionary instance) => (instance.ContainsKey("DerivedsAlternateId") ? instance["DerivedsAlternateId"] : null) == null); + (Dictionary entity) => (((IDictionary)entity).ContainsKey("DerivedsAlternateId") ? entity["DerivedsAlternateId"] : null) == null ? new Guid("00000000-0000-0000-0000-000000000000") : (Guid)(((IDictionary)entity).ContainsKey("DerivedsAlternateId") ? entity["DerivedsAlternateId"] : null), + (Dictionary entity) => (((IDictionary)entity).ContainsKey("DerivedsAlternateId") ? entity["DerivedsAlternateId"] : null) == null, + (Dictionary instance) => (((IDictionary)instance).ContainsKey("DerivedsAlternateId") ? instance["DerivedsAlternateId"] : null) == null ? new Guid("00000000-0000-0000-0000-000000000000") : (Guid)(((IDictionary)instance).ContainsKey("DerivedsAlternateId") ? instance["DerivedsAlternateId"] : null), + (Dictionary instance) => (((IDictionary)instance).ContainsKey("DerivedsAlternateId") ? instance["DerivedsAlternateId"] : null) == null); derivedsAlternateId.SetSetter( (Dictionary entity, Guid value) => entity["DerivedsAlternateId"] = (object)value); derivedsAlternateId.SetMaterializationSetter( @@ -126,13 +126,13 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas else { { - if (entry.FlaggedAsTemporary(1) && (((Dictionary)entry.Entity).ContainsKey("DerivedsAlternateId") ? ((Dictionary)entry.Entity)["DerivedsAlternateId"] : null) == null) + if (entry.FlaggedAsTemporary(1) && (((IDictionary)(Dictionary)entry.Entity).ContainsKey("DerivedsAlternateId") ? ((Dictionary)entry.Entity)["DerivedsAlternateId"] : null) == null) { return entry.ReadTemporaryValue(1); } else { - var nullableValue = ((Dictionary)entry.Entity).ContainsKey("DerivedsAlternateId") ? ((Dictionary)entry.Entity)["DerivedsAlternateId"] : null; + var nullableValue = ((IDictionary)(Dictionary)entry.Entity).ContainsKey("DerivedsAlternateId") ? ((Dictionary)entry.Entity)["DerivedsAlternateId"] : null; return nullableValue == null ? default(Guid) : (Guid)nullableValue; } } @@ -140,7 +140,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas }, (InternalEntityEntry entry) => { - var nullableValue = ((Dictionary)entry.Entity).ContainsKey("DerivedsAlternateId") ? ((Dictionary)entry.Entity)["DerivedsAlternateId"] : null; + var nullableValue = ((IDictionary)(Dictionary)entry.Entity).ContainsKey("DerivedsAlternateId") ? ((Dictionary)entry.Entity)["DerivedsAlternateId"] : null; return nullableValue == null ? default(Guid) : (Guid)nullableValue; }, (InternalEntityEntry entry) => entry.ReadOriginalValue(derivedsAlternateId, 1), @@ -161,10 +161,10 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas propertyInfo: runtimeEntityType.FindIndexerPropertyInfo(), afterSaveBehavior: PropertySaveBehavior.Throw); principalsId.SetGetter( - (Dictionary entity) => (entity.ContainsKey("PrincipalsId") ? entity["PrincipalsId"] : null) == null ? 0L : (long)(entity.ContainsKey("PrincipalsId") ? entity["PrincipalsId"] : null), - (Dictionary entity) => (entity.ContainsKey("PrincipalsId") ? entity["PrincipalsId"] : null) == null, - (Dictionary instance) => (instance.ContainsKey("PrincipalsId") ? instance["PrincipalsId"] : null) == null ? 0L : (long)(instance.ContainsKey("PrincipalsId") ? instance["PrincipalsId"] : null), - (Dictionary instance) => (instance.ContainsKey("PrincipalsId") ? instance["PrincipalsId"] : null) == null); + (Dictionary entity) => (((IDictionary)entity).ContainsKey("PrincipalsId") ? entity["PrincipalsId"] : null) == null ? 0L : (long)(((IDictionary)entity).ContainsKey("PrincipalsId") ? entity["PrincipalsId"] : null), + (Dictionary entity) => (((IDictionary)entity).ContainsKey("PrincipalsId") ? entity["PrincipalsId"] : null) == null, + (Dictionary instance) => (((IDictionary)instance).ContainsKey("PrincipalsId") ? instance["PrincipalsId"] : null) == null ? 0L : (long)(((IDictionary)instance).ContainsKey("PrincipalsId") ? instance["PrincipalsId"] : null), + (Dictionary instance) => (((IDictionary)instance).ContainsKey("PrincipalsId") ? instance["PrincipalsId"] : null) == null); principalsId.SetSetter( (Dictionary entity, long value) => entity["PrincipalsId"] = (object)value); principalsId.SetMaterializationSetter( @@ -179,13 +179,13 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas else { { - if (entry.FlaggedAsTemporary(2) && (((Dictionary)entry.Entity).ContainsKey("PrincipalsId") ? ((Dictionary)entry.Entity)["PrincipalsId"] : null) == null) + if (entry.FlaggedAsTemporary(2) && (((IDictionary)(Dictionary)entry.Entity).ContainsKey("PrincipalsId") ? ((Dictionary)entry.Entity)["PrincipalsId"] : null) == null) { return entry.ReadTemporaryValue(2); } else { - var nullableValue = ((Dictionary)entry.Entity).ContainsKey("PrincipalsId") ? ((Dictionary)entry.Entity)["PrincipalsId"] : null; + var nullableValue = ((IDictionary)(Dictionary)entry.Entity).ContainsKey("PrincipalsId") ? ((Dictionary)entry.Entity)["PrincipalsId"] : null; return nullableValue == null ? default(long) : (long)nullableValue; } } @@ -193,7 +193,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas }, (InternalEntityEntry entry) => { - var nullableValue = ((Dictionary)entry.Entity).ContainsKey("PrincipalsId") ? ((Dictionary)entry.Entity)["PrincipalsId"] : null; + var nullableValue = ((IDictionary)(Dictionary)entry.Entity).ContainsKey("PrincipalsId") ? ((Dictionary)entry.Entity)["PrincipalsId"] : null; return nullableValue == null ? default(long) : (long)nullableValue; }, (InternalEntityEntry entry) => entry.ReadOriginalValue(principalsId, 2), @@ -208,15 +208,15 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas principalsId.TypeMapping = LongTypeMapping.Default.Clone( comparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), keyComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), providerValueComparer: new ValueComparer( (long v1, long v2) => v1 == v2, - (long v) => v.GetHashCode(), + (long v) => ((object)v).GetHashCode(), (long v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "INTEGER")); @@ -228,10 +228,10 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas propertyInfo: runtimeEntityType.FindIndexerPropertyInfo(), afterSaveBehavior: PropertySaveBehavior.Throw); principalsAlternateId.SetGetter( - (Dictionary entity) => (entity.ContainsKey("PrincipalsAlternateId") ? entity["PrincipalsAlternateId"] : null) == null ? new Guid("00000000-0000-0000-0000-000000000000") : (Guid)(entity.ContainsKey("PrincipalsAlternateId") ? entity["PrincipalsAlternateId"] : null), - (Dictionary entity) => (entity.ContainsKey("PrincipalsAlternateId") ? entity["PrincipalsAlternateId"] : null) == null, - (Dictionary instance) => (instance.ContainsKey("PrincipalsAlternateId") ? instance["PrincipalsAlternateId"] : null) == null ? new Guid("00000000-0000-0000-0000-000000000000") : (Guid)(instance.ContainsKey("PrincipalsAlternateId") ? instance["PrincipalsAlternateId"] : null), - (Dictionary instance) => (instance.ContainsKey("PrincipalsAlternateId") ? instance["PrincipalsAlternateId"] : null) == null); + (Dictionary entity) => (((IDictionary)entity).ContainsKey("PrincipalsAlternateId") ? entity["PrincipalsAlternateId"] : null) == null ? new Guid("00000000-0000-0000-0000-000000000000") : (Guid)(((IDictionary)entity).ContainsKey("PrincipalsAlternateId") ? entity["PrincipalsAlternateId"] : null), + (Dictionary entity) => (((IDictionary)entity).ContainsKey("PrincipalsAlternateId") ? entity["PrincipalsAlternateId"] : null) == null, + (Dictionary instance) => (((IDictionary)instance).ContainsKey("PrincipalsAlternateId") ? instance["PrincipalsAlternateId"] : null) == null ? new Guid("00000000-0000-0000-0000-000000000000") : (Guid)(((IDictionary)instance).ContainsKey("PrincipalsAlternateId") ? instance["PrincipalsAlternateId"] : null), + (Dictionary instance) => (((IDictionary)instance).ContainsKey("PrincipalsAlternateId") ? instance["PrincipalsAlternateId"] : null) == null); principalsAlternateId.SetSetter( (Dictionary entity, Guid value) => entity["PrincipalsAlternateId"] = (object)value); principalsAlternateId.SetMaterializationSetter( @@ -246,13 +246,13 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas else { { - if (entry.FlaggedAsTemporary(3) && (((Dictionary)entry.Entity).ContainsKey("PrincipalsAlternateId") ? ((Dictionary)entry.Entity)["PrincipalsAlternateId"] : null) == null) + if (entry.FlaggedAsTemporary(3) && (((IDictionary)(Dictionary)entry.Entity).ContainsKey("PrincipalsAlternateId") ? ((Dictionary)entry.Entity)["PrincipalsAlternateId"] : null) == null) { return entry.ReadTemporaryValue(3); } else { - var nullableValue = ((Dictionary)entry.Entity).ContainsKey("PrincipalsAlternateId") ? ((Dictionary)entry.Entity)["PrincipalsAlternateId"] : null; + var nullableValue = ((IDictionary)(Dictionary)entry.Entity).ContainsKey("PrincipalsAlternateId") ? ((Dictionary)entry.Entity)["PrincipalsAlternateId"] : null; return nullableValue == null ? default(Guid) : (Guid)nullableValue; } } @@ -260,7 +260,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas }, (InternalEntityEntry entry) => { - var nullableValue = ((Dictionary)entry.Entity).ContainsKey("PrincipalsAlternateId") ? ((Dictionary)entry.Entity)["PrincipalsAlternateId"] : null; + var nullableValue = ((IDictionary)(Dictionary)entry.Entity).ContainsKey("PrincipalsAlternateId") ? ((Dictionary)entry.Entity)["PrincipalsAlternateId"] : null; return nullableValue == null ? default(Guid) : (Guid)nullableValue; }, (InternalEntityEntry entry) => entry.ReadOriginalValue(principalsAlternateId, 3), @@ -285,17 +285,17 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas beforeSaveBehavior: PropertySaveBehavior.Ignore, afterSaveBehavior: PropertySaveBehavior.Ignore); rowid.SetGetter( - (Dictionary entity) => (entity.ContainsKey("rowid") ? entity["rowid"] : null) == null ? null : (byte[])(entity.ContainsKey("rowid") ? entity["rowid"] : null), - (Dictionary entity) => (entity.ContainsKey("rowid") ? entity["rowid"] : null) == null, - (Dictionary instance) => (instance.ContainsKey("rowid") ? instance["rowid"] : null) == null ? null : (byte[])(instance.ContainsKey("rowid") ? instance["rowid"] : null), - (Dictionary instance) => (instance.ContainsKey("rowid") ? instance["rowid"] : null) == null); + (Dictionary entity) => (((IDictionary)entity).ContainsKey("rowid") ? entity["rowid"] : null) == null ? null : (byte[])(((IDictionary)entity).ContainsKey("rowid") ? entity["rowid"] : null), + (Dictionary entity) => (((IDictionary)entity).ContainsKey("rowid") ? entity["rowid"] : null) == null, + (Dictionary instance) => (((IDictionary)instance).ContainsKey("rowid") ? instance["rowid"] : null) == null ? null : (byte[])(((IDictionary)instance).ContainsKey("rowid") ? instance["rowid"] : null), + (Dictionary instance) => (((IDictionary)instance).ContainsKey("rowid") ? instance["rowid"] : null) == null); rowid.SetSetter( (Dictionary entity, byte[] value) => entity["rowid"] = (object)value); rowid.SetMaterializationSetter( (Dictionary entity, byte[] value) => entity["rowid"] = (object)value); rowid.SetAccessors( - (InternalEntityEntry entry) => entry.FlaggedAsStoreGenerated(4) ? entry.ReadStoreGeneratedValue(4) : entry.FlaggedAsTemporary(4) && (((Dictionary)entry.Entity).ContainsKey("rowid") ? ((Dictionary)entry.Entity)["rowid"] : null) == null ? entry.ReadTemporaryValue(4) : (byte[])(((Dictionary)entry.Entity).ContainsKey("rowid") ? ((Dictionary)entry.Entity)["rowid"] : null), - (InternalEntityEntry entry) => (byte[])(((Dictionary)entry.Entity).ContainsKey("rowid") ? ((Dictionary)entry.Entity)["rowid"] : null), + (InternalEntityEntry entry) => entry.FlaggedAsStoreGenerated(4) ? entry.ReadStoreGeneratedValue(4) : entry.FlaggedAsTemporary(4) && (((IDictionary)(Dictionary)entry.Entity).ContainsKey("rowid") ? ((Dictionary)entry.Entity)["rowid"] : null) == null ? entry.ReadTemporaryValue(4) : (byte[])(((IDictionary)(Dictionary)entry.Entity).ContainsKey("rowid") ? ((Dictionary)entry.Entity)["rowid"] : null), + (InternalEntityEntry entry) => (byte[])(((IDictionary)(Dictionary)entry.Entity).ContainsKey("rowid") ? ((Dictionary)entry.Entity)["rowid"] : null), (InternalEntityEntry entry) => entry.ReadOriginalValue(rowid, 4), (InternalEntityEntry entry) => entry.GetCurrentValue(rowid), (ValueBuffer valueBuffer) => valueBuffer[4]); @@ -308,7 +308,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas rowid.TypeMapping = SqliteByteArrayTypeMapping.Default.Clone( comparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), - (byte[] v) => v.GetHashCode(), + (byte[] v) => ((object)v).GetHashCode(), (byte[] v) => v), keyComparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), @@ -361,11 +361,11 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) runtimeEntityType.SetOriginalValuesFactory( (InternalEntityEntry source) => { - var entity = (Dictionary)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)derivedsId.GetValueComparer()).Snapshot(source.GetCurrentValue(derivedsId)), ((ValueComparer)derivedsAlternateId.GetValueComparer()).Snapshot(source.GetCurrentValue(derivedsAlternateId)), ((ValueComparer)principalsId.GetValueComparer()).Snapshot(source.GetCurrentValue(principalsId)), ((ValueComparer)principalsAlternateId.GetValueComparer()).Snapshot(source.GetCurrentValue(principalsAlternateId)), source.GetCurrentValue(rowid) == null ? null : ((ValueComparer)rowid.GetValueComparer()).Snapshot(source.GetCurrentValue(rowid))); + var entity8 = (Dictionary)source.Entity; + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)derivedsId).GetValueComparer()).Snapshot(source.GetCurrentValue(derivedsId)), ((ValueComparer)((IProperty)derivedsAlternateId).GetValueComparer()).Snapshot(source.GetCurrentValue(derivedsAlternateId)), ((ValueComparer)((IProperty)principalsId).GetValueComparer()).Snapshot(source.GetCurrentValue(principalsId)), ((ValueComparer)((IProperty)principalsAlternateId).GetValueComparer()).Snapshot(source.GetCurrentValue(principalsAlternateId)), source.GetCurrentValue(rowid) == null ? null : ((ValueComparer)((IProperty)rowid).GetValueComparer()).Snapshot(source.GetCurrentValue(rowid))); }); runtimeEntityType.SetStoreGeneratedValuesFactory( - () => (ISnapshot)new Snapshot(((ValueComparer)derivedsId.GetValueComparer()).Snapshot(default(long)), ((ValueComparer)derivedsAlternateId.GetValueComparer()).Snapshot(default(Guid)), ((ValueComparer)principalsId.GetValueComparer()).Snapshot(default(long)), ((ValueComparer)principalsAlternateId.GetValueComparer()).Snapshot(default(Guid)), default(byte[]) == null ? null : ((ValueComparer)rowid.GetValueComparer()).Snapshot(default(byte[])))); + () => (ISnapshot)new Snapshot(((ValueComparer)((IProperty)derivedsId).GetValueComparer()).Snapshot(default(long)), ((ValueComparer)((IProperty)derivedsAlternateId).GetValueComparer()).Snapshot(default(Guid)), ((ValueComparer)((IProperty)principalsId).GetValueComparer()).Snapshot(default(long)), ((ValueComparer)((IProperty)principalsAlternateId).GetValueComparer()).Snapshot(default(Guid)), default(byte[]) == null ? null : ((ValueComparer)((IProperty)rowid).GetValueComparer()).Snapshot(default(byte[])))); runtimeEntityType.SetTemporaryValuesFactory( (InternalEntityEntry source) => (ISnapshot)new Snapshot(default(long), default(Guid), default(long), default(Guid), default(byte[]))); runtimeEntityType.SetShadowValuesFactory( @@ -375,8 +375,8 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) runtimeEntityType.SetRelationshipSnapshotFactory( (InternalEntityEntry source) => { - var entity = (Dictionary)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)derivedsId.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(derivedsId)), ((ValueComparer)derivedsAlternateId.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(derivedsAlternateId)), ((ValueComparer)principalsId.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalsId)), ((ValueComparer)principalsAlternateId.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalsAlternateId))); + var entity8 = (Dictionary)source.Entity; + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)derivedsId).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(derivedsId)), ((ValueComparer)((IProperty)derivedsAlternateId).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(derivedsAlternateId)), ((ValueComparer)((IProperty)principalsId).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalsId)), ((ValueComparer)((IProperty)principalsAlternateId).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(principalsAlternateId))); }); runtimeEntityType.Counts = new PropertyCounts( propertyCount: 5, diff --git a/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/BigModel_with_JSON_columns/PrincipalDerivedEntityType.cs b/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/BigModel_with_JSON_columns/PrincipalDerivedEntityType.cs index 2ce2d8dbe3e..defc39d7120 100644 --- a/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/BigModel_with_JSON_columns/PrincipalDerivedEntityType.cs +++ b/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/BigModel_with_JSON_columns/PrincipalDerivedEntityType.cs @@ -112,11 +112,11 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) runtimeEntityType.SetOriginalValuesFactory( (InternalEntityEntry source) => { - var entity = (CompiledModelTestBase.PrincipalDerived>>)source.Entity; - return (ISnapshot)new Snapshot, Guid, string, CompiledModelTestBase.AnEnum, Nullable, CompiledModelTestBase.AFlagsEnum, CompiledModelTestBase.AFlagsEnum, Point, IPAddress[], IEnumerable, IList, List, DateTime[], IEnumerable, IList, List>(source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)id.GetValueComparer()).Snapshot(source.GetCurrentValue>(id)), ((ValueComparer)alternateId.GetValueComparer()).Snapshot(source.GetCurrentValue(alternateId)), source.GetCurrentValue(discriminator) == null ? null : ((ValueComparer)discriminator.GetValueComparer()).Snapshot(source.GetCurrentValue(discriminator)), ((ValueComparer)enum1.GetValueComparer()).Snapshot(source.GetCurrentValue(enum1)), source.GetCurrentValue>(enum2) == null ? null : ((ValueComparer>)enum2.GetValueComparer()).Snapshot(source.GetCurrentValue>(enum2)), ((ValueComparer)flagsEnum1.GetValueComparer()).Snapshot(source.GetCurrentValue(flagsEnum1)), ((ValueComparer)flagsEnum2.GetValueComparer()).Snapshot(source.GetCurrentValue(flagsEnum2)), source.GetCurrentValue(point) == null ? null : ((ValueComparer)point.GetValueComparer()).Snapshot(source.GetCurrentValue(point)), (IEnumerable)source.GetCurrentValue(refTypeArray) == null ? null : (IPAddress[])((ValueComparer>)refTypeArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(refTypeArray)), source.GetCurrentValue>(refTypeEnumerable) == null ? null : ((ValueComparer>)refTypeEnumerable.GetValueComparer()).Snapshot(source.GetCurrentValue>(refTypeEnumerable)), (IEnumerable)source.GetCurrentValue>(refTypeIList) == null ? null : (IList)((ValueComparer>)refTypeIList.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(refTypeIList)), (IEnumerable)source.GetCurrentValue>(refTypeList) == null ? null : (List)((ValueComparer>)refTypeList.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(refTypeList)), (IEnumerable)source.GetCurrentValue(valueTypeArray) == null ? null : (DateTime[])((ValueComparer>)valueTypeArray.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(valueTypeArray)), source.GetCurrentValue>(valueTypeEnumerable) == null ? null : ((ValueComparer>)valueTypeEnumerable.GetValueComparer()).Snapshot(source.GetCurrentValue>(valueTypeEnumerable)), (IEnumerable)source.GetCurrentValue>(valueTypeIList) == null ? null : (IList)((ValueComparer>)valueTypeIList.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeIList)), (IEnumerable)source.GetCurrentValue>(valueTypeList) == null ? null : (List)((ValueComparer>)valueTypeList.GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeList))); + var entity8 = (CompiledModelTestBase.PrincipalDerived>>)source.Entity; + return (ISnapshot)new Snapshot, Guid, string, CompiledModelTestBase.AnEnum, Nullable, CompiledModelTestBase.AFlagsEnum, CompiledModelTestBase.AFlagsEnum, Point, IPAddress[], IEnumerable, IList, List, DateTime[], IEnumerable, IList, List>(source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)((IProperty)id).GetValueComparer()).Snapshot(source.GetCurrentValue>(id)), ((ValueComparer)((IProperty)alternateId).GetValueComparer()).Snapshot(source.GetCurrentValue(alternateId)), source.GetCurrentValue(discriminator) == null ? null : ((ValueComparer)((IProperty)discriminator).GetValueComparer()).Snapshot(source.GetCurrentValue(discriminator)), ((ValueComparer)((IProperty)enum1).GetValueComparer()).Snapshot(source.GetCurrentValue(enum1)), source.GetCurrentValue>(enum2) == null ? null : ((ValueComparer>)((IProperty)enum2).GetValueComparer()).Snapshot(source.GetCurrentValue>(enum2)), ((ValueComparer)((IProperty)flagsEnum1).GetValueComparer()).Snapshot(source.GetCurrentValue(flagsEnum1)), ((ValueComparer)((IProperty)flagsEnum2).GetValueComparer()).Snapshot(source.GetCurrentValue(flagsEnum2)), source.GetCurrentValue(point) == null ? null : ((ValueComparer)((IProperty)point).GetValueComparer()).Snapshot(source.GetCurrentValue(point)), (object)source.GetCurrentValue(refTypeArray) == null ? null : (IPAddress[])((ValueComparer)((IProperty)refTypeArray).GetValueComparer()).Snapshot((object)source.GetCurrentValue(refTypeArray)), (object)source.GetCurrentValue>(refTypeEnumerable) == null ? null : (IEnumerable)((ValueComparer)((IProperty)refTypeEnumerable).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeEnumerable)), (object)source.GetCurrentValue>(refTypeIList) == null ? null : (IList)((ValueComparer)((IProperty)refTypeIList).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeIList)), (object)source.GetCurrentValue>(refTypeList) == null ? null : (List)((ValueComparer)((IProperty)refTypeList).GetValueComparer()).Snapshot((object)source.GetCurrentValue>(refTypeList)), (IEnumerable)source.GetCurrentValue(valueTypeArray) == null ? null : (DateTime[])((ValueComparer>)((IProperty)valueTypeArray).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue(valueTypeArray)), source.GetCurrentValue>(valueTypeEnumerable) == null ? null : ((ValueComparer>)((IProperty)valueTypeEnumerable).GetValueComparer()).Snapshot(source.GetCurrentValue>(valueTypeEnumerable)), (IEnumerable)source.GetCurrentValue>(valueTypeIList) == null ? null : (IList)((ValueComparer>)((IProperty)valueTypeIList).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeIList)), (IEnumerable)source.GetCurrentValue>(valueTypeList) == null ? null : (List)((ValueComparer>)((IProperty)valueTypeList).GetValueComparer()).Snapshot((IEnumerable)source.GetCurrentValue>(valueTypeList))); }); runtimeEntityType.SetStoreGeneratedValuesFactory( - () => (ISnapshot)new Snapshot(default(Point) == null ? null : ((ValueComparer)point.GetValueComparer()).Snapshot(default(Point)))); + () => (ISnapshot)new Snapshot(default(Point) == null ? null : ((ValueComparer)((IProperty)point).GetValueComparer()).Snapshot(default(Point)))); runtimeEntityType.SetTemporaryValuesFactory( (InternalEntityEntry source) => (ISnapshot)new Snapshot(default(Point))); runtimeEntityType.SetShadowValuesFactory( @@ -126,8 +126,8 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) runtimeEntityType.SetRelationshipSnapshotFactory( (InternalEntityEntry source) => { - var entity = (CompiledModelTestBase.PrincipalDerived>>)source.Entity; - return (ISnapshot)new Snapshot, Guid, object, object, object, object, object>(source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)id.GetKeyValueComparer()).Snapshot(source.GetCurrentValue>(id)), ((ValueComparer)alternateId.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(alternateId)), PrincipalBaseEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalBase__ownedField(entity), null, UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalDerived1_Dependent(entity), SnapshotFactoryFactory.SnapshotCollection(UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalDerived1_ManyOwned(entity)), null); + var entity8 = (CompiledModelTestBase.PrincipalDerived>>)source.Entity; + return (ISnapshot)new Snapshot, Guid, object, object, object, object, object>(source.GetCurrentValue>(id) == null ? null : ((ValueComparer>)((IProperty)id).GetKeyValueComparer()).Snapshot(source.GetCurrentValue>(id)), ((ValueComparer)((IProperty)alternateId).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(alternateId)), PrincipalBaseEntityType.UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalBase__ownedField(entity8), null, UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalDerived1_Dependent(entity8), SnapshotFactoryFactory.SnapshotCollection(UnsafeAccessor_Microsoft_EntityFrameworkCore_Scaffolding_PrincipalDerived1_ManyOwned(entity8)), null); }); runtimeEntityType.Counts = new PropertyCounts( propertyCount: 16, diff --git a/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/CheckConstraints/DataEntityType.cs b/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/CheckConstraints/DataEntityType.cs index 4f8f609f8c8..3ff2d9545df 100644 --- a/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/CheckConstraints/DataEntityType.cs +++ b/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/CheckConstraints/DataEntityType.cs @@ -90,7 +90,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas blob.TypeMapping = SqliteByteArrayTypeMapping.Default.Clone( comparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), - (byte[] v) => v.GetHashCode(), + (byte[] v) => ((object)v).GetHashCode(), (byte[] v) => v), keyComparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), @@ -117,10 +117,10 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (CompiledModelTestBase.Data)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)id.GetValueComparer()).Snapshot(source.GetCurrentValue(id)), source.GetCurrentValue(blob) == null ? null : ((ValueComparer)blob.GetValueComparer()).Snapshot(source.GetCurrentValue(blob))); + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetValueComparer()).Snapshot(source.GetCurrentValue(id)), source.GetCurrentValue(blob) == null ? null : ((ValueComparer)((IProperty)blob).GetValueComparer()).Snapshot(source.GetCurrentValue(blob))); }); runtimeEntityType.SetStoreGeneratedValuesFactory( - () => (ISnapshot)new Snapshot(((ValueComparer)id.GetValueComparer()).Snapshot(default(int)))); + () => (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetValueComparer()).Snapshot(default(int)))); runtimeEntityType.SetTemporaryValuesFactory( (InternalEntityEntry source) => (ISnapshot)new Snapshot(default(int))); runtimeEntityType.SetShadowValuesFactory( @@ -131,7 +131,7 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (CompiledModelTestBase.Data)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)id.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(id))); + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(id))); }); runtimeEntityType.Counts = new PropertyCounts( propertyCount: 2, diff --git a/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/Custom_function_parameter_type_mapping/FunctionParameterTypeMappingContextModelBuilder.cs b/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/Custom_function_parameter_type_mapping/FunctionParameterTypeMappingContextModelBuilder.cs index 58c2395db79..90956546837 100644 --- a/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/Custom_function_parameter_type_mapping/FunctionParameterTypeMappingContextModelBuilder.cs +++ b/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/Custom_function_parameter_type_mapping/FunctionParameterTypeMappingContextModelBuilder.cs @@ -49,15 +49,15 @@ partial void Initialize() param.TypeMapping = StringTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "varchar", diff --git a/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/Custom_function_type_mapping/FunctionTypeMappingContextModelBuilder.cs b/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/Custom_function_type_mapping/FunctionTypeMappingContextModelBuilder.cs index 39a9251b1b5..9409012cb15 100644 --- a/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/Custom_function_type_mapping/FunctionTypeMappingContextModelBuilder.cs +++ b/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/Custom_function_type_mapping/FunctionTypeMappingContextModelBuilder.cs @@ -51,15 +51,15 @@ partial void Initialize() getSqlFragmentStatic.TypeMapping = StringTypeMapping.Default.Clone( comparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), keyComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), providerValueComparer: new ValueComparer( (string v1, string v2) => v1 == v2, - (string v) => v.GetHashCode(), + (string v) => ((object)v).GetHashCode(), (string v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "varchar", diff --git a/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/DbFunctions/DataEntityType.cs b/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/DbFunctions/DataEntityType.cs index ce5738637c6..3119766cd8e 100644 --- a/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/DbFunctions/DataEntityType.cs +++ b/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/DbFunctions/DataEntityType.cs @@ -60,7 +60,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas blob.TypeMapping = SqliteByteArrayTypeMapping.Default.Clone( comparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), - (byte[] v) => v.GetHashCode(), + (byte[] v) => ((object)v).GetHashCode(), (byte[] v) => v), keyComparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), @@ -82,7 +82,7 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (CompiledModelTestBase.Data)source.Entity; - return (ISnapshot)new Snapshot(source.GetCurrentValue(blob) == null ? null : ((ValueComparer)blob.GetValueComparer()).Snapshot(source.GetCurrentValue(blob))); + return (ISnapshot)new Snapshot(source.GetCurrentValue(blob) == null ? null : ((ValueComparer)((IProperty)blob).GetValueComparer()).Snapshot(source.GetCurrentValue(blob))); }); runtimeEntityType.SetStoreGeneratedValuesFactory( () => Snapshot.Empty); diff --git a/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/DbFunctions/DbFunctionContextModelBuilder.cs b/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/DbFunctions/DbFunctionContextModelBuilder.cs index 40e53df3e2f..80d5fe41020 100644 --- a/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/DbFunctions/DbFunctionContextModelBuilder.cs +++ b/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/DbFunctions/DbFunctionContextModelBuilder.cs @@ -168,15 +168,15 @@ partial void Initialize() isDateStatic.TypeMapping = BoolTypeMapping.Default.Clone( comparer: new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v), keyComparer: new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v), providerValueComparer: new ValueComparer( (bool v1, bool v2) => v1 == v2, - (bool v) => v.GetHashCode(), + (bool v) => ((object)v).GetHashCode(), (bool v) => v), mappingInfo: new RelationalTypeMappingInfo( storeTypeName: "INTEGER")); diff --git a/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/Dynamic_schema/DataEntityType.cs b/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/Dynamic_schema/DataEntityType.cs index 4f8f609f8c8..3ff2d9545df 100644 --- a/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/Dynamic_schema/DataEntityType.cs +++ b/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/Dynamic_schema/DataEntityType.cs @@ -90,7 +90,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas blob.TypeMapping = SqliteByteArrayTypeMapping.Default.Clone( comparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), - (byte[] v) => v.GetHashCode(), + (byte[] v) => ((object)v).GetHashCode(), (byte[] v) => v), keyComparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), @@ -117,10 +117,10 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (CompiledModelTestBase.Data)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)id.GetValueComparer()).Snapshot(source.GetCurrentValue(id)), source.GetCurrentValue(blob) == null ? null : ((ValueComparer)blob.GetValueComparer()).Snapshot(source.GetCurrentValue(blob))); + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetValueComparer()).Snapshot(source.GetCurrentValue(id)), source.GetCurrentValue(blob) == null ? null : ((ValueComparer)((IProperty)blob).GetValueComparer()).Snapshot(source.GetCurrentValue(blob))); }); runtimeEntityType.SetStoreGeneratedValuesFactory( - () => (ISnapshot)new Snapshot(((ValueComparer)id.GetValueComparer()).Snapshot(default(int)))); + () => (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetValueComparer()).Snapshot(default(int)))); runtimeEntityType.SetTemporaryValuesFactory( (InternalEntityEntry source) => (ISnapshot)new Snapshot(default(int))); runtimeEntityType.SetShadowValuesFactory( @@ -131,7 +131,7 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (CompiledModelTestBase.Data)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)id.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(id))); + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(id))); }); runtimeEntityType.Counts = new PropertyCounts( propertyCount: 2, diff --git a/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/SimpleModel/DependentDerivedEntityType.cs b/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/SimpleModel/DependentDerivedEntityType.cs index 11249546b35..d32d744a4b6 100644 --- a/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/SimpleModel/DependentDerivedEntityType.cs +++ b/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/SimpleModel/DependentDerivedEntityType.cs @@ -120,7 +120,7 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (CompiledModelTestBase.DependentDerived)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)id.GetValueComparer()).Snapshot(source.GetCurrentValue(id)), source.GetCurrentValue(data) == null ? null : ((ValueComparer)data.GetValueComparer()).Snapshot(source.GetCurrentValue(data))); + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetValueComparer()).Snapshot(source.GetCurrentValue(id)), source.GetCurrentValue(data) == null ? null : ((ValueComparer)((IProperty)data).GetValueComparer()).Snapshot(source.GetCurrentValue(data))); }); runtimeEntityType.SetStoreGeneratedValuesFactory( () => Snapshot.Empty); @@ -134,7 +134,7 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (CompiledModelTestBase.DependentDerived)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)id.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(id))); + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(id))); }); runtimeEntityType.Counts = new PropertyCounts( propertyCount: 2, diff --git a/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/Triggers/DataEntityType.cs b/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/Triggers/DataEntityType.cs index 591c3d58b5e..740f4eea5e7 100644 --- a/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/Triggers/DataEntityType.cs +++ b/test/EFCore.Sqlite.FunctionalTests/Scaffolding/Baselines/Triggers/DataEntityType.cs @@ -91,7 +91,7 @@ public static RuntimeEntityType Create(RuntimeModel model, RuntimeEntityType bas blob.TypeMapping = SqliteByteArrayTypeMapping.Default.Clone( comparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), - (byte[] v) => v.GetHashCode(), + (byte[] v) => ((object)v).GetHashCode(), (byte[] v) => v), keyComparer: new ValueComparer( (byte[] v1, byte[] v2) => StructuralComparisons.StructuralEqualityComparer.Equals((object)v1, (object)v2), @@ -124,10 +124,10 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (CompiledModelTestBase.Data)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)id.GetValueComparer()).Snapshot(source.GetCurrentValue(id)), source.GetCurrentValue(blob) == null ? null : ((ValueComparer)blob.GetValueComparer()).Snapshot(source.GetCurrentValue(blob))); + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetValueComparer()).Snapshot(source.GetCurrentValue(id)), source.GetCurrentValue(blob) == null ? null : ((ValueComparer)((IProperty)blob).GetValueComparer()).Snapshot(source.GetCurrentValue(blob))); }); runtimeEntityType.SetStoreGeneratedValuesFactory( - () => (ISnapshot)new Snapshot(((ValueComparer)id.GetValueComparer()).Snapshot(default(int)))); + () => (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetValueComparer()).Snapshot(default(int)))); runtimeEntityType.SetTemporaryValuesFactory( (InternalEntityEntry source) => (ISnapshot)new Snapshot(default(int))); runtimeEntityType.SetShadowValuesFactory( @@ -138,7 +138,7 @@ public static void CreateAnnotations(RuntimeEntityType runtimeEntityType) (InternalEntityEntry source) => { var entity = (CompiledModelTestBase.Data)source.Entity; - return (ISnapshot)new Snapshot(((ValueComparer)id.GetKeyValueComparer()).Snapshot(source.GetCurrentValue(id))); + return (ISnapshot)new Snapshot(((ValueComparer)((IProperty)id).GetKeyValueComparer()).Snapshot(source.GetCurrentValue(id))); }); runtimeEntityType.Counts = new PropertyCounts( propertyCount: 2, diff --git a/test/EFCore.Sqlite.FunctionalTests/Scaffolding/CompiledModelSqliteTest.cs b/test/EFCore.Sqlite.FunctionalTests/Scaffolding/CompiledModelSqliteTest.cs index d296d8ff068..d1a4db51221 100644 --- a/test/EFCore.Sqlite.FunctionalTests/Scaffolding/CompiledModelSqliteTest.cs +++ b/test/EFCore.Sqlite.FunctionalTests/Scaffolding/CompiledModelSqliteTest.cs @@ -78,23 +78,19 @@ protected override void AssertBigModel(IModel model, bool jsonColumns) Assert.IsType>(pointProperty.GetKeyValueComparer()); Assert.IsType>(pointProperty.GetProviderValueComparer()); Assert.Null(pointProperty[CoreAnnotationNames.PropertyAccessMode]); - } //Sprocs not supported - public override void ComplexTypes() - { - } + public override Task ComplexTypes() + => Task.CompletedTask; //Not supported - public override void Sequences() - { - } + public override Task Sequences() + => Task.CompletedTask; //Sprocs not supported - public override void Tpc_Sprocs() - { - } + public override Task Tpc_Sprocs() + => Task.CompletedTask; protected override TestHelpers TestHelpers => SqliteTestHelpers.Instance; protected override ITestStoreFactory TestStoreFactory => SqliteTestStoreFactory.Instance; From f0443cbb57c971eb549783b3588cb31100e4a0a1 Mon Sep 17 00:00:00 2001 From: Arthur Vickers Date: Wed, 1 May 2024 20:23:23 +0100 Subject: [PATCH 2/2] Added test for type that cannot be a partition key --- .../CosmosModelValidatorTest.cs | 55 ++++++++++++++----- 1 file changed, 40 insertions(+), 15 deletions(-) diff --git a/test/EFCore.Cosmos.Tests/Infrastructure/CosmosModelValidatorTest.cs b/test/EFCore.Cosmos.Tests/Infrastructure/CosmosModelValidatorTest.cs index b305ec44de1..4ca8bf18436 100644 --- a/test/EFCore.Cosmos.Tests/Infrastructure/CosmosModelValidatorTest.cs +++ b/test/EFCore.Cosmos.Tests/Infrastructure/CosmosModelValidatorTest.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using Microsoft.EntityFrameworkCore.Cosmos.Internal; +using Newtonsoft.Json.Linq; namespace Microsoft.EntityFrameworkCore.Infrastructure; @@ -42,7 +43,7 @@ public virtual void Detects_missing_id_property() b.Ignore(o => o.Products); }); - VerifyError(CosmosStrings.NoIdProperty(typeof(Order).Name), modelBuilder); + VerifyError(CosmosStrings.NoIdProperty(nameof(Order)), modelBuilder); } [ConditionalFact] @@ -61,7 +62,7 @@ public virtual void Detects_non_key_id_property() b.Ignore(o => o.Products); }); - VerifyError(CosmosStrings.NoIdKey(typeof(Order).Name, "id"), modelBuilder); + VerifyError(CosmosStrings.NoIdKey(nameof(Order), "id"), modelBuilder); } [ConditionalFact] @@ -81,7 +82,7 @@ public virtual void Detects_non_string_id_property() b.Ignore(o => o.Products); }); - VerifyError(CosmosStrings.IdNonStringStoreType("id", typeof(Order).Name, "int"), modelBuilder); + VerifyError(CosmosStrings.IdNonStringStoreType("id", nameof(Order), "int"), modelBuilder); } [ConditionalFact] @@ -131,7 +132,7 @@ public virtual void Detects_non_key_partition_key_property() b.Ignore(o => o.Products); }); - VerifyError(CosmosStrings.NoPartitionKeyKey(typeof(Order).Name, nameof(Order.PartitionId), "id"), modelBuilder); + VerifyError(CosmosStrings.NoPartitionKeyKey(nameof(Order), nameof(Order.PartitionId), "id"), modelBuilder); } [ConditionalFact] @@ -210,10 +211,34 @@ public virtual void Detects_partition_keys_mapped_to_different_properties() VerifyError( CosmosStrings.PartitionKeyStoreNameMismatch( - nameof(Customer.PartitionId), typeof(Customer).Name, "pk", nameof(Order.PartitionId), typeof(Order).Name, + nameof(Customer.PartitionId), nameof(Customer), "pk", nameof(Order.PartitionId), nameof(Order), nameof(Order.PartitionId)), modelBuilder); } + [ConditionalFact] + public virtual void Detects_partition_key_of_different_type() + { + var modelBuilder = TestHelpers.CreateConventionBuilder( + CreateModelLogger(), + CreateValidationLogger(), + configurationBuilder => configurationBuilder.RemoveAllConventions()); + + modelBuilder.Entity( + b => + { + b.ToContainer("Orders"); + b.Property(e => e.Id).HasConversion().ToJsonProperty("id"); + b.Ignore(e => e.Name); + b.Ignore(e => e.PartitionId); + b.Ignore(e => e.Orders); + b.Property("foo"); + b.HasPartitionKey("foo"); + b.HasKey(e => e.Id); + }); + + VerifyError(CosmosStrings.PartitionKeyBadStoreType("foo", nameof(Customer), "JObject"), modelBuilder); + } + [ConditionalFact] public virtual void Detects_conflicting_analytical_ttl() { @@ -223,7 +248,7 @@ public virtual void Detects_conflicting_analytical_ttl() modelBuilder.Entity().ToContainer("Orders") .HasAnalyticalStoreTimeToLive(60); - VerifyError(CosmosStrings.AnalyticalTTLMismatch(-1, typeof(Customer).Name, typeof(Order).Name, 60, "Orders"), modelBuilder); + VerifyError(CosmosStrings.AnalyticalTTLMismatch(-1, nameof(Customer), nameof(Order), 60, "Orders"), modelBuilder); } [ConditionalFact] @@ -235,7 +260,7 @@ public virtual void Detects_conflicting_default_ttl() modelBuilder.Entity().ToContainer("Orders") .HasDefaultTimeToLive(60); - VerifyError(CosmosStrings.DefaultTTLMismatch(100, typeof(Customer).Name, typeof(Order).Name, 60, "Orders"), modelBuilder); + VerifyError(CosmosStrings.DefaultTTLMismatch(100, nameof(Customer), nameof(Order), 60, "Orders"), modelBuilder); } [ConditionalFact] @@ -247,7 +272,7 @@ public virtual void Detects_conflicting_throughput() modelBuilder.Entity().ToContainer("Orders") .HasAutoscaleThroughput(60); - VerifyError(CosmosStrings.ThroughputMismatch(200, typeof(Customer).Name, typeof(Order).Name, 60, "Orders"), modelBuilder); + VerifyError(CosmosStrings.ThroughputMismatch(200, nameof(Customer), nameof(Order), 60, "Orders"), modelBuilder); } [ConditionalFact] @@ -259,7 +284,7 @@ public virtual void Detects_conflicting_throughput_type() modelBuilder.Entity().ToContainer("Orders") .HasAutoscaleThroughput(200); - VerifyError(CosmosStrings.ThroughputTypeMismatch(typeof(Customer).Name, typeof(Order).Name, "Orders"), modelBuilder); + VerifyError(CosmosStrings.ThroughputTypeMismatch(nameof(Customer), nameof(Order), "Orders"), modelBuilder); } [ConditionalFact] @@ -276,7 +301,7 @@ public virtual void Detects_properties_mapped_to_same_property() VerifyError( CosmosStrings.JsonPropertyCollision( - nameof(Order.PartitionId), nameof(Order.Id), typeof(Order).Name, "Details"), modelBuilder); + nameof(Order.PartitionId), nameof(Order.Id), nameof(Order), "Details"), modelBuilder); } [ConditionalFact] @@ -293,7 +318,7 @@ public virtual void Detects_property_and_embedded_type_mapped_to_same_property() VerifyError( CosmosStrings.JsonPropertyCollision( - nameof(Order.OrderDetails), nameof(Order.PartitionId), typeof(Order).Name, "Details"), modelBuilder); + nameof(Order.OrderDetails), nameof(Order.PartitionId), nameof(Order), "Details"), modelBuilder); } [ConditionalFact] @@ -340,7 +365,7 @@ public virtual void Detects_missing_discriminator_value() modelBuilder.Entity().ToContainer("Orders").HasDiscriminator().HasValue(null); modelBuilder.Entity().ToContainer("Orders"); - VerifyError(CoreStrings.NoDiscriminatorValue(typeof(Customer).Name), modelBuilder); + VerifyError(CoreStrings.NoDiscriminatorValue(nameof(Customer)), modelBuilder); } [ConditionalFact] @@ -351,7 +376,7 @@ public virtual void Detects_duplicate_discriminator_values() modelBuilder.Entity().ToContainer("Orders").HasDiscriminator().HasValue("type"); VerifyError( - CosmosStrings.DuplicateDiscriminatorValue(typeof(Order).Name, "type", typeof(Customer).Name, "Orders"), modelBuilder); + CosmosStrings.DuplicateDiscriminatorValue(nameof(Order), "type", nameof(Customer), "Orders"), modelBuilder); } [ConditionalFact] @@ -373,7 +398,7 @@ public virtual void Detects_invalid_concurrency_token() .Property("_not_etag") .IsConcurrencyToken(); - VerifyError(CosmosStrings.NonETagConcurrencyToken(typeof(Customer).Name, "_not_etag"), modelBuilder); + VerifyError(CosmosStrings.NonETagConcurrencyToken(nameof(Customer), "_not_etag"), modelBuilder); } [ConditionalFact] @@ -385,7 +410,7 @@ public virtual void Detects_nonString_concurrency_token() .Property("_etag") .IsConcurrencyToken(); - VerifyError(CosmosStrings.ETagNonStringStoreType("_etag", typeof(Customer).Name, "int"), modelBuilder); + VerifyError(CosmosStrings.ETagNonStringStoreType("_etag", nameof(Customer), "int"), modelBuilder); } protected override TestHelpers TestHelpers