From 6bcc0885bb3d43e4ef63edcfa4339f295125589f Mon Sep 17 00:00:00 2001 From: Andriy Svyryd Date: Mon, 31 Aug 2020 16:43:25 -0700 Subject: [PATCH] Be consistent about OnModelCreating as the terminology for fluent API Use "navigation" rather than "navigation property" Check usage of {foreignKey} and for correct quoting and use foreignKeyProperties where appropriate Fix AnnotationNotFound, BadFilterDerivedType, CircularDependency Update DisplayName for shared-type entity types to include the entity type name Part of #7201 Fixes #22310 --- .../Properties/CosmosStrings.Designer.cs | 2 +- .../Properties/CosmosStrings.resx | 2 +- .../Properties/DesignStrings.Designer.cs | 8 +- .../Properties/DesignStrings.resx | 2 +- .../Extensions/Internal/TupleExtensions.cs | 6 +- .../Properties/RelationalStrings.Designer.cs | 58 +-- .../Properties/RelationalStrings.resx | 46 +- .../Update/ColumnModification.cs | 8 +- .../Update/Internal/CommandBatchPreparer.cs | 24 +- .../Properties/SqlServerStrings.Designer.cs | 16 +- .../Properties/SqlServerStrings.resx | 16 +- .../Properties/SqliteStrings.Designer.cs | 2 +- .../Properties/SqliteStrings.resx | 2 +- src/EFCore/Extensions/EntityTypeExtensions.cs | 4 +- .../Infrastructure/AnnotatableExtensions.cs | 2 +- src/EFCore/Infrastructure/ModelValidator.cs | 5 +- src/EFCore/Metadata/Internal/EntityType.cs | 9 +- src/EFCore/Properties/CoreStrings.Designer.cs | 402 +++++++++--------- src/EFCore/Properties/CoreStrings.resx | 202 ++++----- src/Shared/Multigraph.cs | 2 +- .../TestUtilities/TestSqlLoggerFactory.cs | 2 +- .../Update/CommandBatchPreparerTest.cs | 42 +- .../TestUtilities/ListLoggerFactory.cs | 3 + .../Infrastructure/AnnotatableTest.cs | 2 +- .../Infrastructure/ModelValidatorTest.cs | 7 +- .../Metadata/Internal/EntityTypeTest.cs | 2 +- test/EFCore.Tests/Utilities/MultigraphTest.cs | 18 +- 27 files changed, 463 insertions(+), 431 deletions(-) diff --git a/src/EFCore.Cosmos/Properties/CosmosStrings.Designer.cs b/src/EFCore.Cosmos/Properties/CosmosStrings.Designer.cs index 1490597e07a..56691886d35 100644 --- a/src/EFCore.Cosmos/Properties/CosmosStrings.Designer.cs +++ b/src/EFCore.Cosmos/Properties/CosmosStrings.Designer.cs @@ -163,7 +163,7 @@ public static string NoReadItemQueryString([CanBeNull] object resourceId, [CanBe resourceId, partitionKey); /// - /// Null TypeMapping in Sql Tree. + /// Null TypeMapping in SQL tree. /// public static string NullTypeMappingInSqlTree => GetString("NullTypeMappingInSqlTree"); diff --git a/src/EFCore.Cosmos/Properties/CosmosStrings.resx b/src/EFCore.Cosmos/Properties/CosmosStrings.resx index 4f7c2c8129e..15e01bc7250 100644 --- a/src/EFCore.Cosmos/Properties/CosmosStrings.resx +++ b/src/EFCore.Cosmos/Properties/CosmosStrings.resx @@ -175,7 +175,7 @@ There is no string-based representation of this query as it's executed using 'ReadItemQueryAsync({resourceId}, {partitionKey})'. - Null TypeMapping in Sql Tree. + Null TypeMapping in SQL tree. Offset is not supported without Limit. diff --git a/src/EFCore.Design/Properties/DesignStrings.Designer.cs b/src/EFCore.Design/Properties/DesignStrings.Designer.cs index abf7789307b..85bbe3262e3 100644 --- a/src/EFCore.Design/Properties/DesignStrings.Designer.cs +++ b/src/EFCore.Design/Properties/DesignStrings.Designer.cs @@ -213,12 +213,12 @@ public static string ForeignKeyScaffoldErrorPrincipalTableNotFound([CanBeNull] o foreignKeyName); /// - /// Could not scaffold the foreign key '{foreignKeyName}'. The referenced table '{principaltableName}' could not be scaffolded. + /// Could not scaffold the foreign key '{foreignKeyName}'. The referenced table '{principalTableName}' could not be scaffolded. /// - public static string ForeignKeyScaffoldErrorPrincipalTableScaffoldingError([CanBeNull] object foreignKeyName, [CanBeNull] object principaltableName) + public static string ForeignKeyScaffoldErrorPrincipalTableScaffoldingError([CanBeNull] object foreignKeyName, [CanBeNull] object principalTableName) => string.Format( - GetString("ForeignKeyScaffoldErrorPrincipalTableScaffoldingError", nameof(foreignKeyName), nameof(principaltableName)), - foreignKeyName, principaltableName); + GetString("ForeignKeyScaffoldErrorPrincipalTableScaffoldingError", nameof(foreignKeyName), nameof(principalTableName)), + foreignKeyName, principalTableName); /// /// Could not scaffold the foreign key '{foreignKeyName}'. The following columns in the foreign key could not be scaffolded: {columnNames}. diff --git a/src/EFCore.Design/Properties/DesignStrings.resx b/src/EFCore.Design/Properties/DesignStrings.resx index a8c3fe9f99e..88df94c5ad4 100644 --- a/src/EFCore.Design/Properties/DesignStrings.resx +++ b/src/EFCore.Design/Properties/DesignStrings.resx @@ -196,7 +196,7 @@ Could not scaffold the foreign key '{foreignKeyName}'. The referenced table could not be found. This most likely occurred because the referenced table was excluded from scaffolding. - Could not scaffold the foreign key '{foreignKeyName}'. The referenced table '{principaltableName}' could not be scaffolded. + Could not scaffold the foreign key '{foreignKeyName}'. The referenced table '{principalTableName}' could not be scaffolded. Could not scaffold the foreign key '{foreignKeyName}'. The following columns in the foreign key could not be scaffolded: {columnNames}. diff --git a/src/EFCore.Relational/Extensions/Internal/TupleExtensions.cs b/src/EFCore.Relational/Extensions/Internal/TupleExtensions.cs index 1f320c94255..50e3c709e81 100644 --- a/src/EFCore.Relational/Extensions/Internal/TupleExtensions.cs +++ b/src/EFCore.Relational/Extensions/Internal/TupleExtensions.cs @@ -24,7 +24,7 @@ public static class TupleExtensions /// public static string FormatTables([NotNull] this IEnumerable<(string Table, string Schema)> tables) => "{" - + string.Join(", ", tables.Select(FormatTable)) + + string.Join(", ", tables.Select(t => "'" + FormatTable(t) + "'")) + "}"; /// @@ -34,8 +34,6 @@ public static string FormatTables([NotNull] this IEnumerable<(string Table, stri /// doing so can result in application failures when updating to a new Entity Framework Core release. /// public static string FormatTable(this (string Table, string Schema) table) - => "'" - + (table.Schema == null ? table.Table : table.Schema + "." + table.Table) - + "'"; + => table.Schema == null ? table.Table : table.Schema + "." + table.Table; } } diff --git a/src/EFCore.Relational/Properties/RelationalStrings.Designer.cs b/src/EFCore.Relational/Properties/RelationalStrings.Designer.cs index 5991938abef..ffccfb54b33 100644 --- a/src/EFCore.Relational/Properties/RelationalStrings.Designer.cs +++ b/src/EFCore.Relational/Properties/RelationalStrings.Designer.cs @@ -49,7 +49,7 @@ public static string ClientGroupByNotSupported => GetString("ClientGroupByNotSupported"); /// - /// The column '{column}' on table {table} has unspecified computed column SQL. Specify the SQL before using EF Core to create the database schema. + /// The column '{column}' on table '{table}' has unspecified computed column SQL. Specify the SQL before using EF Core to create the database schema. /// public static string ComputedColumnSqlUnspecified([CanBeNull] object column, [CanBeNull] object table) => string.Format( @@ -77,20 +77,20 @@ public static string ConflictingEnlistedTransaction => GetString("ConflictingEnlistedTransaction"); /// - /// An instance of entity type '{firstEntityType}' and an instance of entity type '{secondEntityType}' are mapped to the same row, but have different original property values for the properties {firstProperties} and {secondProperties} mapped to {columns}. Consider using 'DbContextOptionsBuilder.EnableSensitiveDataLogging' to see the conflicting values. + /// An instance of entity type '{firstEntityType}' and an instance of entity type '{secondEntityType}' are mapped to the same row, but have different original property values for the properties {firstProperty} and {secondProperty} mapped to '{column}'. Consider using 'DbContextOptionsBuilder.EnableSensitiveDataLogging' to see the conflicting values. /// - public static string ConflictingOriginalRowValues([CanBeNull] object firstEntityType, [CanBeNull] object secondEntityType, [CanBeNull] object firstProperties, [CanBeNull] object secondProperties, [CanBeNull] object columns) + public static string ConflictingOriginalRowValues([CanBeNull] object firstEntityType, [CanBeNull] object secondEntityType, [CanBeNull] object firstProperty, [CanBeNull] object secondProperty, [CanBeNull] object column) => string.Format( - GetString("ConflictingOriginalRowValues", nameof(firstEntityType), nameof(secondEntityType), nameof(firstProperties), nameof(secondProperties), nameof(columns)), - firstEntityType, secondEntityType, firstProperties, secondProperties, columns); + GetString("ConflictingOriginalRowValues", nameof(firstEntityType), nameof(secondEntityType), nameof(firstProperty), nameof(secondProperty), nameof(column)), + firstEntityType, secondEntityType, firstProperty, secondProperty, column); /// - /// The instance of entity type '{firstEntityType}' and the instance of entity type '{secondEntityType}' are mapped to the same row with the key value '{keyValue}', but have different original property values '{firstConflictingValues}' and '{secondConflictingValues}' for the column {columns}. + /// The instance of entity type '{firstEntityType}' and the instance of entity type '{secondEntityType}' are mapped to the same row with the key value '{keyValue}', but have different original property values {firstConflictingValues} and {secondConflictingValues} for the column '{column}'. /// - public static string ConflictingOriginalRowValuesSensitive([CanBeNull] object firstEntityType, [CanBeNull] object secondEntityType, [CanBeNull] object keyValue, [CanBeNull] object firstConflictingValues, [CanBeNull] object secondConflictingValues, [CanBeNull] object columns) + public static string ConflictingOriginalRowValuesSensitive([CanBeNull] object firstEntityType, [CanBeNull] object secondEntityType, [CanBeNull] object keyValue, [CanBeNull] object firstConflictingValues, [CanBeNull] object secondConflictingValues, [CanBeNull] object column) => string.Format( - GetString("ConflictingOriginalRowValuesSensitive", nameof(firstEntityType), nameof(secondEntityType), nameof(keyValue), nameof(firstConflictingValues), nameof(secondConflictingValues), nameof(columns)), - firstEntityType, secondEntityType, keyValue, firstConflictingValues, secondConflictingValues, columns); + GetString("ConflictingOriginalRowValuesSensitive", nameof(firstEntityType), nameof(secondEntityType), nameof(keyValue), nameof(firstConflictingValues), nameof(secondConflictingValues), nameof(column)), + firstEntityType, secondEntityType, keyValue, firstConflictingValues, secondConflictingValues, column); /// /// An instance of entity type '{firstEntityType}' is marked as '{firstState}', but an instance of entity type '{secondEntityType}' is marked as '{secondState}' and both are mapped to the same row. Consider using 'DbContextOptionsBuilder.EnableSensitiveDataLogging' to see the key values. @@ -109,7 +109,7 @@ public static string ConflictingRowUpdateTypesSensitive([CanBeNull] object first firstEntityType, firstKeyValue, firstState, secondEntityType, secondKeyValue, secondState); /// - /// An instance of entity type '{firstEntityType}' and an instance of entity type '{secondEntityType}' are mapped to the same row, but have different property values for the properties {firstProperty} and {secondProperty} mapped to {column}. Consider using 'DbContextOptionsBuilder.EnableSensitiveDataLogging' to see the conflicting values. + /// An instance of entity type '{firstEntityType}' and an instance of entity type '{secondEntityType}' are mapped to the same row, but have different property values for the properties {firstProperty} and {secondProperty} mapped to '{column}'. Consider using 'DbContextOptionsBuilder.EnableSensitiveDataLogging' to see the conflicting values. /// public static string ConflictingRowValues([CanBeNull] object firstEntityType, [CanBeNull] object secondEntityType, [CanBeNull] object firstProperty, [CanBeNull] object secondProperty, [CanBeNull] object column) => string.Format( @@ -117,7 +117,7 @@ public static string ConflictingRowValues([CanBeNull] object firstEntityType, [C firstEntityType, secondEntityType, firstProperty, secondProperty, column); /// - /// The instance of entity type '{firstEntityType}' and the instance of entity type '{secondEntityType}' are mapped to the same row with the key value '{keyValue}', but have different property values '{firstConflictingValue}' and '{secondConflictingValue}' for the column {column}. + /// The instance of entity type '{firstEntityType}' and the instance of entity type '{secondEntityType}' are mapped to the same row with the key value '{keyValue}', but have different property values '{firstConflictingValue}' and '{secondConflictingValue}' for the column '{column}'. /// public static string ConflictingRowValuesSensitive([CanBeNull] object firstEntityType, [CanBeNull] object secondEntityType, [CanBeNull] object keyValue, [CanBeNull] object firstConflictingValue, [CanBeNull] object secondConflictingValue, [CanBeNull] object column) => string.Format( @@ -235,7 +235,7 @@ public static string DbFunctionTableValuedCustomTranslation([CanBeNull] object f function); /// - /// The column '{column}' on table {table} has unspecified default value SQL. Specify the SQL before using EF Core to create the database schema. + /// The column '{column}' on table '{table}' has unspecified default value SQL. Specify the SQL before using EF Core to create the database schema. /// public static string DefaultValueSqlUnspecified([CanBeNull] object column, [CanBeNull] object table) => string.Format( @@ -243,7 +243,7 @@ public static string DefaultValueSqlUnspecified([CanBeNull] object column, [CanB column, table); /// - /// The column '{column}' on table {table} has an unspecified default value. Specify a value before using EF Core to create the database schema. + /// The column '{column}' on table '{table}' has an unspecified default value. Specify a value before using EF Core to create the database schema. /// public static string DefaultValueUnspecified([CanBeNull] object column, [CanBeNull] object table) => string.Format( @@ -460,7 +460,7 @@ public static string DuplicateKeyColumnMismatch([CanBeNull] object keyProperties keyProperties1, entityType1, keyProperties2, entityType2, table, keyName, columnNames1, columnNames2); /// - /// The keys {keyProperties1} on '{entityType1}' and {keyProperties2} on '{entityType2}' are both mapped to '{keyName}' but with different columns ('{table1}' and '{table2}'). + /// The keys {keyProperties1} on '{entityType1}' and {keyProperties2} on '{entityType2}' are both mapped to '{keyName}' but on different tables ('{table1}' and '{table2}'). /// public static string DuplicateKeyTableMismatch([CanBeNull] object keyProperties1, [CanBeNull] object entityType1, [CanBeNull] object keyProperties2, [CanBeNull] object entityType2, [CanBeNull] object keyName, [CanBeNull] object table1, [CanBeNull] object table2) => string.Format( @@ -498,7 +498,7 @@ public static string FunctionOverrideMismatch([CanBeNull] object propertySpecifi propertySpecification, function); /// - /// Data is Null. This method or property cannot be called on Null values. + /// Data is null. This method or property cannot be called on null values. /// public static string GetXMethodOnNullData => GetString("GetXMethodOnNullData"); @@ -598,7 +598,7 @@ public static string InvalidCommandTimeout => GetString("InvalidCommandTimeout"); /// - /// 'UpdateEntityType' called with '{derivedType}' which is not derived type of '{entityType}'. + /// The specified entity type '{derivedType}' is not derived from '{entityType}'. /// public static string InvalidDerivedTypeInEntityProjection([CanBeNull] object derivedType, [CanBeNull] object entityType) => string.Format( @@ -606,7 +606,7 @@ public static string InvalidDerivedTypeInEntityProjection([CanBeNull] object der derivedType, entityType); /// - /// Invalid keySelector for Group By. + /// Invalid keySelector for GroupBy. /// public static string InvalidKeySelectorForGroupBy => GetString("InvalidKeySelectorForGroupBy"); @@ -778,7 +778,7 @@ public static string NonTPHViewClash([CanBeNull] object entityType, [CanBeNull] entityType, otherEntityType, view); /// - /// No relational database providers are configured. Configure a database provider using OnConfiguring or by creating an ImmutableDbContextOptions with a database provider configured and passing it to the context. + /// No relational database providers are configured. Configure a database provider using 'OnConfiguring' or by creating an ImmutableDbContextOptions with a database provider configured and passing it to the context. /// public static string NoProviderConfigured => GetString("NoProviderConfigured"); @@ -798,7 +798,7 @@ public static string NullabilityInfoOnlyAllowedOnScalarFunctions => GetString("NullabilityInfoOnlyAllowedOnScalarFunctions"); /// - /// Null TypeMapping in Sql Tree. + /// Null TypeMapping in SQL tree. /// public static string NullTypeMappingInSqlTree => GetString("NullTypeMappingInSqlTree"); @@ -844,7 +844,7 @@ public static string QueryUnableToIdentifyConcreteTypeInTPT => GetString("QueryUnableToIdentifyConcreteTypeInTPT"); /// - /// The entity type '{entityType}' is not mapped to a table, therefore the entities cannot be persisted to the database. Use ToTable to map it. + /// The entity type '{entityType}' is not mapped to a table, therefore the entities cannot be persisted to the database. Use 'ToTable' in 'OnModelCreating' to map it. /// public static string ReadonlyEntitySaved([CanBeNull] object entityType) => string.Format( @@ -872,7 +872,7 @@ public static string SequenceContainsNoElements => GetString("SequenceContainsNoElements"); /// - /// Can't process set operations after client evaluation, consider moving the operation before the last Select() call (see issue #16243). + /// Can't process set operations after client evaluation, consider moving the operation before the last 'Select' call (see issue #16243). /// public static string SetOperationsNotAllowedAfterClientEvaluation => GetString("SetOperationsNotAllowedAfterClientEvaluation"); @@ -1919,7 +1919,7 @@ public static EventDefinition LogMigrationAttributeMissingWarning([NotNu } /// - /// Compiling a query which loads related collections for more than one collection navigation property either via 'Include' or through projection but no 'QuerySplittingBehavior' has been configured. By default EF Core will use 'QuerySplittingBehavior.SingleQuery' which can potentially result in slow query performance. See https://go.microsoft.com/fwlink/?linkid=2134277 for more information. To identify the query that's triggering this warning call .ConfigureWarnings(w => w.Throw(RelationalEventId.MultipleCollectionIncludeWarning)) + /// Compiling a query which loads related collections for more than one collection navigation either via 'Include' or through projection but no 'QuerySplittingBehavior' has been configured. By default EF Core will use 'QuerySplittingBehavior.SingleQuery' which can potentially result in slow query performance. See https://go.microsoft.com/fwlink/?linkid=2134277 for more information. To identify the query that's triggering this warning call 'ConfigureWarnings(w => w.Throw(RelationalEventId.MultipleCollectionIncludeWarning))' /// public static EventDefinition LogMultipleCollectionIncludeWarning([NotNull] IDiagnosticsLogger logger) { @@ -1943,7 +1943,7 @@ public static EventDefinition LogMultipleCollectionIncludeWarning([NotNull] IDia } /// - /// The index named '{indexName}' on the entity type '{entityType}' specifies properties {indexPropertiesList}. None of these properties are mapped to a column in any table. This index will not be created in the database. + /// The index named '{indexName}' on the entity type '{entityType}' specifies properties {indexProperties}. None of these properties are mapped to a column in any table. This index will not be created in the database. /// public static EventDefinition LogNamedIndexAllPropertiesNotToMappedToAnyTable([NotNull] IDiagnosticsLogger logger) { @@ -1967,7 +1967,7 @@ public static EventDefinition LogNamedIndexAllProperties } /// - /// The index named '{indexName}' on the entity type '{entityType}' specifies properties {indexPropertiesList}. Some properties are mapped to a column in a table, but the property '{propertyName}' is not. All of the properties should be mapped for the index to be created in the database. + /// The index named '{indexName}' on the entity type '{entityType}' specifies properties {indexProperties}. Some properties are mapped to a column in a table, but the property '{propertyName}' is not. All of the properties should be mapped for the index to be created in the database. /// public static EventDefinition LogNamedIndexPropertiesBothMappedAndNotMappedToTable([NotNull] IDiagnosticsLogger logger) { @@ -1991,7 +1991,7 @@ public static EventDefinition LogNamedIndexPrope } /// - /// The index named '{indexName}' on the entity type '{entityType}' specifies properties {indexPropertiesList}. The property '{propertyName1}' is mapped to table(s) {tableList1}, whereas the property '{propertyName2}' is mapped to table(s) {tableList2}. All index properties must map to at least one common table. + /// The index named '{indexName}' on the entity type '{entityType}' specifies properties {indexProperties}. The property '{propertyName1}' is mapped to table(s) {tables1}, whereas the property '{propertyName2}' is mapped to table(s) {tables2}. All index properties must map to at least one common table. /// public static FallbackEventDefinition LogNamedIndexPropertiesMappedToNonOverlappingTables([NotNull] IDiagnosticsLogger logger) { @@ -2277,7 +2277,7 @@ public static EventDefinition LogRolledBackTransaction([NotNull] IDiagnosticsLog } /// - /// Rolling back to transaction savepoint.. + /// Rolling back to transaction savepoint. /// public static EventDefinition LogRollingBackToTransactionSavepoint([NotNull] IDiagnosticsLogger logger) { @@ -2349,7 +2349,7 @@ public static EventDefinition LogTransactionError([NotNull] IDiagnosticsLogger l } /// - /// The unnamed index on the entity type '{entityType}' specifies properties {indexPropertiesList}. None of these properties are mapped to a column in any table. This index will not be created in the database. + /// The unnamed index on the entity type '{entityType}' specifies properties {indexProperties}. None of these properties are mapped to a column in any table. This index will not be created in the database. /// public static EventDefinition LogUnnamedIndexAllPropertiesNotToMappedToAnyTable([NotNull] IDiagnosticsLogger logger) { @@ -2373,7 +2373,7 @@ public static EventDefinition LogUnnamedIndexAllPropertiesNotToM } /// - /// The unnamed index on the entity type '{entityType}' specifies properties {indexPropertiesList}. Some properties are mapped to a column in a table, but the property '{propertyName}' is not. All of the properties should be mapped for the index to be created in the database. + /// The unnamed index on the entity type '{entityType}' specifies properties {indexProperties}. Some properties are mapped to a column in a table, but the property '{propertyName}' is not. All of the properties should be mapped for the index to be created in the database. /// public static EventDefinition LogUnnamedIndexPropertiesBothMappedAndNotMappedToTable([NotNull] IDiagnosticsLogger logger) { @@ -2397,7 +2397,7 @@ public static EventDefinition LogUnnamedIndexPropertiesB } /// - /// The unnamed index on the entity type '{entityType}' specifies properties {indexPropertiesList}. The property '{propertyName1}' is mapped to table(s) {tableList1}, whereas the property '{propertyName2}' is mapped to table(s) {tableList2}. All index properties must map to at least one common table. + /// The unnamed index on the entity type '{entityType}' specifies properties {indexProperties}. The property '{propertyName1}' is mapped to table(s) {tableList1}, whereas the property '{propertyName2}' is mapped to table(s) {tableList2}. All index properties must map to at least one common table. /// public static EventDefinition LogUnnamedIndexPropertiesMappedToNonOverlappingTables([NotNull] IDiagnosticsLogger logger) { diff --git a/src/EFCore.Relational/Properties/RelationalStrings.resx b/src/EFCore.Relational/Properties/RelationalStrings.resx index a406425c9dd..c4eabe8d9b5 100644 --- a/src/EFCore.Relational/Properties/RelationalStrings.resx +++ b/src/EFCore.Relational/Properties/RelationalStrings.resx @@ -130,7 +130,7 @@ The given GroupBy pattern is not translatable. Call AsEnumerable before GroupBy to evaluate it locally. - The column '{column}' on table {table} has unspecified computed column SQL. Specify the SQL before using EF Core to create the database schema. + The column '{column}' on table '{table}' has unspecified computed column SQL. Specify the SQL before using EF Core to create the database schema. An ambient transaction has been detected. The ambient transaction needs to be completed before beginning a transaction on this connection. @@ -142,10 +142,10 @@ The connection is currently enlisted in a transaction. The enlisted transaction needs to be completed before starting a transaction. - An instance of entity type '{firstEntityType}' and an instance of entity type '{secondEntityType}' are mapped to the same row, but have different original property values for the properties {firstProperties} and {secondProperties} mapped to {columns}. Consider using 'DbContextOptionsBuilder.EnableSensitiveDataLogging' to see the conflicting values. + An instance of entity type '{firstEntityType}' and an instance of entity type '{secondEntityType}' are mapped to the same row, but have different original property values for the properties {firstProperty} and {secondProperty} mapped to '{column}'. Consider using 'DbContextOptionsBuilder.EnableSensitiveDataLogging' to see the conflicting values. - The instance of entity type '{firstEntityType}' and the instance of entity type '{secondEntityType}' are mapped to the same row with the key value '{keyValue}', but have different original property values '{firstConflictingValues}' and '{secondConflictingValues}' for the column {columns}. + The instance of entity type '{firstEntityType}' and the instance of entity type '{secondEntityType}' are mapped to the same row with the key value '{keyValue}', but have different original property values {firstConflictingValues} and {secondConflictingValues} for the column '{column}'. An instance of entity type '{firstEntityType}' is marked as '{firstState}', but an instance of entity type '{secondEntityType}' is marked as '{secondState}' and both are mapped to the same row. Consider using 'DbContextOptionsBuilder.EnableSensitiveDataLogging' to see the key values. @@ -154,10 +154,10 @@ The instance of entity type '{firstEntityType}' with the key value '{firstKeyValue}' is marked as '{firstState}', but the instance of entity type '{secondEntityType}' with the key value '{secondKeyValue}' is marked as '{secondState}' and both are mapped to the same row. - An instance of entity type '{firstEntityType}' and an instance of entity type '{secondEntityType}' are mapped to the same row, but have different property values for the properties {firstProperty} and {secondProperty} mapped to {column}. Consider using 'DbContextOptionsBuilder.EnableSensitiveDataLogging' to see the conflicting values. + An instance of entity type '{firstEntityType}' and an instance of entity type '{secondEntityType}' are mapped to the same row, but have different property values for the properties {firstProperty} and {secondProperty} mapped to '{column}'. Consider using 'DbContextOptionsBuilder.EnableSensitiveDataLogging' to see the conflicting values. - The instance of entity type '{firstEntityType}' and the instance of entity type '{secondEntityType}' are mapped to the same row with the key value '{keyValue}', but have different property values '{firstConflictingValue}' and '{secondConflictingValue}' for the column {column}. + The instance of entity type '{firstEntityType}' and the instance of entity type '{secondEntityType}' are mapped to the same row with the key value '{keyValue}', but have different property values '{firstConflictingValue}' and '{secondConflictingValue}' for the column '{column}'. The database model hasn't been initialized. The model needs to be finalized before the database model can be accessed. @@ -202,10 +202,10 @@ Cannot set custom translation on the DbFunction '{function}' since it is a table valued function. - The column '{column}' on table {table} has unspecified default value SQL. Specify the SQL before using EF Core to create the database schema. + The column '{column}' on table '{table}' has unspecified default value SQL. Specify the SQL before using EF Core to create the database schema. - The column '{column}' on table {table} has an unspecified default value. Specify a value before using EF Core to create the database schema. + The column '{column}' on table '{table}' has an unspecified default value. Specify a value before using EF Core to create the database schema. The data deletion operation on '{table}' is not associated with a model. Either add a model to the migration or specify the column types in all data operations. @@ -287,7 +287,7 @@ The keys {keyProperties1} on '{entityType1}' and {keyProperties2} on '{entityType2}' are both mapped to '{table}.{keyName}' but with different columns ({columnNames1} and {columnNames2}). - The keys {keyProperties1} on '{entityType1}' and {keyProperties2} on '{entityType2}' are both mapped to '{keyName}' but with different columns ('{table1}' and '{table2}'). + The keys {keyProperties1} on '{entityType1}' and {keyProperties2} on '{entityType2}' are both mapped to '{keyName}' but on different tables ('{table1}' and '{table2}'). Either {param1} or {param2} must be null. @@ -302,7 +302,7 @@ The property '{propertySpecification}' has specific configuration for the function '{function}', however it isn't mapped to a column on that function return. Remove the specific configuration or map an entity type that contains this property to '{function}'. - Data is Null. This method or property cannot be called on Null values. + Data is null. This method or property cannot be called on null values. Cannot use table '{table}' for entity type '{entityType}' since it is being used for entity type '{otherEntityType}' and the comment '{comment}' does not match the comment '{otherComment}'. @@ -341,10 +341,10 @@ The specified CommandTimeout value is not valid. It must be a positive number. - 'UpdateEntityType' called with '{derivedType}' which is not derived type of '{entityType}'. + The specified entity type '{derivedType}' is not derived from '{entityType}'. - Invalid keySelector for Group By. + Invalid keySelector for GroupBy. The entity type '{entityType}' is mapped to the DbFunction named '{functionName}' and it's derived from '{baseEntityType}'. Derived entity types cannot be mapped to a function. @@ -496,19 +496,19 @@ Warning RelationalEventId.MigrationAttributeMissingWarning string - Compiling a query which loads related collections for more than one collection navigation property either via 'Include' or through projection but no 'QuerySplittingBehavior' has been configured. By default EF Core will use 'QuerySplittingBehavior.SingleQuery' which can potentially result in slow query performance. See https://go.microsoft.com/fwlink/?linkid=2134277 for more information. To identify the query that's triggering this warning call .ConfigureWarnings(w => w.Throw(RelationalEventId.MultipleCollectionIncludeWarning)) + Compiling a query which loads related collections for more than one collection navigation either via 'Include' or through projection but no 'QuerySplittingBehavior' has been configured. By default EF Core will use 'QuerySplittingBehavior.SingleQuery' which can potentially result in slow query performance. See https://go.microsoft.com/fwlink/?linkid=2134277 for more information. To identify the query that's triggering this warning call 'ConfigureWarnings(w => w.Throw(RelationalEventId.MultipleCollectionIncludeWarning))' Warning RelationalEventId.MultipleCollectionIncludeWarning - The index named '{indexName}' on the entity type '{entityType}' specifies properties {indexPropertiesList}. None of these properties are mapped to a column in any table. This index will not be created in the database. + The index named '{indexName}' on the entity type '{entityType}' specifies properties {indexProperties}. None of these properties are mapped to a column in any table. This index will not be created in the database. Information RelationalEventId.AllIndexPropertiesNotToMappedToAnyTable string string string - The index named '{indexName}' on the entity type '{entityType}' specifies properties {indexPropertiesList}. Some properties are mapped to a column in a table, but the property '{propertyName}' is not. All of the properties should be mapped for the index to be created in the database. + The index named '{indexName}' on the entity type '{entityType}' specifies properties {indexProperties}. Some properties are mapped to a column in a table, but the property '{propertyName}' is not. All of the properties should be mapped for the index to be created in the database. Error RelationalEventId.IndexPropertiesBothMappedAndNotMappedToTable string string string string - The index named '{indexName}' on the entity type '{entityType}' specifies properties {indexPropertiesList}. The property '{propertyName1}' is mapped to table(s) {tableList1}, whereas the property '{propertyName2}' is mapped to table(s) {tableList2}. All index properties must map to at least one common table. + The index named '{indexName}' on the entity type '{entityType}' specifies properties {indexProperties}. The property '{propertyName1}' is mapped to table(s) {tables1}, whereas the property '{propertyName2}' is mapped to table(s) {tables2}. All index properties must map to at least one common table. Error RelationalEventId.IndexPropertiesMappedToNonOverlappingTables string string string string string string string @@ -556,7 +556,7 @@ Debug RelationalEventId.TransactionRolledBack - Rolling back to transaction savepoint.. + Rolling back to transaction savepoint. Debug RelationalEventId.RollingBackToTransactionSavepoint @@ -568,15 +568,15 @@ Error RelationalEventId.TransactionError - The unnamed index on the entity type '{entityType}' specifies properties {indexPropertiesList}. None of these properties are mapped to a column in any table. This index will not be created in the database. + The unnamed index on the entity type '{entityType}' specifies properties {indexProperties}. None of these properties are mapped to a column in any table. This index will not be created in the database. Information RelationalEventId.AllIndexPropertiesNotToMappedToAnyTable string string - The unnamed index on the entity type '{entityType}' specifies properties {indexPropertiesList}. Some properties are mapped to a column in a table, but the property '{propertyName}' is not. All of the properties should be mapped for the index to be created in the database. + The unnamed index on the entity type '{entityType}' specifies properties {indexProperties}. Some properties are mapped to a column in a table, but the property '{propertyName}' is not. All of the properties should be mapped for the index to be created in the database. Error RelationalEventId.IndexPropertiesBothMappedAndNotMappedToTable string string string - The unnamed index on the entity type '{entityType}' specifies properties {indexPropertiesList}. The property '{propertyName1}' is mapped to table(s) {tableList1}, whereas the property '{propertyName2}' is mapped to table(s) {tableList2}. All index properties must map to at least one common table. + The unnamed index on the entity type '{entityType}' specifies properties {indexProperties}. The property '{propertyName1}' is mapped to table(s) {tableList1}, whereas the property '{propertyName2}' is mapped to table(s) {tableList2}. All index properties must map to at least one common table. Error RelationalEventId.IndexPropertiesMappedToNonOverlappingTables string string string string string string @@ -632,7 +632,7 @@ Both '{entityType}' and '{otherEntityType}' are mapped to the view '{view}'. All the entity types in a hierarchy that don't have a discriminator must be mapped to different views. See https://go.microsoft.com/fwlink/?linkid=2130430 for more information. - No relational database providers are configured. Configure a database provider using OnConfiguring or by creating an ImmutableDbContextOptions with a database provider configured and passing it to the context. + No relational database providers are configured. Configure a database provider using 'OnConfiguring' or by creating an ImmutableDbContextOptions with a database provider configured and passing it to the context. The subquery '{subquery}' references type '{type}' for which no type mapping could be found. @@ -641,7 +641,7 @@ Nullability information should only be specified for scalar database functions. - Null TypeMapping in Sql Tree. + Null TypeMapping in SQL tree. Cannot use the value provided for parameter '{parameter}' because it isn't assignable to type object[]. @@ -662,7 +662,7 @@ Unable to identify the concrete entity type to materialize in TPT hierarchy. - The entity type '{entityType}' is not mapped to a table, therefore the entities cannot be persisted to the database. Use ToTable to map it. + The entity type '{entityType}' is not mapped to a table, therefore the entities cannot be persisted to the database. Use 'ToTable' in 'OnModelCreating' to map it. Relational-specific methods can only be used when the context is using a relational database provider. @@ -674,7 +674,7 @@ Sequence contains no elements. - Can't process set operations after client evaluation, consider moving the operation before the last Select() call (see issue #16243). + Can't process set operations after client evaluation, consider moving the operation before the last 'Select' call (see issue #16243). Set operations over different store types are currently unsupported. diff --git a/src/EFCore.Relational/Update/ColumnModification.cs b/src/EFCore.Relational/Update/ColumnModification.cs index c30214fe08d..b23862f157d 100644 --- a/src/EFCore.Relational/Update/ColumnModification.cs +++ b/src/EFCore.Relational/Update/ColumnModification.cs @@ -384,7 +384,7 @@ public virtual void AddSharedColumnModification([NotNull] ColumnModification mod Entry.BuildCurrentValuesString(Entry.EntityType.FindPrimaryKey().Properties), Entry.BuildCurrentValuesString(new[] { Property }), modification.Entry.BuildCurrentValuesString(new[] { modification.Property }), - "{'" + ColumnName + "'}")); + ColumnName)); } throw new InvalidOperationException( @@ -393,7 +393,7 @@ public virtual void AddSharedColumnModification([NotNull] ColumnModification mod modification.Entry.EntityType.DisplayName(), new[] { Property }.Format(), new[] { modification.Property }.Format(), - "{'" + ColumnName + "'}")); + ColumnName)); } if (UseOriginalValueParameter @@ -416,7 +416,7 @@ public virtual void AddSharedColumnModification([NotNull] ColumnModification mod Entry.BuildCurrentValuesString(Entry.EntityType.FindPrimaryKey().Properties), Entry.BuildOriginalValuesString(new[] { Property }), modification.Entry.BuildOriginalValuesString(new[] { modification.Property }), - "{'" + ColumnName + "'}")); + ColumnName)); } throw new InvalidOperationException( @@ -425,7 +425,7 @@ public virtual void AddSharedColumnModification([NotNull] ColumnModification mod modification.Entry.EntityType.DisplayName(), new[] { Property }.Format(), new[] { modification.Property }.Format(), - "{'" + ColumnName + "'}")); + ColumnName)); } } diff --git a/src/EFCore.Relational/Update/Internal/CommandBatchPreparer.cs b/src/EFCore.Relational/Update/Internal/CommandBatchPreparer.cs index a87cd6b1a39..5b4eedd49bd 100644 --- a/src/EFCore.Relational/Update/Internal/CommandBatchPreparer.cs +++ b/src/EFCore.Relational/Update/Internal/CommandBatchPreparer.cs @@ -316,6 +316,11 @@ private string FormatCycle(IReadOnlyList foreignKey.DeclaringEntityType.IsAssignableFrom(e.EntityType)); if (reverseDependency) { - builder.Append(" <-"); + builder.AppendLine(" <-"); + } + else + { + builder.Append(" "); } - builder.Append(" "); if (foreignKey.DependentToPrincipal != null || foreignKey.PrincipalToDependent != null) { @@ -416,7 +424,7 @@ private void Format(IForeignKey foreignKey, ModificationCommand source, Modifica if (!reverseDependency) { - builder.Append("<- "); + builder.AppendLine("<-"); } } @@ -425,10 +433,14 @@ private void Format(IIndex index, ModificationCommand source, ModificationComman var reverseDependency = source.EntityState != EntityState.Deleted; if (reverseDependency) { - builder.Append(" <-"); + builder.AppendLine(" <-"); + } + else + { + builder.Append(" "); } - builder.Append(" Index "); + builder.Append("Index "); var dependentCommand = reverseDependency ? target : source; var dependentEntry = dependentCommand.Entries.First(e => index.DeclaringEntityType.IsAssignableFrom(e.EntityType)); @@ -455,7 +467,7 @@ private void Format(IIndex index, ModificationCommand source, ModificationComman if (!reverseDependency) { - builder.Append("<- "); + builder.AppendLine("<-"); } } diff --git a/src/EFCore.SqlServer/Properties/SqlServerStrings.Designer.cs b/src/EFCore.SqlServer/Properties/SqlServerStrings.Designer.cs index be078db08ee..518a34ad9de 100644 --- a/src/EFCore.SqlServer/Properties/SqlServerStrings.Designer.cs +++ b/src/EFCore.SqlServer/Properties/SqlServerStrings.Designer.cs @@ -154,7 +154,7 @@ public static string IncompatibleTableMemoryOptimizedMismatch([CanBeNull] object table, entityType, otherEntityType, memoryOptimizedEntityType, nonMemoryOptimizedEntityType); /// - /// SQL Server requires the table name to be specified for rename index operations. Specify table name in the call to MigrationBuilder.RenameIndex. + /// SQL Server requires the table name to be specified for rename index operations. Specify table name in the call to 'MigrationBuilder.RenameIndex'. /// public static string IndexTableRequired => GetString("IndexTableRequired"); @@ -282,7 +282,7 @@ public static EventDefinition LogByteIdentityColumn([NotNull] ID } /// - /// Both the SqlServerValueGenerationStrategy {generationStrategy} and {otherGenerationStrategy} have been set on property '{propertyName}' on entity type '{entityName}'. Usually this is a mistake. Only use these at the same time if you are sure you understand the consequences. + /// Both the SqlServerValueGenerationStrategy '{generationStrategy}' and '{otherGenerationStrategy}' have been set on property '{propertyName}' on entity type '{entityName}'. Usually this is a mistake. Only use these at the same time if you are sure you understand the consequences. /// public static EventDefinition LogConflictingValueGenerationStrategies([NotNull] IDiagnosticsLogger logger) { @@ -330,7 +330,7 @@ public static EventDefinition LogDecimalTypeKey([NotNull] IDiagn } /// - /// No type was specified for the decimal property '{property}' on entity type '{entityType}'. This will cause values to be silently truncated if they do not fit in the default precision and scale. Explicitly specify the SQL server column type that can accommodate all the values using 'HasColumnType()', specify precision and scale using 'HasPrecision()' or configure a value converter using 'HasConversion()'. + /// No type was specified for the decimal property '{property}' on entity type '{entityType}'. This will cause values to be silently truncated if they do not fit in the default precision and scale. Explicitly specify the SQL server column type that can accommodate all the values in 'OnModelCreating' using 'HasColumnType()', specify precision and scale using 'HasPrecision()' or configure a value converter using 'HasConversion()'. /// public static EventDefinition LogDefaultDecimalTypeColumn([NotNull] IDiagnosticsLogger logger) { @@ -375,7 +375,7 @@ public static FallbackEventDefinition LogFoundColumn([NotNull] IDiagnosticsLogge } /// - /// Found default schema {defaultSchema}. + /// Found default schema '{defaultSchema}'. /// public static EventDefinition LogFoundDefaultSchema([NotNull] IDiagnosticsLogger logger) { @@ -564,7 +564,7 @@ public static EventDefinition LogFoundUniqueConstraint([NotNull] } /// - /// Unable to find a schema in the database matching the selected schema {schema}. + /// Unable to find a schema in the database matching the selected schema '{schema}'. /// public static EventDefinition LogMissingSchema([NotNull] IDiagnosticsLogger logger) { @@ -588,7 +588,7 @@ public static EventDefinition LogMissingSchema([NotNull] IDiagnosticsLog } /// - /// Unable to find a table in the database matching the selected table {table}. + /// Unable to find a table in the database matching the selected table '{table}'. /// public static EventDefinition LogMissingTable([NotNull] IDiagnosticsLogger logger) { @@ -612,7 +612,7 @@ public static EventDefinition LogMissingTable([NotNull] IDiagnosticsLogg } /// - /// For foreign key {foreignKeyName} on table {tableName}, unable to find the column called {principalColumnName} on the foreign key's principal table, {principaltableName}. Skipping foreign key. + /// For foreign key '{foreignKeyName}' on table '{tableName}', unable to find the column called '{principalColumnName}' on the foreign key's principal table, '{principalTableName}'. Skipping foreign key. /// public static EventDefinition LogPrincipalColumnNotFound([NotNull] IDiagnosticsLogger logger) { @@ -636,7 +636,7 @@ public static EventDefinition LogPrincipalColumn } /// - /// For foreign key {fkName} on table {tableName}, unable to model the end of the foreign key on principal table {principaltableName}. This is usually because the principal table was not included in the selection set. + /// For foreign key '{foreignKeyName}' on table '{tableName}', unable to model the end of the foreign key on principal table '{principalTableName}'. This is usually because the principal table was not included in the selection set. /// public static EventDefinition LogPrincipalTableNotInSelectionSet([NotNull] IDiagnosticsLogger logger) { diff --git a/src/EFCore.SqlServer/Properties/SqlServerStrings.resx b/src/EFCore.SqlServer/Properties/SqlServerStrings.resx index 707da88c070..9aa26c2776f 100644 --- a/src/EFCore.SqlServer/Properties/SqlServerStrings.resx +++ b/src/EFCore.SqlServer/Properties/SqlServerStrings.resx @@ -169,7 +169,7 @@ Cannot use table '{table}' for entity type '{entityType}' since it is being used for entity type '{otherEntityType}' and entity type '{memoryOptimizedEntityType}' is marked as memory-optimized, but entity type '{nonMemoryOptimizedEntityType}' is not. - SQL Server requires the table name to be specified for rename index operations. Specify table name in the call to MigrationBuilder.RenameIndex. + SQL Server requires the table name to be specified for rename index operations. Specify table name in the call to 'MigrationBuilder.RenameIndex'. The expression passed to the 'propertyReference' parameter of the 'FreeText' method is not a valid reference to a property. The expression should represent a reference to a full-text indexed property on the object referenced in the from clause: 'from e in context.Entities where EF.Functions.FreeText(e.SomeProperty, textToSearchFor) select e' @@ -182,7 +182,7 @@ Warning SqlServerEventId.ByteIdentityColumnWarning string string - Both the SqlServerValueGenerationStrategy {generationStrategy} and {otherGenerationStrategy} have been set on property '{propertyName}' on entity type '{entityName}'. Usually this is a mistake. Only use these at the same time if you are sure you understand the consequences. + Both the SqlServerValueGenerationStrategy '{generationStrategy}' and '{otherGenerationStrategy}' have been set on property '{propertyName}' on entity type '{entityName}'. Usually this is a mistake. Only use these at the same time if you are sure you understand the consequences. Warning SqlServerEventId.ConflictingValueGenerationStrategiesWarning string string string string @@ -190,7 +190,7 @@ Warning SqlServerEventId.DecimalTypeKeyWarning string string - No type was specified for the decimal property '{property}' on entity type '{entityType}'. This will cause values to be silently truncated if they do not fit in the default precision and scale. Explicitly specify the SQL server column type that can accommodate all the values using 'HasColumnType()', specify precision and scale using 'HasPrecision()' or configure a value converter using 'HasConversion()'. + No type was specified for the decimal property '{property}' on entity type '{entityType}'. This will cause values to be silently truncated if they do not fit in the default precision and scale. Explicitly specify the SQL server column type that can accommodate all the values in 'OnModelCreating' using 'HasColumnType()', specify precision and scale using 'HasPrecision()' or configure a value converter using 'HasConversion()'. Warning SqlServerEventId.DecimalTypeDefaultWarning string string @@ -198,7 +198,7 @@ Debug SqlServerEventId.ColumnFound string string int string int int int bool bool string string bool? - Found default schema {defaultSchema}. + Found default schema '{defaultSchema}'. Debug SqlServerEventId.DefaultSchemaFound string @@ -230,19 +230,19 @@ Debug SqlServerEventId.UniqueConstraintFound string string - Unable to find a schema in the database matching the selected schema {schema}. + Unable to find a schema in the database matching the selected schema '{schema}'. Warning SqlServerEventId.MissingSchemaWarning string - Unable to find a table in the database matching the selected table {table}. + Unable to find a table in the database matching the selected table '{table}'. Warning SqlServerEventId.MissingTableWarning string - For foreign key {foreignKeyName} on table {tableName}, unable to find the column called {principalColumnName} on the foreign key's principal table, {principaltableName}. Skipping foreign key. + For foreign key '{foreignKeyName}' on table '{tableName}', unable to find the column called '{principalColumnName}' on the foreign key's principal table, '{principalTableName}'. Skipping foreign key. Warning SqlServerEventId.ForeignKeyPrincipalColumnMissingWarning string string string string - For foreign key {fkName} on table {tableName}, unable to model the end of the foreign key on principal table {principaltableName}. This is usually because the principal table was not included in the selection set. + For foreign key '{foreignKeyName}' on table '{tableName}', unable to model the end of the foreign key on principal table '{principalTableName}'. This is usually because the principal table was not included in the selection set. Warning SqlServerEventId.ForeignKeyReferencesMissingPrincipalTableWarning string string string diff --git a/src/EFCore.Sqlite.Core/Properties/SqliteStrings.Designer.cs b/src/EFCore.Sqlite.Core/Properties/SqliteStrings.Designer.cs index 56b3c7f2900..a86c372e11a 100644 --- a/src/EFCore.Sqlite.Core/Properties/SqliteStrings.Designer.cs +++ b/src/EFCore.Sqlite.Core/Properties/SqliteStrings.Designer.cs @@ -290,7 +290,7 @@ public static EventDefinition LogMissingTable([NotNull] IDiagnosticsLogg } /// - /// For foreign key with identity {id} on table {tableName}, unable to find the column called {principalColumnName} on the foreign key's principal table, {principaltableName}. Skipping foreign key. + /// For foreign key with identity '{id}' on table '{tableName}', unable to find the column called '{principalColumnName}' on the foreign key's principal table, '{principaltableName}'. Skipping foreign key. /// public static EventDefinition LogPrincipalColumnNotFound([NotNull] IDiagnosticsLogger logger) { diff --git a/src/EFCore.Sqlite.Core/Properties/SqliteStrings.resx b/src/EFCore.Sqlite.Core/Properties/SqliteStrings.resx index 2552543eb67..08bfddf59f3 100644 --- a/src/EFCore.Sqlite.Core/Properties/SqliteStrings.resx +++ b/src/EFCore.Sqlite.Core/Properties/SqliteStrings.resx @@ -162,7 +162,7 @@ Warning SqliteEventId.MissingTableWarning string - For foreign key with identity {id} on table {tableName}, unable to find the column called {principalColumnName} on the foreign key's principal table, {principaltableName}. Skipping foreign key. + For foreign key with identity '{id}' on table '{tableName}', unable to find the column called '{principalColumnName}' on the foreign key's principal table, '{principaltableName}'. Skipping foreign key. Warning SqliteEventId.ForeignKeyPrincipalColumnMissingWarning string string string string diff --git a/src/EFCore/Extensions/EntityTypeExtensions.cs b/src/EFCore/Extensions/EntityTypeExtensions.cs index 2b34e5ad174..5c5b57f7c36 100644 --- a/src/EFCore/Extensions/EntityTypeExtensions.cs +++ b/src/EFCore/Extensions/EntityTypeExtensions.cs @@ -331,7 +331,9 @@ private static string DisplayNameDefault(this ITypeBase type) /// The display name. [DebuggerStepThrough] public static string DisplayName([NotNull] this ITypeBase type) - => type.FullName(); + => type.FullName() + (type is IEntityType entityType && entityType.HasSharedClrType + ? " (" + entityType.ClrType.ShortDisplayName() + ")" + : ""); /// /// Gets the unique name for the given . diff --git a/src/EFCore/Infrastructure/AnnotatableExtensions.cs b/src/EFCore/Infrastructure/AnnotatableExtensions.cs index f3dcd829fff..df406f6261d 100644 --- a/src/EFCore/Infrastructure/AnnotatableExtensions.cs +++ b/src/EFCore/Infrastructure/AnnotatableExtensions.cs @@ -29,7 +29,7 @@ public static IAnnotation GetAnnotation([NotNull] this IAnnotatable annotatable, var annotation = annotatable.FindAnnotation(annotationName); if (annotation == null) { - throw new InvalidOperationException(CoreStrings.AnnotationNotFound(annotationName)); + throw new InvalidOperationException(CoreStrings.AnnotationNotFound(annotationName, annotatable.ToString())); } return annotation; diff --git a/src/EFCore/Infrastructure/ModelValidator.cs b/src/EFCore/Infrastructure/ModelValidator.cs index 187f7565e77..f31676aa3de 100644 --- a/src/EFCore/Infrastructure/ModelValidator.cs +++ b/src/EFCore/Infrastructure/ModelValidator.cs @@ -994,7 +994,10 @@ protected virtual void ValidateQueryFilters( if (entityType.BaseType != null) { throw new InvalidOperationException( - CoreStrings.BadFilterDerivedType(entityType.GetQueryFilter(), entityType.DisplayName())); + CoreStrings.BadFilterDerivedType( + entityType.GetQueryFilter(), + entityType.DisplayName(), + entityType.GetRootType().DisplayName())); } if (entityType.IsOwned()) diff --git a/src/EFCore/Metadata/Internal/EntityType.cs b/src/EFCore/Metadata/Internal/EntityType.cs index 04c9e4a3d16..a6930117794 100644 --- a/src/EFCore/Metadata/Internal/EntityType.cs +++ b/src/EFCore/Metadata/Internal/EntityType.cs @@ -2401,13 +2401,8 @@ public virtual Property AddProperty( if (memberInfo.DeclaringType?.IsAssignableFrom(ClrType) != true) { - throw new InvalidOperationException( - HasSharedClrType - ? CoreStrings.PropertyWrongEntitySharedClrType( - memberInfo.Name, this.DisplayName(), ClrType.ShortDisplayName(), - memberInfo.DeclaringType?.ShortDisplayName()) - : CoreStrings.PropertyWrongEntityClrType( - memberInfo.Name, this.DisplayName(), memberInfo.DeclaringType?.ShortDisplayName())); + throw new InvalidOperationException(CoreStrings.PropertyWrongEntityClrType( + memberInfo.Name, this.DisplayName(), memberInfo.DeclaringType?.ShortDisplayName())); } } else if (IsPropertyBag) diff --git a/src/EFCore/Properties/CoreStrings.Designer.cs b/src/EFCore/Properties/CoreStrings.Designer.cs index 7c866abd2e3..dde62b72d88 100644 --- a/src/EFCore/Properties/CoreStrings.Designer.cs +++ b/src/EFCore/Properties/CoreStrings.Designer.cs @@ -49,31 +49,31 @@ public static string AmbiguousDependentEntity([CanBeNull] object entityType, [Ca entityType, targetEntryCall); /// - /// The foreign key {foreignKey} on entity type '{entityType}' cannot be configured as having a required dependent since the dependent side cannot be determined. To identify the dependent side of the relationship, configure the foreign key property. See http://go.microsoft.com/fwlink/?LinkId=724062 for more details. + /// The foreign key {foreignKeyProperties} on entity type '{entityType}' cannot be configured as having a required dependent since the dependent side cannot be determined. To identify the dependent side of the relationship, configure the foreign key property in 'OnModelCreating'. See http://go.microsoft.com/fwlink/?LinkId=724062 for more details. /// - public static string AmbiguousEndRequiredDependent([CanBeNull] object foreignKey, [CanBeNull] object entityType) + public static string AmbiguousEndRequiredDependent([CanBeNull] object foreignKeyProperties, [CanBeNull] object entityType) => string.Format( - GetString("AmbiguousEndRequiredDependent", nameof(foreignKey), nameof(entityType)), - foreignKey, entityType); + GetString("AmbiguousEndRequiredDependent", nameof(foreignKeyProperties), nameof(entityType)), + foreignKeyProperties, entityType); /// - /// The navigation '{entityType}.{navigation}' cannot be configured as required since the dependent side of the underlying foreign key {foreignKey} cannot be determined. To identify the dependent side of the relationship, configure the foreign key property. See http://go.microsoft.com/fwlink/?LinkId=724062 for more details. + /// The navigation '{entityType}.{navigation}' cannot be configured as required since the dependent side of the underlying foreign key {foreignKeyProperties} cannot be determined. To identify the dependent side of the relationship, configure the foreign key property in 'OnModelCreating'. See http://go.microsoft.com/fwlink/?LinkId=724062 for more details. /// - public static string AmbiguousEndRequiredDependentNavigation([CanBeNull] object entityType, [CanBeNull] object navigation, [CanBeNull] object foreignKey) + public static string AmbiguousEndRequiredDependentNavigation([CanBeNull] object entityType, [CanBeNull] object navigation, [CanBeNull] object foreignKeyProperties) => string.Format( - GetString("AmbiguousEndRequiredDependentNavigation", nameof(entityType), nameof(navigation), nameof(foreignKey)), - entityType, navigation, foreignKey); + GetString("AmbiguousEndRequiredDependentNavigation", nameof(entityType), nameof(navigation), nameof(foreignKeyProperties)), + entityType, navigation, foreignKeyProperties); /// - /// The foreign key {foreignKey} on entity type '{entityType}' cannot be flipped to entity type '{principalEntityType}' since it was configured as required before the dependent side was configured. Configure the foreign key property or the principal key before configuring the foreign key as required. See http://go.microsoft.com/fwlink/?LinkId=724062 for more details. + /// The foreign key {foreignKeyProperties} on entity type '{entityType}' cannot be flipped to entity type '{principalEntityType}' since it was configured as required before the dependent side was configured. Configure the foreign key property or the principal key before configuring the foreign key as required. See http://go.microsoft.com/fwlink/?LinkId=724062 for more details. /// - public static string AmbiguousEndRequiredInverted([CanBeNull] object foreignKey, [CanBeNull] object entityType, [CanBeNull] object principalEntityType) + public static string AmbiguousEndRequiredInverted([CanBeNull] object foreignKeyProperties, [CanBeNull] object entityType, [CanBeNull] object principalEntityType) => string.Format( - GetString("AmbiguousEndRequiredInverted", nameof(foreignKey), nameof(entityType), nameof(principalEntityType)), - foreignKey, entityType, principalEntityType); + GetString("AmbiguousEndRequiredInverted", nameof(foreignKeyProperties), nameof(entityType), nameof(principalEntityType)), + foreignKeyProperties, entityType, principalEntityType); /// - /// Both relationships between '{firstDependentToPrincipalNavigationSpecification}' and '{firstPrincipalToDependentNavigationSpecification}' and between '{secondDependentToPrincipalNavigationSpecification}' and '{secondPrincipalToDependentNavigationSpecification}' could use {foreignKeyProperties} as the foreign key. To resolve this configure the foreign key properties explicitly on at least one of the relationships. + /// Both relationships between '{firstDependentToPrincipalNavigationSpecification}' and '{firstPrincipalToDependentNavigationSpecification}' and between '{secondDependentToPrincipalNavigationSpecification}' and '{secondPrincipalToDependentNavigationSpecification}' could use {foreignKeyProperties} as the foreign key. To resolve this configure the foreign key properties explicitly in 'OnModelCreating' on at least one of the relationships. /// public static string AmbiguousForeignKeyPropertyCandidates([CanBeNull] object firstDependentToPrincipalNavigationSpecification, [CanBeNull] object firstPrincipalToDependentNavigationSpecification, [CanBeNull] object secondDependentToPrincipalNavigationSpecification, [CanBeNull] object secondPrincipalToDependentNavigationSpecification, [CanBeNull] object foreignKeyProperties) => string.Format( @@ -105,12 +105,12 @@ public static string AmbiguousServiceProperty([CanBeNull] object property, [CanB property, serviceType, entityType); /// - /// The annotation '{annotation}' was not found. Ensure that the annotation has been added. + /// The annotation '{annotation}' was not found. Ensure that the annotation has been added to the object {annotatable} /// - public static string AnnotationNotFound([CanBeNull] object annotation) + public static string AnnotationNotFound([CanBeNull] object annotation, [CanBeNull] object annotatable) => string.Format( - GetString("AnnotationNotFound", nameof(annotation)), - annotation); + GetString("AnnotationNotFound", nameof(annotation), nameof(annotatable)), + annotation, annotatable); /// /// The property '{property}' of the argument '{argument}' cannot be null. @@ -145,12 +145,12 @@ public static string BadDependencyRegistration([CanBeNull] object dependenciesTy dependenciesType); /// - /// The filter expression '{filter}' cannot be specified for entity type '{entityType}'. A filter may only be applied to the root entity type in a hierarchy. + /// The filter expression '{filter}' cannot be specified for entity type '{entityType}'. A filter may only be applied to the root entity type '{rootType}'. /// - public static string BadFilterDerivedType([CanBeNull] object filter, [CanBeNull] object entityType) + public static string BadFilterDerivedType([CanBeNull] object filter, [CanBeNull] object entityType, [CanBeNull] object rootType) => string.Format( - GetString("BadFilterDerivedType", nameof(filter), nameof(entityType)), - filter, entityType); + GetString("BadFilterDerivedType", nameof(filter), nameof(entityType), nameof(rootType)), + filter, entityType, rootType); /// /// The filter expression '{filter}' specified for entity type '{entityType}' is invalid. The expression must accept a single parameter of type '{clrType}' and return bool. @@ -277,7 +277,7 @@ public static string ClashingMismatchedSharedType([CanBeNull] object entityType, entityType, otherClrType); /// - /// There is already an entity type named '{ownedTypeName}'. Use a different name when configuring the ownership '{ownerEntityType}.{navigation}'. + /// There is already an entity type named '{ownedTypeName}'. Use a different name when configuring the ownership '{ownerEntityType}.{navigation}' in 'OnModelCreating'. /// public static string ClashingNamedOwnedType([CanBeNull] object ownedTypeName, [CanBeNull] object ownerEntityType, [CanBeNull] object navigation) => string.Format( @@ -301,7 +301,7 @@ public static string ClashingNonOwnedEntityType([CanBeNull] object entityType) entityType); /// - /// The shared type entity type '{entityType}' with clr type '{type}' cannot be added to the model because a non shared entity type with the same clr type already exists. + /// The shared type entity type '{entityType}' with clr type '{type}' cannot be added to the model because a non shared entity type with the same CLR type already exists. /// public static string ClashingNonSharedType([CanBeNull] object entityType, [CanBeNull] object type) => string.Format( @@ -373,7 +373,7 @@ public static string ClrPropertyOnShadowEntity([CanBeNull] object property, [Can property, entityType); /// - /// The property '{1_entityType}.{0_property}' is being accessed using the '{CollectionMethod}' method, but is defined in the model as a non-collection, reference navigation property. Use the '{ReferenceMethod}' method to access reference navigation properties. + /// The property '{1_entityType}.{0_property}' is being accessed using the '{CollectionMethod}' method, but is defined in the model as a non-collection, reference navigation. Use the '{ReferenceMethod}' method to access reference navigation properties. /// public static string CollectionIsReference([CanBeNull] object property, [CanBeNull] object entityType, [CanBeNull] object CollectionMethod, [CanBeNull] object ReferenceMethod) => string.Format( @@ -397,7 +397,7 @@ public static string CompositeFkOnProperty([CanBeNull] object navigation, [CanBe navigation, entityType); /// - /// Entity type '{entityType}' has composite primary key defined with data annotations. To set composite primary key, use fluent API. + /// Entity type '{entityType}' has composite primary key defined with data annotations. Composite primary keys can only be set in 'OnModelCreating'. /// public static string CompositePKWithDataAnnotation([CanBeNull] object entityType) => string.Format( @@ -411,7 +411,7 @@ public static string ConcurrentMethodInvocation => GetString("ConcurrentMethodInvocation"); /// - /// Property '{1_entityType}.{0_property}' matches both '{field1}' and '{field2}' by convention. Explicitly specify the backing field to use with '.HasField()' in 'OnModelCreating()'. + /// Property '{1_entityType}.{0_property}' matches both '{field1}' and '{field2}' by convention. Explicitly specify the backing field to use with '.HasField()' in 'OnModelCreating'. /// public static string ConflictingBackingFields([CanBeNull] object property, [CanBeNull] object entityType, [CanBeNull] object field1, [CanBeNull] object field2) => string.Format( @@ -435,7 +435,7 @@ public static string ConflictingPropertyOrNavigation([CanBeNull] object member, member, entityType, conflictingEntityType); /// - /// Cannot create a relationship between '{newPrincipalNavigationSpecification}' and '{newDependentNavigationSpecification}', because there already is a relationship between '{existingPrincipalNavigationSpecification}' and '{existingDependentNavigationSpecification}'. Navigation properties can only participate in a single relationship. If you want to override an existing relationship call Ignore on the navigation '{newDependentNavigationSpecification}' first. + /// Cannot create a relationship between '{newPrincipalNavigationSpecification}' and '{newDependentNavigationSpecification}', because there already is a relationship between '{existingPrincipalNavigationSpecification}' and '{existingDependentNavigationSpecification}'. Navigation properties can only participate in a single relationship. If you want to override an existing relationship call Ignore on the navigation '{newDependentNavigationSpecification}' first in 'OnModelCreating'. /// public static string ConflictingRelationshipNavigation([CanBeNull] object newPrincipalNavigationSpecification, [CanBeNull] object newDependentNavigationSpecification, [CanBeNull] object existingPrincipalNavigationSpecification, [CanBeNull] object existingDependentNavigationSpecification) => string.Format( @@ -555,7 +555,7 @@ public static string DerivedEntityCannotBeKeyless([CanBeNull] object entityType) entityType); /// - /// Unable to set a base type for entity type '{entityType}' because it has one or more keys defined. + /// Unable to set a base type for entity type '{entityType}' because it has one or more keys defined. Only root types can have keys. /// public static string DerivedEntityCannotHaveKeys([CanBeNull] object entityType) => string.Format( @@ -563,7 +563,7 @@ public static string DerivedEntityCannotHaveKeys([CanBeNull] object entityType) entityType); /// - /// A '{derivedType}' cannot be configured as keyless because it is a derived type. The root type '{rootType}' must be configured as keyless. If you did not intend for '{rootType}' to be included in the model, ensure that it is not included in a DbSet property on your context, referenced in a configuration call to ModelBuilder, or referenced from a navigation property on a type that is included in the model. + /// A '{derivedType}' cannot be configured as keyless because it is a derived type. The root type '{rootType}' must be configured as keyless. If you did not intend for '{rootType}' to be included in the model, ensure that it is not included in a DbSet property on your context, referenced in a configuration call to ModelBuilder in 'OnModelCreating', or referenced from a navigation on a type that is included in the model. /// public static string DerivedEntityTypeHasNoKey([CanBeNull] object derivedType, [CanBeNull] object rootType) => string.Format( @@ -571,7 +571,7 @@ public static string DerivedEntityTypeHasNoKey([CanBeNull] object derivedType, [ derivedType, rootType); /// - /// A key cannot be configured on '{derivedType}' because it is a derived type. The key must be configured on the root type '{rootType}'. If you did not intend for '{rootType}' to be included in the model, ensure that it is not included in a DbSet property on your context, referenced in a configuration call to ModelBuilder, or referenced from a navigation property on a type that is included in the model. + /// A key cannot be configured on '{derivedType}' because it is a derived type. The key must be configured on the root type '{rootType}'. If you did not intend for '{rootType}' to be included in the model, ensure that it is not included in a DbSet property on your context, referenced in a configuration call to ModelBuilder, or referenced from a navigation on a type that is included in the model. /// public static string DerivedEntityTypeKey([CanBeNull] object derivedType, [CanBeNull] object rootType) => string.Format( @@ -643,12 +643,12 @@ public static string DuplicateEntityType([CanBeNull] object entityType) entityType); /// - /// The foreign key {foreignKey} cannot be added to the entity type '{entityType}' because a foreign key on the same properties already exists on entity type '{duplicateEntityType}' and also targets the key {key} on '{principalType}'. + /// The foreign key {foreignKeyProperties} cannot be added to the entity type '{entityType}' because a foreign key on the same properties already exists on entity type '{duplicateEntityType}' and also targets the key {keyProperties} on '{principalType}'. /// - public static string DuplicateForeignKey([CanBeNull] object foreignKey, [CanBeNull] object entityType, [CanBeNull] object duplicateEntityType, [CanBeNull] object key, [CanBeNull] object principalType) + public static string DuplicateForeignKey([CanBeNull] object foreignKeyProperties, [CanBeNull] object entityType, [CanBeNull] object duplicateEntityType, [CanBeNull] object keyProperties, [CanBeNull] object principalType) => string.Format( - GetString("DuplicateForeignKey", nameof(foreignKey), nameof(entityType), nameof(duplicateEntityType), nameof(key), nameof(principalType)), - foreignKey, entityType, duplicateEntityType, key, principalType); + GetString("DuplicateForeignKey", nameof(foreignKeyProperties), nameof(entityType), nameof(duplicateEntityType), nameof(keyProperties), nameof(principalType)), + foreignKeyProperties, entityType, duplicateEntityType, keyProperties, principalType); /// /// The index {indexProperties} cannot be added to the entity type '{entityType}' because an index on the same properties already exists on entity type '{duplicateEntityType}'. @@ -659,12 +659,12 @@ public static string DuplicateIndex([CanBeNull] object indexProperties, [CanBeNu indexProperties, entityType, duplicateEntityType); /// - /// The key {key} cannot be added to the entity type '{entityType}' because a key on the same properties already exists on entity type '{duplicateEntityType}'. + /// The key {keyProperties} cannot be added to the entity type '{entityType}' because a key on the same properties already exists on entity type '{duplicateEntityType}'. /// - public static string DuplicateKey([CanBeNull] object key, [CanBeNull] object entityType, [CanBeNull] object duplicateEntityType) + public static string DuplicateKey([CanBeNull] object keyProperties, [CanBeNull] object entityType, [CanBeNull] object duplicateEntityType) => string.Format( - GetString("DuplicateKey", nameof(key), nameof(entityType), nameof(duplicateEntityType)), - key, entityType, duplicateEntityType); + GetString("DuplicateKey", nameof(keyProperties), nameof(entityType), nameof(duplicateEntityType)), + keyProperties, entityType, duplicateEntityType); /// /// The index named '{indexName}' defined on properties {indexProperties} cannot be added to the entity type '{entityType}' because an index with the same name already exists on entity type '{duplicateEntityType}'. @@ -723,7 +723,7 @@ public static string EntityEqualitySubqueryWithCompositeKeyNotSupported([CanBeNu entityType); /// - /// The entity type '{entityType}' requires a primary key to be defined. If you intended to use a keyless entity type call 'HasNoKey()'. + /// The entity type '{entityType}' requires a primary key to be defined. If you intended to use a keyless entity type call 'HasNoKey()' in 'OnModelCreating'. /// public static string EntityRequiresKey([CanBeNull] object entityType) => string.Format( @@ -739,12 +739,12 @@ public static string EntityTypeInUseByDerived([CanBeNull] object entityType, [Ca entityType, derivedEntityType); /// - /// The entity type '{entityType}' cannot be removed because it is being referenced by foreign key {foreignKey} on '{referencingEntityType}'. All referencing foreign keys must be removed or redefined before the entity type can be removed. + /// The entity type '{entityType}' cannot be removed because it is being referenced by foreign key {foreignKeyProperties} on '{referencingEntityType}'. All referencing foreign keys must be removed or redefined before the entity type can be removed. /// - public static string EntityTypeInUseByReferencingForeignKey([CanBeNull] object entityType, [CanBeNull] object foreignKey, [CanBeNull] object referencingEntityType) + public static string EntityTypeInUseByReferencingForeignKey([CanBeNull] object entityType, [CanBeNull] object foreignKeyProperties, [CanBeNull] object referencingEntityType) => string.Format( - GetString("EntityTypeInUseByReferencingForeignKey", nameof(entityType), nameof(foreignKey), nameof(referencingEntityType)), - entityType, foreignKey, referencingEntityType); + GetString("EntityTypeInUseByReferencingForeignKey", nameof(entityType), nameof(foreignKeyProperties), nameof(referencingEntityType)), + entityType, foreignKeyProperties, referencingEntityType); /// /// The entity type '{entityType}' cannot be removed because it is being referenced by the skip navigation '{skipNavigation}' on '{referencingEntityType}'. All referencing skip navigations must be removed before the entity type can be removed. @@ -855,7 +855,7 @@ public static string ExecutionStrategyExistingTransaction([CanBeNull] object str strategy, getExecutionStrategyMethod); /// - /// An exception was thrown while attempting to evaluate a LINQ query parameter expression. To show additional information call EnableSensitiveDataLogging() when overriding DbContext.OnConfiguring. + /// An exception was thrown while attempting to evaluate a LINQ query parameter expression. To show additional information call 'EnableSensitiveDataLogging()' when overriding 'DbContext.OnConfiguring'. /// public static string ExpressionParameterizationException => GetString("ExpressionParameterizationException"); @@ -917,12 +917,12 @@ public static string FkAttributeOnPropertyNavigationMismatch([CanBeNull] object property, navigation, entityType); /// - /// The number of properties specified for the foreign key {foreignKey} on entity type '{dependentType}' does not match the number of properties in the principal key {principalKey} on entity type '{principalType}'. + /// The number of properties specified for the foreign key {foreignKeyProperties} on entity type '{dependentType}' does not match the number of properties in the principal key {principalKey} on entity type '{principalType}'. /// - public static string ForeignKeyCountMismatch([CanBeNull] object foreignKey, [CanBeNull] object dependentType, [CanBeNull] object principalKey, [CanBeNull] object principalType) + public static string ForeignKeyCountMismatch([CanBeNull] object foreignKeyProperties, [CanBeNull] object dependentType, [CanBeNull] object principalKey, [CanBeNull] object principalType) => string.Format( - GetString("ForeignKeyCountMismatch", nameof(foreignKey), nameof(dependentType), nameof(principalKey), nameof(principalType)), - foreignKey, dependentType, principalKey, principalType); + GetString("ForeignKeyCountMismatch", nameof(foreignKeyProperties), nameof(dependentType), nameof(principalKey), nameof(principalType)), + foreignKeyProperties, dependentType, principalKey, principalType); /// /// Cannot remove foreign key {foreigKey} from entity type '{entityType}' because it is referenced by a skip navigation '{navigation}' on entity type '{navigationEntityType}'. All referencing skip navigation must be removed before the referenced foreign key can be removed. @@ -933,20 +933,20 @@ public static string ForeignKeyInUseSkipNavigation([CanBeNull] object foreigKey, foreigKey, entityType, navigation, navigationEntityType); /// - /// The specified foreign key properties {foreignKey} are not declared on the entity type '{entityType}'. Ensure foreign key properties are declared on the target entity type. + /// The specified foreign key properties {foreignKeyProperties} are not declared on the entity type '{entityType}'. Ensure foreign key properties are declared on the target entity type. /// - public static string ForeignKeyPropertiesWrongEntity([CanBeNull] object foreignKey, [CanBeNull] object entityType) + public static string ForeignKeyPropertiesWrongEntity([CanBeNull] object foreignKeyProperties, [CanBeNull] object entityType) => string.Format( - GetString("ForeignKeyPropertiesWrongEntity", nameof(foreignKey), nameof(entityType)), - foreignKey, entityType); + GetString("ForeignKeyPropertiesWrongEntity", nameof(foreignKeyProperties), nameof(entityType)), + foreignKeyProperties, entityType); /// - /// The property '{property}' cannot be part of a foreign key on '{entityType}' because it has value generation enabled and is contained in the key {key} defined on a base entity type '{baseEntityType}'. + /// The property '{property}' cannot be part of a foreign key on '{entityType}' because it has value generation enabled and is contained in the key {keyProperties} defined on a base entity type '{baseEntityType}'. /// - public static string ForeignKeyPropertyInKey([CanBeNull] object property, [CanBeNull] object entityType, [CanBeNull] object key, [CanBeNull] object baseEntityType) + public static string ForeignKeyPropertyInKey([CanBeNull] object property, [CanBeNull] object entityType, [CanBeNull] object keyProperties, [CanBeNull] object baseEntityType) => string.Format( - GetString("ForeignKeyPropertyInKey", nameof(property), nameof(entityType), nameof(key), nameof(baseEntityType)), - property, entityType, key, baseEntityType); + GetString("ForeignKeyPropertyInKey", nameof(property), nameof(entityType), nameof(keyProperties), nameof(baseEntityType)), + property, entityType, keyProperties, baseEntityType); /// /// The provided principal entity key '{principalKey}' is not a key on the entity type '{principalEntityType}'. @@ -965,20 +965,20 @@ public static string ForeignKeySelfReferencingDependentEntityType([CanBeNull] ob dependentType); /// - /// The types of the properties specified for the foreign key {foreignKey} on entity type '{dependentType}' do not match the types of the properties in the principal key {principalKey} on entity type '{principalType}'. + /// The types of the properties specified for the foreign key {foreignKeyProperties} on entity type '{dependentType}' do not match the types of the properties in the principal key {principalKey} on entity type '{principalType}'. /// - public static string ForeignKeyTypeMismatch([CanBeNull] object foreignKey, [CanBeNull] object dependentType, [CanBeNull] object principalKey, [CanBeNull] object principalType) + public static string ForeignKeyTypeMismatch([CanBeNull] object foreignKeyProperties, [CanBeNull] object dependentType, [CanBeNull] object principalKey, [CanBeNull] object principalType) => string.Format( - GetString("ForeignKeyTypeMismatch", nameof(foreignKey), nameof(dependentType), nameof(principalKey), nameof(principalType)), - foreignKey, dependentType, principalKey, principalType); + GetString("ForeignKeyTypeMismatch", nameof(foreignKeyProperties), nameof(dependentType), nameof(principalKey), nameof(principalType)), + foreignKeyProperties, dependentType, principalKey, principalType); /// - /// The foreign key {foreignKey} targeting the key {key} on '{principalType}' cannot be removed from the entity type '{entityType}' because it is defined on the entity type '{otherEntityType}'. + /// The foreign key {foreignKeyProperties} targeting the key {keyProperties} on '{principalType}' cannot be removed from the entity type '{entityType}' because it is defined on the entity type '{otherEntityType}'. /// - public static string ForeignKeyWrongType([CanBeNull] object foreignKey, [CanBeNull] object key, [CanBeNull] object principalType, [CanBeNull] object entityType, [CanBeNull] object otherEntityType) + public static string ForeignKeyWrongType([CanBeNull] object foreignKeyProperties, [CanBeNull] object keyProperties, [CanBeNull] object principalType, [CanBeNull] object entityType, [CanBeNull] object otherEntityType) => string.Format( - GetString("ForeignKeyWrongType", nameof(foreignKey), nameof(key), nameof(principalType), nameof(entityType), nameof(otherEntityType)), - foreignKey, key, principalType, entityType, otherEntityType); + GetString("ForeignKeyWrongType", nameof(foreignKeyProperties), nameof(keyProperties), nameof(principalType), nameof(entityType), nameof(otherEntityType)), + foreignKeyProperties, keyProperties, principalType, entityType, otherEntityType); /// /// The entity type '{entityType}' is configured to use the '{changeTrackingStrategy}' change tracking strategy when full change tracking notifications are required. Use 'ModelBuilder.HasChangeTrackingStrategy' in 'OnModelCreating' to configure all entity types in the model to use the '{fullStrategy}' or '{fullPlusStrategy}' strategy. @@ -1096,7 +1096,7 @@ public static string InconsistentInheritance([CanBeNull] object entityType, [Can entityType, baseEntityType); /// - /// The entity type '{ownedEntityType}' is configured as owned, but the entity type '{nonOwnedEntityType}' is not. All entity types sharing a CLR type must be configured as owned. + /// The entity type '{ownedEntityType}' is configured as owned, but the entity type '{nonOwnedEntityType}' is not. All entity types sharing a CLR type must be configured as owned in 'OnModelCreating'. /// public static string InconsistentOwnership([CanBeNull] object ownedEntityType, [CanBeNull] object nonOwnedEntityType) => string.Format( @@ -1120,7 +1120,7 @@ public static string IndexWrongType([CanBeNull] object indexProperties, [CanBeNu indexProperties, entityType, otherEntityType); /// - /// The property '{property}' cannot be ignored on entity type '{entityType}', because it's declared on the base entity type '{baseEntityType}'. To exclude this property from your model, use [NotMapped] attribute or Ignore method on the base type. + /// The property '{property}' cannot be ignored on entity type '{entityType}', because it's declared on the base entity type '{baseEntityType}'. To exclude this property from your model, use [NotMapped] attribute or 'EntityTypeBuilder.Ignore' on the base type in 'OnModelCreating'. /// public static string InheritedPropertyCannotBeIgnored([CanBeNull] object property, [CanBeNull] object entityType, [CanBeNull] object baseEntityType) => string.Format( @@ -1128,7 +1128,7 @@ public static string InheritedPropertyCannotBeIgnored([CanBeNull] object propert property, entityType, baseEntityType); /// - /// The property '{entityType}.{navigation}' is of an interface type ('{propertyType}'). If it is a navigation property manually configure the relationship for this property by casting it to a mapped entity type, otherwise ignore the property using the [NotMapped] attribute or 'EntityTypeBuilder.Ignore' in 'OnModelCreating'. + /// The property '{entityType}.{navigation}' is of an interface type ('{propertyType}'). If it is a navigation manually configure the relationship for this property by casting it to a mapped entity type, otherwise ignore the property using the [NotMapped] attribute or 'EntityTypeBuilder.Ignore' in 'OnModelCreating'. /// public static string InterfacePropertyNotAdded([CanBeNull] object entityType, [CanBeNull] object navigation, [CanBeNull] object propertyType) => string.Format( @@ -1136,12 +1136,12 @@ public static string InterfacePropertyNotAdded([CanBeNull] object entityType, [C entityType, navigation, propertyType); /// - /// The entity type related to '{entityType}' cannot be determined because the specified foreign key {foreignKey} references entity type '{principalEntityType}' that it is in the same hierarchy as the entity type that it is declared on '{dependentEntityType}'. + /// The entity type related to '{entityType}' cannot be determined because the specified foreign key {foreignKeyProperties} references entity type '{principalEntityType}' that it is in the same hierarchy as the entity type that it is declared on '{dependentEntityType}'. /// - public static string IntraHierarchicalAmbiguousTargetEntityType([CanBeNull] object entityType, [CanBeNull] object foreignKey, [CanBeNull] object principalEntityType, [CanBeNull] object dependentEntityType) + public static string IntraHierarchicalAmbiguousTargetEntityType([CanBeNull] object entityType, [CanBeNull] object foreignKeyProperties, [CanBeNull] object principalEntityType, [CanBeNull] object dependentEntityType) => string.Format( - GetString("IntraHierarchicalAmbiguousTargetEntityType", nameof(entityType), nameof(foreignKey), nameof(principalEntityType), nameof(dependentEntityType)), - entityType, foreignKey, principalEntityType, dependentEntityType); + GetString("IntraHierarchicalAmbiguousTargetEntityType", nameof(entityType), nameof(foreignKeyProperties), nameof(principalEntityType), nameof(dependentEntityType)), + entityType, foreignKeyProperties, principalEntityType, dependentEntityType); /// /// Unable to track an entity of type '{entityType}' because alternate key property '{keyProperty}' is null. If the alternate key is not used in a relationship, then consider using a unique index instead. Unique indexes may contain nulls, while alternate keys must not. @@ -1152,7 +1152,7 @@ public static string InvalidAlternateKeyValue([CanBeNull] object entityType, [Ca entityType, keyProperty); /// - /// The specified type '{type}'must be a non-interface reference type to be used as an entity type. + /// The specified type '{type}' must be a non-interface reference type to be used as an entity type. /// public static string InvalidEntityType([CanBeNull] object type) => string.Format( @@ -1184,7 +1184,7 @@ public static string InvalidKeyValue([CanBeNull] object entityType, [CanBeNull] entityType, keyProperty); /// - /// Lambda expression used inside Include is not valid. + /// Lambda expression used inside 'Include' is not valid. /// public static string InvalidLambdaExpressionInsideInclude => GetString("InvalidLambdaExpressionInsideInclude"); @@ -1212,7 +1212,7 @@ public static string InvalidMembersExpression([CanBeNull] object expression) expression); /// - /// The [InverseProperty] attribute on property '{1_entityType}.{0_property}' is not valid. The property '{referencedProperty}' is not a valid navigation property on the related type '{referencedEntityType}'. Ensure that the property exists and is a valid reference or collection navigation property. + /// The [InverseProperty] attribute on property '{1_entityType}.{0_property}' is not valid. The property '{referencedProperty}' is not a valid navigation on the related type '{referencedEntityType}'. Ensure that the property exists and is a valid reference or collection navigation. /// public static string InvalidNavigationWithInverseProperty([CanBeNull] object property, [CanBeNull] object entityType, [CanBeNull] object referencedProperty, [CanBeNull] object referencedEntityType) => string.Format( @@ -1324,7 +1324,7 @@ public static string InvalidType([CanBeNull] object property, [CanBeNull] object property, entityType, valueType, propertyType); /// - /// Invalid type conversion when specifying include. + /// Invalid type conversion specified in 'Include' call. /// public static string InvalidTypeConversationWithInclude => GetString("InvalidTypeConversationWithInclude"); @@ -1384,12 +1384,12 @@ public static string KeyAttributeOnDerivedEntity([CanBeNull] object derivedType, derivedType, property); /// - /// Cannot remove key {key} from entity type '{entityType}' because it is referenced by a foreign key {foreignKey} in entity type '{dependentType}'. All foreign keys must be removed or redefined before the referenced key can be removed. + /// Cannot remove key {keyProperties} from entity type '{entityType}' because it is referenced by a foreign key {foreignKeyProperties} in entity type '{dependentType}'. All foreign keys must be removed or redefined before the referenced key can be removed. /// - public static string KeyInUse([CanBeNull] object key, [CanBeNull] object entityType, [CanBeNull] object foreignKey, [CanBeNull] object dependentType) + public static string KeyInUse([CanBeNull] object keyProperties, [CanBeNull] object entityType, [CanBeNull] object foreignKeyProperties, [CanBeNull] object dependentType) => string.Format( - GetString("KeyInUse", nameof(key), nameof(entityType), nameof(foreignKey), nameof(dependentType)), - key, entityType, foreignKey, dependentType); + GetString("KeyInUse", nameof(keyProperties), nameof(entityType), nameof(foreignKeyProperties), nameof(dependentType)), + keyProperties, entityType, foreignKeyProperties, dependentType); /// /// The entity type '{entityType}' cannot be marked as keyless because it contains a key. @@ -1408,28 +1408,28 @@ public static string KeylessTypeTracked([CanBeNull] object type) type); /// - /// The key {key} cannot be added to keyless type '{entityType}'. + /// The key {keyProperties} cannot be added to keyless type '{entityType}'. /// - public static string KeylessTypeWithKey([CanBeNull] object key, [CanBeNull] object entityType) + public static string KeylessTypeWithKey([CanBeNull] object keyProperties, [CanBeNull] object entityType) => string.Format( - GetString("KeylessTypeWithKey", nameof(key), nameof(entityType)), - key, entityType); + GetString("KeylessTypeWithKey", nameof(keyProperties), nameof(entityType)), + keyProperties, entityType); /// - /// The specified key properties {key} are not declared on the entity type '{entityType}'. Ensure key properties are declared on the target entity type. + /// The specified key properties {keyProperties} are not declared on the entity type '{entityType}'. Ensure key properties are declared on the target entity type. /// - public static string KeyPropertiesWrongEntity([CanBeNull] object key, [CanBeNull] object entityType) + public static string KeyPropertiesWrongEntity([CanBeNull] object keyProperties, [CanBeNull] object entityType) => string.Format( - GetString("KeyPropertiesWrongEntity", nameof(key), nameof(entityType)), - key, entityType); + GetString("KeyPropertiesWrongEntity", nameof(keyProperties), nameof(entityType)), + keyProperties, entityType); /// - /// The property '{1_entityType}.{0_property}' cannot be marked as nullable/optional because it has been included in a key {key}. + /// The property '{1_entityType}.{0_property}' cannot be marked as nullable/optional because it has been included in a key {keyProperties}. /// - public static string KeyPropertyCannotBeNullable([CanBeNull] object property, [CanBeNull] object entityType, [CanBeNull] object key) + public static string KeyPropertyCannotBeNullable([CanBeNull] object property, [CanBeNull] object entityType, [CanBeNull] object keyProperties) => string.Format( - GetString("KeyPropertyCannotBeNullable", "0_property", "1_entityType", nameof(key)), - property, entityType, key); + GetString("KeyPropertyCannotBeNullable", "0_property", "1_entityType", nameof(keyProperties)), + property, entityType, keyProperties); /// /// The property '{1_entityType}.{0_property}' cannot be part of a key because it has value generation enabled and is contained in a foreign key defined on a derived entity type. @@ -1456,12 +1456,12 @@ public static string KeyReadOnly([CanBeNull] object property, [CanBeNull] object property, entityType); /// - /// The key {key} cannot be removed from the entity type '{entityType}' because it is defined on the entity type '{otherEntityType}'. + /// The key {keyProperties} cannot be removed from the entity type '{entityType}' because it is defined on the entity type '{otherEntityType}'. /// - public static string KeyWrongType([CanBeNull] object key, [CanBeNull] object entityType, [CanBeNull] object otherEntityType) + public static string KeyWrongType([CanBeNull] object keyProperties, [CanBeNull] object entityType, [CanBeNull] object otherEntityType) => string.Format( - GetString("KeyWrongType", nameof(key), nameof(entityType), nameof(otherEntityType)), - key, entityType, otherEntityType); + GetString("KeyWrongType", nameof(keyProperties), nameof(entityType), nameof(otherEntityType)), + keyProperties, entityType, otherEntityType); /// /// The type mapping for '{type}' has not implemented code literal generation. @@ -1480,7 +1480,7 @@ public static string MissingBackingField([CanBeNull] object field, [CanBeNull] o field, property, entityType); /// - /// Unable to set up a many-to-many relationship between the entity types '{principalEntityType}' and '{declaringEntityType}' because one of the navigations was not specified. Please provide a navigation property in the HasMany() call. + /// Unable to set up a many-to-many relationship between the entity types '{principalEntityType}' and '{declaringEntityType}' because one of the navigations was not specified. Please provide a navigation in the 'HasMany()' call in 'OnModelCreating'. /// public static string MissingInverseManyToManyNavigation([CanBeNull] object principalEntityType, [CanBeNull] object declaringEntityType) => string.Format( @@ -1568,7 +1568,7 @@ public static string NamedIndexWrongType([CanBeNull] object indexName, [CanBeNul indexName, entityType); /// - /// The type of navigation property '{1_entityType}.{0_navigation}' is '{foundType}' which is an array type. Collection navigation properties cannot be arrays. + /// The type of navigation '{1_entityType}.{0_navigation}' is '{foundType}' which is an array type. Collection navigation properties cannot be arrays. /// public static string NavigationArray([CanBeNull] object navigation, [CanBeNull] object entityType, [CanBeNull] object foundType) => string.Format( @@ -1576,7 +1576,7 @@ public static string NavigationArray([CanBeNull] object navigation, [CanBeNull] navigation, entityType, foundType); /// - /// The type of navigation property '{1_entityType}.{0_navigation}' is '{foundType}' which does not implement ICollection<{targetType}>. Collection navigation properties must implement ICollection<> of the target type. + /// The type of navigation '{1_entityType}.{0_navigation}' is '{foundType}' which does not implement ICollection<{targetType}>. Collection navigation properties must implement ICollection<> of the target type. /// public static string NavigationBadType([CanBeNull] object navigation, [CanBeNull] object entityType, [CanBeNull] object foundType, [CanBeNull] object targetType) => string.Format( @@ -1584,7 +1584,7 @@ public static string NavigationBadType([CanBeNull] object navigation, [CanBeNull navigation, entityType, foundType, targetType); /// - /// The type of navigation property '{1_entityType}.{0_navigation}' is '{foundType}' for which it was not possible to create a concrete instance. Either initialize the property before use, add a public parameterless constructor to the type, or use a type which can be assigned a HashSet<> or List<>. + /// The type of navigation '{1_entityType}.{0_navigation}' is '{foundType}' for which it was not possible to create a concrete instance. Either initialize the property before use, add a public parameterless constructor to the type, or use a type which can be assigned a HashSet<> or List<>. /// public static string NavigationCannotCreateType([CanBeNull] object navigation, [CanBeNull] object entityType, [CanBeNull] object foundType) => string.Format( @@ -1592,7 +1592,7 @@ public static string NavigationCannotCreateType([CanBeNull] object navigation, [ navigation, entityType, foundType); /// - /// The collection navigation property '{navigation}' cannot be added to the entity type '{entityType}' because its CLR type '{clrType}' does not implement 'IEnumerable<{targetType}>'. Collection navigation properties must implement IEnumerable<> of the related entity. + /// The collection navigation '{navigation}' cannot be added to the entity type '{entityType}' because its CLR type '{clrType}' does not implement 'IEnumerable<{targetType}>'. Collection navigation properties must implement IEnumerable<> of the related entity. /// public static string NavigationCollectionWrongClrType([CanBeNull] object navigation, [CanBeNull] object entityType, [CanBeNull] object clrType, [CanBeNull] object targetType) => string.Format( @@ -1600,7 +1600,7 @@ public static string NavigationCollectionWrongClrType([CanBeNull] object navigat navigation, entityType, clrType, targetType); /// - /// The navigation property '{1_entityType}.{0_navigation}' cannot be associated with foreign key {targetFk} because it was created for foreign key {actualFk}. + /// The navigation '{1_entityType}.{0_navigation}' cannot be associated with foreign key {targetFk} because it was created for foreign key {actualFk}. /// public static string NavigationForWrongForeignKey([CanBeNull] object navigation, [CanBeNull] object entityType, [CanBeNull] object targetFk, [CanBeNull] object actualFk) => string.Format( @@ -1608,15 +1608,15 @@ public static string NavigationForWrongForeignKey([CanBeNull] object navigation, navigation, entityType, targetFk, actualFk); /// - /// The property '{1_entityType}.{0_property}' is being accessed using the '{ReferenceMethod}' or '{CollectionMethod}' method, but is defined in the model as a non-navigation property. Use the '{PropertyMethod}' method to access non-navigation properties. + /// The property '{1_entityType}.{0_property}' is being accessed using the '{referenceMethod}' or '{collectionMethod}' method, but is defined in the model as a non-navigation. Use the '{propertyMethod}' method to access non-navigation properties. /// - public static string NavigationIsProperty([CanBeNull] object property, [CanBeNull] object entityType, [CanBeNull] object ReferenceMethod, [CanBeNull] object CollectionMethod, [CanBeNull] object PropertyMethod) + public static string NavigationIsProperty([CanBeNull] object property, [CanBeNull] object entityType, [CanBeNull] object referenceMethod, [CanBeNull] object collectionMethod, [CanBeNull] object propertyMethod) => string.Format( - GetString("NavigationIsProperty", "0_property", "1_entityType", nameof(ReferenceMethod), nameof(CollectionMethod), nameof(PropertyMethod)), - property, entityType, ReferenceMethod, CollectionMethod, PropertyMethod); + GetString("NavigationIsProperty", "0_property", "1_entityType", nameof(referenceMethod), nameof(collectionMethod), nameof(propertyMethod)), + property, entityType, referenceMethod, collectionMethod, propertyMethod); /// - /// The navigation property '{1_entityType}.{0_navigation}' does not have a setter and no writable backing field was found or specified. Read-only collection navigation properties must be initialized before use. + /// The navigation '{1_entityType}.{0_navigation}' does not have a setter and no writable backing field was found or specified. Read-only collection navigation properties must be initialized before use. /// public static string NavigationNoSetter([CanBeNull] object navigation, [CanBeNull] object entityType) => string.Format( @@ -1624,7 +1624,7 @@ public static string NavigationNoSetter([CanBeNull] object navigation, [CanBeNul navigation, entityType); /// - /// Unable to determine the relationship represented by navigation property '{entityType}.{navigation}' of type '{propertyType}'. Either manually configure the relationship, or ignore this property using the '[NotMapped]' attribute or by using 'EntityTypeBuilder.Ignore' in 'OnModelCreating'. + /// Unable to determine the relationship represented by navigation '{entityType}.{navigation}' of type '{propertyType}'. Either manually configure the relationship, or ignore this property using the '[NotMapped]' attribute or by using 'EntityTypeBuilder.Ignore' in 'OnModelCreating'. /// public static string NavigationNotAdded([CanBeNull] object entityType, [CanBeNull] object navigation, [CanBeNull] object propertyType) => string.Format( @@ -1632,7 +1632,7 @@ public static string NavigationNotAdded([CanBeNull] object entityType, [CanBeNul entityType, navigation, propertyType); /// - /// The navigation property '{navigation}' cannot be added to the entity type '{entityType}' because its CLR type '{clrType}' does not match the expected CLR type '{targetType}'. + /// The navigation '{navigation}' cannot be added to the entity type '{entityType}' because its CLR type '{clrType}' does not match the expected CLR type '{targetType}'. /// public static string NavigationSingleWrongClrType([CanBeNull] object navigation, [CanBeNull] object entityType, [CanBeNull] object clrType, [CanBeNull] object targetType) => string.Format( @@ -1648,7 +1648,7 @@ public static string NavigationToKeylessType([CanBeNull] object navigation, [Can navigation, entityType); /// - /// The navigation property '{navigation}' cannot be added to the entity type '{entityType}' because the target entity type '{targetType}' is defined in shadow state and navigations properties cannot point to shadow state entities. + /// The navigation '{navigation}' cannot be added to the entity type '{entityType}' because the target entity type '{targetType}' is defined in shadow state and navigations properties cannot point to shadow state entities. /// public static string NavigationToShadowEntity([CanBeNull] object navigation, [CanBeNull] object entityType, [CanBeNull] object targetType) => string.Format( @@ -1656,12 +1656,12 @@ public static string NavigationToShadowEntity([CanBeNull] object navigation, [Ca navigation, entityType, targetType); /// - /// No field was found backing property '{1_entityType}.{0_property}'. Either name the backing field so that it is picked up by convention, configure the backing field to use, or use a different '{pam}'. + /// No field was found backing property '{1_entityType}.{0_property}'. Either name the backing field so that it is picked up by convention, configure the backing field to use, or use a different '{propertyAccessMode}'. /// - public static string NoBackingField([CanBeNull] object property, [CanBeNull] object entityType, [CanBeNull] object pam) + public static string NoBackingField([CanBeNull] object property, [CanBeNull] object entityType, [CanBeNull] object propertyAccessMode) => string.Format( - GetString("NoBackingField", "0_property", "1_entityType", nameof(pam)), - property, entityType, pam); + GetString("NoBackingField", "0_property", "1_entityType", nameof(propertyAccessMode)), + property, entityType, propertyAccessMode); /// /// No field was found backing property '{1_entityType}.{0_property}'. Lazy-loaded navigation properties must have backing fields. Either name the backing field so that it is picked up by convention or configure the backing field to use. @@ -1672,7 +1672,7 @@ public static string NoBackingFieldLazyLoading([CanBeNull] object property, [Can property, entityType); /// - /// The navigation property '{navigation}' cannot be added to the entity type '{entityType}' because there is no corresponding CLR property on the underlying type and navigations properties cannot be added in shadow state. + /// The navigation '{navigation}' cannot be added to the entity type '{entityType}' because there is no corresponding CLR property on the underlying type and navigations properties cannot be added in shadow state. /// public static string NoClrNavigation([CanBeNull] object navigation, [CanBeNull] object entityType) => string.Format( @@ -1720,7 +1720,7 @@ public static string NoDiscriminatorValue([CanBeNull] object entityType) entityType); /// - /// Entity Framework services have not been added to the internal service provider. Either remove the call to UseInternalServiceProvider so that EF will manage its own internal services, or use the method from your database provider to add the required services to the service provider (e.g. AddEntityFrameworkSqlServer). + /// Entity Framework services have not been added to the internal service provider. Either remove the call to 'UseInternalServiceProvider' so that EF will manage its own internal services, or use the method from your database provider to add the required services to the service provider (e.g. 'AddEntityFrameworkSqlServer'). /// public static string NoEfServices => GetString("NoEfServices"); @@ -1742,12 +1742,12 @@ public static string NoFieldOrSetter([CanBeNull] object property, [CanBeNull] ob property, entityType); /// - /// The property '{1_entityType}.{0_property}' does not have a getter. Either make the property readable or use a different '{pam}'. + /// The property '{1_entityType}.{0_property}' does not have a getter. Either make the property readable or use a different '{propertyAccessMode}'. /// - public static string NoGetter([CanBeNull] object property, [CanBeNull] object entityType, [CanBeNull] object pam) + public static string NoGetter([CanBeNull] object property, [CanBeNull] object entityType, [CanBeNull] object propertyAccessMode) => string.Format( - GetString("NoGetter", "0_property", "1_entityType", nameof(pam)), - property, entityType, pam); + GetString("NoGetter", "0_property", "1_entityType", nameof(propertyAccessMode)), + property, entityType, propertyAccessMode); /// /// 'InterceptionResult.Result' was called when 'InterceptionResult.HasResult' is false. @@ -1756,12 +1756,12 @@ public static string NoInterceptionResult => GetString("NoInterceptionResult"); /// - /// There is no navigation on entity type '{entityType}' associated with the foreign key {foreignKey}. + /// There is no navigation on entity type '{entityType}' associated with the foreign key {foreignKeyProperties}. /// - public static string NoNavigation([CanBeNull] object entityType, [CanBeNull] object foreignKey) + public static string NoNavigation([CanBeNull] object entityType, [CanBeNull] object foreignKeyProperties) => string.Format( - GetString("NoNavigation", nameof(entityType), nameof(foreignKey)), - entityType, foreignKey); + GetString("NoNavigation", nameof(entityType), nameof(foreignKeyProperties)), + entityType, foreignKeyProperties); /// /// The entity type '{entityType}' cannot inherit from '{baseEntityType}' because '{baseEntityType}' is a shadow state entity type while '{entityType}' is not. @@ -1772,7 +1772,7 @@ public static string NonClrBaseType([CanBeNull] object entityType, [CanBeNull] o entityType, baseEntityType); /// - /// Property '{entityType}.{property}' cannot be used as a key because it has type '{providerType}' which does not implement 'IComparable<T>', 'IComparable' or 'IStructuralComparable'. Use 'HasConversion()' in 'OnModelCreating()' to wrap '{providerType}' with a type that can be compared. + /// Property '{entityType}.{property}' cannot be used as a key because it has type '{providerType}' which does not implement 'IComparable<T>', 'IComparable' or 'IStructuralComparable'. Use 'HasConversion()' in 'OnModelCreating' to wrap '{providerType}' with a type that can be compared. /// public static string NonComparableKeyType([CanBeNull] object entityType, [CanBeNull] object property, [CanBeNull] object providerType) => string.Format( @@ -1788,7 +1788,7 @@ public static string NonComparableKeyTypes([CanBeNull] object entityType, [CanBe entityType, property, modelType, providerType); /// - /// The navigation '{1_entityType}.{0_navigation}' must be configured using Fluent API with an explicit name for the target shared type entity type or excluded by calling 'EntityTypeBuilder.Ignore'. + /// The navigation '{1_entityType}.{0_navigation}' must be configured in 'OnModelCreating' with an explicit name for the target shared type entity type or excluded by calling 'EntityTypeBuilder.Ignore'. /// public static string NonConfiguredNavigationToSharedType([CanBeNull] object navigation, [CanBeNull] object entityType) => string.Format( @@ -1820,7 +1820,7 @@ public static string NonIndexerEntityType([CanBeNull] object property, [CanBeNul property, entityType, type); /// - /// The collection type being used for navigation property '{1_entityType}.{0_navigation}' does not implement 'INotifyCollectionChanged'. Any entity type configured to use the '{changeTrackingStrategy}' change tracking strategy must use collections that implement 'INotifyCollectionChanged'. Consider using 'ObservableCollection<T>' for this. + /// The collection type being used for navigation '{1_entityType}.{0_navigation}' does not implement 'INotifyCollectionChanged'. Any entity type configured to use the '{changeTrackingStrategy}' change tracking strategy must use collections that implement 'INotifyCollectionChanged'. Consider using 'ObservableCollection<T>' for this. /// public static string NonNotifyingCollection([CanBeNull] object navigation, [CanBeNull] object entityType, [CanBeNull] object changeTrackingStrategy) => string.Format( @@ -1836,12 +1836,12 @@ public static string NonShadowBaseType([CanBeNull] object entityType, [CanBeNull entityType, baseEntityType); /// - /// The foreign key {foreignKey} on the entity type '{declaringEntityType}' cannot have a required dependent end since it is not unique. + /// The foreign key {foreignKeyProperties} on the entity type '{declaringEntityType}' cannot have a required dependent end since it is not unique. /// - public static string NonUniqueRequiredDependentForeignKey([CanBeNull] object foreignKey, [CanBeNull] object declaringEntityType) + public static string NonUniqueRequiredDependentForeignKey([CanBeNull] object foreignKeyProperties, [CanBeNull] object declaringEntityType) => string.Format( - GetString("NonUniqueRequiredDependentForeignKey", nameof(foreignKey), nameof(declaringEntityType)), - foreignKey, declaringEntityType); + GetString("NonUniqueRequiredDependentForeignKey", nameof(foreignKeyProperties), nameof(declaringEntityType)), + foreignKeyProperties, declaringEntityType); /// /// '{principalEntityType}.{principalNavigation}' cannot be configured as required since it contains a collection. @@ -1860,12 +1860,12 @@ public static string NoParameterlessConstructor([CanBeNull] object entityType) entityType); /// - /// No property was associated with field '{field}' of entity type '{entity}'. Either configure a property or use a different '{pam}'. + /// No property was associated with field '{field}' of entity type '{entity}'. Either configure a property or use a different '{propertyAccessMode}'. /// - public static string NoProperty([CanBeNull] object field, [CanBeNull] object entity, [CanBeNull] object pam) + public static string NoProperty([CanBeNull] object field, [CanBeNull] object entity, [CanBeNull] object propertyAccessMode) => string.Format( - GetString("NoProperty", nameof(field), nameof(entity), nameof(pam)), - field, entity, pam); + GetString("NoProperty", nameof(field), nameof(entity), nameof(propertyAccessMode)), + field, entity, propertyAccessMode); /// /// The property '{property}' cannot be added to the type '{entityType}' because there was no property type specified and there is no corresponding CLR property or field. To add a shadow state property the property type must be specified. @@ -1890,12 +1890,12 @@ public static string NoProviderConfiguredFailedToResolveService([CanBeNull] obje service); /// - /// The property '{1_entityType}.{0_property}' does not have a setter. Either make the property writable or use a different '{pam}'. + /// The property '{1_entityType}.{0_property}' does not have a setter. Either make the property writable or use a different '{propertyAccessMode}'. /// - public static string NoSetter([CanBeNull] object property, [CanBeNull] object entityType, [CanBeNull] object pam) + public static string NoSetter([CanBeNull] object property, [CanBeNull] object entityType, [CanBeNull] object propertyAccessMode) => string.Format( - GetString("NoSetter", "0_property", "1_entityType", nameof(pam)), - property, entityType, pam); + GetString("NoSetter", "0_property", "1_entityType", nameof(propertyAccessMode)), + property, entityType, propertyAccessMode); /// /// The database provider attempted to register an implementation of the '{service}' service. This is not a service defined by EF and as such must be registered as a provider-specific service using the 'TryAddProviderSpecificServices' method. @@ -1920,7 +1920,7 @@ public static string NotQueryingEnumerable => GetString("NotQueryingEnumerable"); /// - /// The '{1_entityType}.{0_property}' does not have a value set and no value generator is available for properties of type '{propertyType}'. Either set a value for the property before adding the entity or configure a value generator for properties of type '{propertyType}'. + /// The '{1_entityType}.{0_property}' does not have a value set and no value generator is available for properties of type '{propertyType}'. Either set a value for the property before adding the entity or configure a value generator for properties of type '{propertyType}' in 'OnModelCreating'. /// public static string NoValueGenerator([CanBeNull] object property, [CanBeNull] object entityType, [CanBeNull] object propertyType) => string.Format( @@ -1960,7 +1960,7 @@ public static string OwnedDerivedType([CanBeNull] object entityType) entityType); /// - /// A tracking query projects owned entity without corresponding owner in result. Owned entities cannot be tracked without their owner. Either include the owner entity in the result or make query non-tracking using AsNoTracking(). + /// A tracking query projects owned entity without corresponding owner in result. Owned entities cannot be tracked without their owner. Either include the owner entity in the result or make query non-tracking using 'AsNoTracking()'. /// public static string OwnedEntitiesCannotBeTrackedWithoutTheirOwner => GetString("OwnedEntitiesCannotBeTrackedWithoutTheirOwner"); @@ -2052,12 +2052,12 @@ public static string PropertyDoesNotBelong([CanBeNull] object property, [CanBeNu property, entityType, expectedType); /// - /// The property '{property}' cannot be removed from entity type '{entityType}' because it is being used in the foreign key {foreignKey} on '{foreignKeyType}'. All containing foreign keys must be removed or redefined before the property can be removed. + /// The property '{property}' cannot be removed from entity type '{entityType}' because it is being used in the foreign key {foreignKeyProperties} on '{foreignKeyType}'. All containing foreign keys must be removed or redefined before the property can be removed. /// - public static string PropertyInUseForeignKey([CanBeNull] object property, [CanBeNull] object entityType, [CanBeNull] object foreignKey, [CanBeNull] object foreignKeyType) + public static string PropertyInUseForeignKey([CanBeNull] object property, [CanBeNull] object entityType, [CanBeNull] object foreignKeyProperties, [CanBeNull] object foreignKeyType) => string.Format( - GetString("PropertyInUseForeignKey", nameof(property), nameof(entityType), nameof(foreignKey), nameof(foreignKeyType)), - property, entityType, foreignKey, foreignKeyType); + GetString("PropertyInUseForeignKey", nameof(property), nameof(entityType), nameof(foreignKeyProperties), nameof(foreignKeyType)), + property, entityType, foreignKeyProperties, foreignKeyType); /// /// The property '{property}' cannot be removed from entity type '{entityType}' because it is being used in the index {index} on '{indexType}'. All containing indexes must be removed or redefined before the property can be removed. @@ -2068,15 +2068,15 @@ public static string PropertyInUseIndex([CanBeNull] object property, [CanBeNull] property, entityType, index, indexType); /// - /// The property '{property}' cannot be removed from entity type '{entityType}' because it is being used in the key {key}. All containing keys must be removed or redefined before the property can be removed. + /// The property '{property}' cannot be removed from entity type '{entityType}' because it is being used in the key {keyProperties}. All containing keys must be removed or redefined before the property can be removed. /// - public static string PropertyInUseKey([CanBeNull] object property, [CanBeNull] object entityType, [CanBeNull] object key) + public static string PropertyInUseKey([CanBeNull] object property, [CanBeNull] object entityType, [CanBeNull] object keyProperties) => string.Format( - GetString("PropertyInUseKey", nameof(property), nameof(entityType), nameof(key)), - property, entityType, key); + GetString("PropertyInUseKey", nameof(property), nameof(entityType), nameof(keyProperties)), + property, entityType, keyProperties); /// - /// The property '{1_entityType}.{0_property}' is being accessed using the '{propertyMethod}' method, but is defined in the model as a navigation property. Use either the '{referenceMethod}' or '{collectionMethod}' method to access navigation properties. + /// The property '{1_entityType}.{0_property}' is being accessed using the '{propertyMethod}' method, but is defined in the model as a navigation. Use either the '{referenceMethod}' or '{collectionMethod}' method to access navigation properties. /// public static string PropertyIsNavigation([CanBeNull] object property, [CanBeNull] object entityType, [CanBeNull] object propertyMethod, [CanBeNull] object referenceMethod, [CanBeNull] object collectionMethod) => string.Format( @@ -2145,14 +2145,6 @@ public static string PropertyWrongEntityClrType([CanBeNull] object property, [Ca GetString("PropertyWrongEntityClrType", nameof(property), nameof(entityType), nameof(clrType)), property, entityType, clrType); - /// - /// The CLR property '{property}' cannot be added to entity type '{entityType}'({sharedType}) because it is declared on the CLR type '{clrType}'. - /// - public static string PropertyWrongEntitySharedClrType([CanBeNull] object property, [CanBeNull] object entityType, [CanBeNull] object sharedType, [CanBeNull] object clrType) - => string.Format( - GetString("PropertyWrongEntitySharedClrType", nameof(property), nameof(entityType), nameof(sharedType), nameof(clrType)), - property, entityType, sharedType, clrType); - /// /// The property '{property}' cannot be added to type '{entityType}' because the name of the given CLR property or field '{clrName}' is different. /// @@ -2230,13 +2222,13 @@ public static string QueryUnableToTranslateStringEqualsWithStringComparison => GetString("QueryUnableToTranslateStringEqualsWithStringComparison"); /// - /// An attempt was made to use the context while it is being configured. A DbContext instance cannot be used inside OnConfiguring since it is still being configured at this point. This can happen if a second operation is started on this context before a previous operation completed. Any instance members are not guaranteed to be thread safe. + /// An attempt was made to use the context while it is being configured. A DbContext instance cannot be used inside 'OnConfiguring' since it is still being configured at this point. This can happen if a second operation is started on this context before a previous operation completed. Any instance members are not guaranteed to be thread safe. /// public static string RecursiveOnConfiguring => GetString("RecursiveOnConfiguring"); /// - /// An attempt was made to use the model while it was being created. A DbContext instance cannot be used inside OnModelCreating in any way that makes use of the model that is being created. + /// An attempt was made to use the model while it was being created. A DbContext instance cannot be used inside 'OnModelCreating' in any way that makes use of the model that is being created. /// public static string RecursiveOnModelCreating => GetString("RecursiveOnModelCreating"); @@ -2250,15 +2242,15 @@ public static string ReferencedShadowKey([CanBeNull] object referencingEntityTyp referencingEntityTypeOrNavigation, referencedEntityTypeOrNavigation, foreignKeyPropertiesWithTypes, primaryKeyPropertiesWithTypes); /// - /// The property '{1_entityType}.{0_property}' is being accessed using the '{ReferenceMethod}' method, but is defined in the model as a collection navigation property. Use the '{CollectionMethod}' method to access collection navigation properties. + /// The property '{1_entityType}.{0_property}' is being accessed using the '{referenceMethod}' method, but is defined in the model as a collection navigation. Use the '{collectionMethod}' method to access collection navigation properties. /// - public static string ReferenceIsCollection([CanBeNull] object property, [CanBeNull] object entityType, [CanBeNull] object ReferenceMethod, [CanBeNull] object CollectionMethod) + public static string ReferenceIsCollection([CanBeNull] object property, [CanBeNull] object entityType, [CanBeNull] object referenceMethod, [CanBeNull] object collectionMethod) => string.Format( - GetString("ReferenceIsCollection", "0_property", "1_entityType", nameof(ReferenceMethod), nameof(CollectionMethod)), - property, entityType, ReferenceMethod, CollectionMethod); + GetString("ReferenceIsCollection", "0_property", "1_entityType", nameof(referenceMethod), nameof(collectionMethod)), + property, entityType, referenceMethod, collectionMethod); /// - /// Navigation property '{1_entityType}.{0_navigation}' cannot have 'IsLoaded' set to false because the referenced entity is non-null and therefore is loaded. + /// The navigation '{1_entityType}.{0_navigation}' cannot have 'IsLoaded' set to false because the referenced entity is non-null and therefore is loaded. /// public static string ReferenceMustBeLoaded([CanBeNull] object navigation, [CanBeNull] object entityType) => string.Format( @@ -2396,13 +2388,19 @@ public static string SeedDatumSignedNumericValue([CanBeNull] object entityType, entityType, property); /// - /// A relationship cannot be established from property '{1_entityType}.{0_property}' to property '{3_referencedEntityType}.{2_referencedProperty}'. Check the values in the [InverseProperty] attribute to ensure relationship definitions are unique and reference from one navigation property to its corresponding inverse navigation property. + /// A relationship cannot be established from property '{1_entityType}.{0_property}' to property '{3_referencedEntityType}.{2_referencedProperty}'. Check the values in the [InverseProperty] attribute to ensure relationship definitions are unique and reference from one navigation to its corresponding inverse navigation. /// public static string SelfReferencingNavigationWithInverseProperty([CanBeNull] object property, [CanBeNull] object entityType, [CanBeNull] object referencedProperty, [CanBeNull] object referencedEntityType) => string.Format( GetString("SelfReferencingNavigationWithInverseProperty", "0_property", "1_entityType", "2_referencedProperty", "3_referencedEntityType"), property, entityType, referencedProperty, referencedEntityType); + /// + /// To show additional information call EnableSensitiveDataLogging() when overriding DbContext.OnConfiguring. + /// + public static string SensitiveDataDisabled + => GetString("SensitiveDataDisabled"); + /// /// Sequence contains more than one element. /// @@ -2440,7 +2438,7 @@ public static string ServiceProviderConfigRemoved([CanBeNull] object key) key); /// - /// When performing a set operation, both operands must have the same Include operations. + /// When performing a set operation, both operands must have the same 'Include' operations. /// public static string SetOperationWithDifferentIncludesInOperands => GetString("SetOperationWithDifferentIncludesInOperands"); @@ -2478,12 +2476,12 @@ public static string SingletonRequired([CanBeNull] object scope, [CanBeNull] obj scope, service); /// - /// The foreign key '{foreignKey}' cannot be set for the skip navigation '{navigation}' as it uses the join entity type '{joinType}' while the inverse skip navigation '{inverse}' is using the join entity type '{inverseJoinType}'. The inverse should use the same join entity type. + /// The foreign key {foreignKeyProperties} cannot be set for the skip navigation '{navigation}' as it uses the join entity type '{joinType}' while the inverse skip navigation '{inverse}' is using the join entity type '{inverseJoinType}'. The inverse should use the same join entity type. /// - public static string SkipInverseMismatchedForeignKey([CanBeNull] object foreignKey, [CanBeNull] object navigation, [CanBeNull] object joinType, [CanBeNull] object inverse, [CanBeNull] object inverseJoinType) + public static string SkipInverseMismatchedForeignKey([CanBeNull] object foreignKeyProperties, [CanBeNull] object navigation, [CanBeNull] object joinType, [CanBeNull] object inverse, [CanBeNull] object inverseJoinType) => string.Format( - GetString("SkipInverseMismatchedForeignKey", nameof(foreignKey), nameof(navigation), nameof(joinType), nameof(inverse), nameof(inverseJoinType)), - foreignKey, navigation, joinType, inverse, inverseJoinType); + GetString("SkipInverseMismatchedForeignKey", nameof(foreignKeyProperties), nameof(navigation), nameof(joinType), nameof(inverse), nameof(inverseJoinType)), + foreignKeyProperties, navigation, joinType, inverse, inverseJoinType); /// /// The skip navigation '{inverse}' using the join entity type '{inverseJoinType}' cannot be set as the inverse of '{navigation}' that uses the join entity type '{joinType}'. The inverse should use the same join entity type. @@ -2494,20 +2492,20 @@ public static string SkipInverseMismatchedJoinType([CanBeNull] object inverse, [ inverse, inverseJoinType, navigation, joinType); /// - /// The foreign key {foreignKey} cannot be used for the skip navigation property '{2_entityType}.{1_navigation}' because it is expected to be on the dependent entity type '{dependentEntityType}'. + /// The foreign key {foreignKeyProperties} cannot be used for the skip navigation '{2_entityType}.{1_navigation}' because it is expected to be on the dependent entity type '{dependentEntityType}'. /// - public static string SkipNavigationForeignKeyWrongDependentType([CanBeNull] object foreignKey, [CanBeNull] object navigation, [CanBeNull] object entityType, [CanBeNull] object dependentEntityType) + public static string SkipNavigationForeignKeyWrongDependentType([CanBeNull] object foreignKeyProperties, [CanBeNull] object navigation, [CanBeNull] object entityType, [CanBeNull] object dependentEntityType) => string.Format( - GetString("SkipNavigationForeignKeyWrongDependentType", nameof(foreignKey), "1_navigation", "2_entityType", nameof(dependentEntityType)), - foreignKey, navigation, entityType, dependentEntityType); + GetString("SkipNavigationForeignKeyWrongDependentType", nameof(foreignKeyProperties), "1_navigation", "2_entityType", nameof(dependentEntityType)), + foreignKeyProperties, navigation, entityType, dependentEntityType); /// - /// The foreign key {foreignKey} cannot be used for the skip navigation property '{2_entityType}.{1_navigation}' because it is expected to be on the principal entity type '{principalEntityType}'. + /// The foreign key {foreignKeyProperties} cannot be used for the skip navigation '{2_entityType}.{1_navigation}' because it is expected to be on the principal entity type '{principalEntityType}'. /// - public static string SkipNavigationForeignKeyWrongPrincipalType([CanBeNull] object foreignKey, [CanBeNull] object navigation, [CanBeNull] object entityType, [CanBeNull] object principalEntityType) + public static string SkipNavigationForeignKeyWrongPrincipalType([CanBeNull] object foreignKeyProperties, [CanBeNull] object navigation, [CanBeNull] object entityType, [CanBeNull] object principalEntityType) => string.Format( - GetString("SkipNavigationForeignKeyWrongPrincipalType", nameof(foreignKey), "1_navigation", "2_entityType", nameof(principalEntityType)), - foreignKey, navigation, entityType, principalEntityType); + GetString("SkipNavigationForeignKeyWrongPrincipalType", nameof(foreignKeyProperties), "1_navigation", "2_entityType", nameof(principalEntityType)), + foreignKeyProperties, navigation, entityType, principalEntityType); /// /// The skip navigation '{skipNavigation}' cannot be removed because it is set as the inverse of the skip navigation '{inverseSkipNavigation}' on '{referencingEntityType}'. All referencing skip navigations must be removed before this skip navigation can be removed. @@ -2550,7 +2548,7 @@ public static string SkipNavigationWrongInverse([CanBeNull] object inverse, [Can inverse, inverseEntityType, navigation, targetEntityType); /// - /// The skip navigation property '{navigation}' cannot be removed from the entity type '{entityType}' because it is defined on the entity type '{otherEntityType}'. + /// The skip navigation '{navigation}' cannot be removed from the entity type '{entityType}' because it is defined on the entity type '{otherEntityType}'. /// public static string SkipNavigationWrongType([CanBeNull] object navigation, [CanBeNull] object entityType, [CanBeNull] object otherEntityType) => string.Format( @@ -2596,7 +2594,7 @@ public static string TransactionsNotSupported => GetString("TransactionsNotSupported"); /// - /// The LINQ expression '{expression}' could not be translated. Either rewrite the query in a form that can be translated, or switch to client evaluation explicitly by inserting a call to either AsEnumerable(), AsAsyncEnumerable(), ToList(), or ToListAsync(). See https://go.microsoft.com/fwlink/?linkid=2101038 for more information. + /// The LINQ expression '{expression}' could not be translated. Either rewrite the query in a form that can be translated, or switch to client evaluation explicitly by inserting a call to either 'AsEnumerable()', 'AsAsyncEnumerable()', 'ToList()', or 'ToListAsync()'. See https://go.microsoft.com/fwlink/?linkid=2101038 for more information. /// public static string TranslationFailed([CanBeNull] object expression) => string.Format( @@ -2604,7 +2602,7 @@ public static string TranslationFailed([CanBeNull] object expression) expression); /// - /// The LINQ expression '{expression}' could not be translated. Additional information: {details} Either rewrite the query in a form that can be translated, or switch to client evaluation explicitly by inserting a call to either AsEnumerable(), AsAsyncEnumerable(), ToList(), or ToListAsync(). See https://go.microsoft.com/fwlink/?linkid=2101038 for more information. + /// The LINQ expression '{expression}' could not be translated. Additional information: {details} Either rewrite the query in a form that can be translated, or switch to client evaluation explicitly by inserting a call to either 'AsEnumerable()', 'AsAsyncEnumerable()', 'ToList()', or 'ToListAsync()'. See https://go.microsoft.com/fwlink/?linkid=2101038 for more information. /// public static string TranslationFailedWithDetails([CanBeNull] object expression, [CanBeNull] object details) => string.Format( @@ -2628,7 +2626,7 @@ public static string UnableToDiscriminate([CanBeNull] object entityType, [CanBeN entityType, discriminator); /// - /// Unable to set IsUnique to '{isUnique}' on the relationship underlying the navigation property '{2_entityType}.{1_navigationName}' because the navigation property has the opposite multiplicity. + /// Unable to set IsUnique to '{isUnique}' on the relationship underlying the navigation '{2_entityType}.{1_navigationName}' because the navigation has the opposite multiplicity. /// public static string UnableToSetIsUnique([CanBeNull] object isUnique, [CanBeNull] object navigationName, [CanBeNull] object entityType) => string.Format( @@ -2676,7 +2674,7 @@ public static string UnknownKeyValue([CanBeNull] object entityType, [CanBeNull] entityType, property); /// - /// The unnamed index on the entity type '{entityType}' with properties {indexPropertyList} is invalid. The property '{propertyName}' has been marked NotMapped or Ignore(). An index cannot use such properties. + /// The unnamed index on the entity type '{entityType}' with properties {indexPropertyList} is invalid. The property '{propertyName}' was ignored by [NotMapped] attribute or 'Ignore()' in 'OnModelCreating'. An index cannot use such properties. /// public static string UnnamedIndexDefinedOnIgnoredProperty([CanBeNull] object entityType, [CanBeNull] object indexPropertyList, [CanBeNull] object propertyName) => string.Format( @@ -2756,7 +2754,7 @@ public static string WrongGenericPropertyType([CanBeNull] object property, [CanB property, entityType, actualType, genericType); /// - /// Cannot start tracking InternalEntityEntry for entity type '{entityType}' because it was created by a different StateManager instance. + /// Cannot start tracking the entry for entity type '{entityType}' because it was created by a different StateManager instance. /// public static string WrongStateManager([CanBeNull] object entityType) => string.Format( @@ -2790,7 +2788,7 @@ private static readonly ResourceManager _resourceManager = new ResourceManager("Microsoft.EntityFrameworkCore.Properties.CoreStrings", typeof(CoreResources).Assembly); /// - /// The foreign key {foreignKey} on entity type '{entityType}' should not be configured as required since the dependent side cannot be determined. To identify the dependent side of the relationship, configure the foreign key property or the principal key before configuring the foreign key as required. See http://go.microsoft.com/fwlink/?LinkId=724062 for more details. + /// The foreign key {foreignKeyProperties} on entity type '{entityType}' should not be configured as required since the dependent side cannot be determined. To identify the dependent side of the relationship, configure the foreign key property or the principal key before configuring the foreign key as required in 'OnModelCreating'. See http://go.microsoft.com/fwlink/?LinkId=724062 for more details. /// public static EventDefinition LogAmbiguousEndRequired([NotNull] IDiagnosticsLogger logger) { @@ -2910,7 +2908,7 @@ public static EventDefinition LogCa } /// - /// Detected {addedCount} entities added and {removedCount} entities removed from navigation property '{entityType}.{property}'. Consider using 'DbContextOptionsBuilder.EnableSensitiveDataLogging' to see key values. + /// Detected {addedCount} entities added and {removedCount} entities removed from navigation '{entityType}.{property}'. Consider using 'DbContextOptionsBuilder.EnableSensitiveDataLogging' to see key values. /// public static EventDefinition LogCollectionChangeDetected([NotNull] IDiagnosticsLogger logger) { @@ -2934,7 +2932,7 @@ public static EventDefinition LogCollectionChangeDetec } /// - /// Detected {addedCount} entities added and {removedCount} entities removed from navigation property '{entityType}.{property}' on entity with key '{keyValues}'. + /// Detected {addedCount} entities added and {removedCount} entities removed from navigation '{entityType}.{property}' on entity with key '{keyValues}'. /// public static EventDefinition LogCollectionChangeDetectedSensitive([NotNull] IDiagnosticsLogger logger) { @@ -3006,7 +3004,7 @@ public static EventDefinition LogConflictingFore } /// - /// Conflicting attributes have been applied: the 'Key' attribute on property '{property}' and the 'Keyless' attribute on its entity '{entity}'. Note that the entity will have no key unless you use fluent API to override this. + /// Conflicting attributes have been applied: the 'Key' attribute on property '{property}' and the 'Keyless' attribute on its entity '{entity}'. Note that the entity will have no key unless you configure one in 'OnModelCreating'. /// public static EventDefinition LogConflictingKeylessAndKeyAttributes([NotNull] IDiagnosticsLogger logger) { @@ -3102,7 +3100,7 @@ public static EventDefinition LogContextInitiali } /// - /// An attempt was made to lazy-load navigation property '{navigation}' on detached entity of type '{entityType}'. Lazy-loading is not supported for detached entities or entities that are loaded with 'AsNoTracking()'. + /// An attempt was made to lazy-load navigation '{navigation}' on detached entity of type '{entityType}'. Lazy-loading is not supported for detached entities or entities that are loaded with 'AsNoTracking()'. /// public static EventDefinition LogDetachedLazyLoading([NotNull] IDiagnosticsLogger logger) { @@ -3390,7 +3388,7 @@ public static EventDefinition LogForeign } /// - /// For the relationship between dependent '{dependentToPrincipalNavigationSpecification}' and principal '{principalToDependentNavigationSpecification}', the foreign key properties haven't been configured by convention because the best match {foreignKey} are incompatible with the current principal key {principalKey}. This message can be disregarded if explicit configuration has been specified. + /// For the relationship between dependent '{dependentToPrincipalNavigationSpecification}' and principal '{principalToDependentNavigationSpecification}', the foreign key properties haven't been configured by convention because the best match {foreignKeyProperties} are incompatible with the current principal key {principalKey}. This message can be disregarded if explicit configuration has been specified in 'OnModelCreating'. /// public static EventDefinition LogIncompatibleMatchingForeignKeyProperties([NotNull] IDiagnosticsLogger logger) { @@ -3438,7 +3436,7 @@ public static EventDefinition LogInvalidIncludePath([NotNull] ID } /// - /// An attempt was made to lazy-load navigation property '{1_entityType}.{0_navigation}' after the associated DbContext was disposed. + /// An attempt was made to lazy-load navigation '{1_entityType}.{0_navigation}' after the associated DbContext was disposed. /// public static EventDefinition LogLazyLoadOnDisposedContext([NotNull] IDiagnosticsLogger logger) { @@ -3510,7 +3508,7 @@ public static EventDefinition LogMultipleInversePropertiesSameTa } /// - /// No relationship from '{firstEntityType}' to '{secondEntityType}' has been configured by convention because there are multiple properties on one entity type {navigationProperties} that could be matched with the properties on the other entity type {inverseNavigations}. This message can be disregarded if explicit configuration has been specified. + /// No relationship from '{firstEntityType}' to '{secondEntityType}' has been configured by convention because there are multiple properties on one entity type {navigationProperties} that could be matched with the properties on the other entity type {inverseNavigations}. This message can be disregarded if explicit configuration has been specified in 'OnModelCreating'. /// public static EventDefinition LogMultipleNavigationProperties([NotNull] IDiagnosticsLogger logger) { @@ -3534,7 +3532,7 @@ public static EventDefinition LogMultipleNavigat } /// - /// Primary key hasn't been configured by convention as both properties '{firstProperty}' and '{secondProperty}' could be used as the primary key for the entity type '{entityType}'. This message can be disregarded if explicit configuration has been specified. + /// Primary key hasn't been configured by convention as both properties '{firstProperty}' and '{secondProperty}' could be used as the primary key for the entity type '{entityType}'. This message can be disregarded if explicit configuration has been specified in 'OnModelCreating'. /// public static EventDefinition LogMultiplePrimaryKeyCandidates([NotNull] IDiagnosticsLogger logger) { @@ -3582,7 +3580,7 @@ public static EventDefinition LogNavigationBaseIncluded([NotNull] IDiagn } /// - /// Navigation property '{1_entityType}.{0_navigation}' is being lazy-loaded. + /// The navigation '{1_entityType}.{0_navigation}' is being lazy-loaded. /// public static EventDefinition LogNavigationLazyLoading([NotNull] IDiagnosticsLogger logger) { @@ -3630,7 +3628,7 @@ public static EventDefinition LogNonDefi } /// - /// The navigation property '{navigation}' is non-nullable, causing the entity type '{entityType}' to be configured as the dependent side in the corresponding relationship. + /// The navigation '{navigation}' is non-nullable, causing the entity type '{entityType}' to be configured as the dependent side in the corresponding relationship. /// [Obsolete] public static EventDefinition LogNonNullableInverted([NotNull] IDiagnosticsLogger logger) @@ -3993,7 +3991,7 @@ public static EventDefinition LogRedundantIndexRemoved([ } /// - /// Navigation property '{entityType}.{property}' detected as changed. Consider using 'DbContextOptionsBuilder.EnableSensitiveDataLogging' to see key values. + /// The navigation '{entityType}.{property}' detected as changed. Consider using 'DbContextOptionsBuilder.EnableSensitiveDataLogging' to see key values. /// public static EventDefinition LogReferenceChangeDetected([NotNull] IDiagnosticsLogger logger) { @@ -4017,7 +4015,7 @@ public static EventDefinition LogReferenceChangeDetected([NotNul } /// - /// Navigation property '{entityType}.{property}' for entity with key '{keyValues}' detected as changed. + /// The navigation '{entityType}.{property}' for entity with key '{keyValues}' detected as changed. /// public static EventDefinition LogReferenceChangeDetectedSensitive([NotNull] IDiagnosticsLogger logger) { @@ -4041,7 +4039,7 @@ public static EventDefinition LogReferenceChangeDetected } /// - /// The navigation property '{navigation}' has a [Required] attribute causing the entity type '{entityType}' to be configured as the dependent side in the corresponding relationship. + /// The navigation '{navigation}' has a [Required] attribute causing the entity type '{entityType}' to be configured as the dependent side in the corresponding relationship. /// [Obsolete] public static EventDefinition LogRequiredAttributeInverted([NotNull] IDiagnosticsLogger logger) @@ -4115,7 +4113,7 @@ public static EventDefinition LogRequiredAttributeOnCollection([ } /// - /// The [Required] attribute on '{principalEntityType}.{principalNavigation}' is invalid. [Required] attribute should only be specified on the navigation pointing to the principal side of the relationship. To change the dependent side configure the foreign key properties. + /// The [Required] attribute on '{principalEntityType}.{principalNavigation}' is invalid. [Required] attribute should only be specified on the navigation pointing to the principal side of the relationship. To change the dependent side configure the foreign key properties using [ForeignKey] attribute or in 'OnModelCreating'. /// [Obsolete] public static EventDefinition LogRequiredAttributeOnDependent([NotNull] IDiagnosticsLogger logger) @@ -4140,7 +4138,7 @@ public static EventDefinition LogRequiredAttributeOnDependent([N } /// - /// The [Required] attribute on '{principalEntityType}.{principalNavigation}' was ignored because it is a skip navigation. Instead configure the underlying foreign keys. + /// The [Required] attribute on '{principalEntityType}.{principalNavigation}' was ignored because it is a skip navigation. Instead configure the underlying foreign keys in 'OnModelCreating'. /// public static EventDefinition LogRequiredAttributeOnSkipNavigation([NotNull] IDiagnosticsLogger logger) { @@ -4332,7 +4330,7 @@ public static EventDefinition LogShadowPropertyCreated([NotNull] } /// - /// Detected {addedCount} entities added and {removedCount} entities removed from skip navigation property '{entityType}.{property}'. Consider using 'DbContextOptionsBuilder.EnableSensitiveDataLogging' to see key values. + /// Detected {addedCount} entities added and {removedCount} entities removed from skip navigation '{entityType}.{property}'. Consider using 'DbContextOptionsBuilder.EnableSensitiveDataLogging' to see key values. /// public static EventDefinition LogSkipCollectionChangeDetected([NotNull] IDiagnosticsLogger logger) { @@ -4356,7 +4354,7 @@ public static EventDefinition LogSkipCollectionChangeD } /// - /// Detected {addedCount} entities added and {removedCount} entities removed from skip navigation property '{entityType}.{property}' on entity with key '{keyValues}'. + /// Detected {addedCount} entities added and {removedCount} entities removed from skip navigation '{entityType}.{property}' on entity with key '{keyValues}'. /// public static EventDefinition LogSkipCollectionChangeDetectedSensitive([NotNull] IDiagnosticsLogger logger) { diff --git a/src/EFCore/Properties/CoreStrings.resx b/src/EFCore/Properties/CoreStrings.resx index 576f6b0b83b..dac2fac2158 100644 --- a/src/EFCore/Properties/CoreStrings.resx +++ b/src/EFCore/Properties/CoreStrings.resx @@ -127,16 +127,16 @@ The entity type '{entityType}' has a defining navigation and the supplied entity is currently referenced from several owner entities. To access the entry for a particular reference call '{targetEntryCall}' on the owner entry. - The foreign key {foreignKey} on entity type '{entityType}' cannot be configured as having a required dependent since the dependent side cannot be determined. To identify the dependent side of the relationship, configure the foreign key property. See http://go.microsoft.com/fwlink/?LinkId=724062 for more details. + The foreign key {foreignKeyProperties} on entity type '{entityType}' cannot be configured as having a required dependent since the dependent side cannot be determined. To identify the dependent side of the relationship, configure the foreign key property in 'OnModelCreating'. See http://go.microsoft.com/fwlink/?LinkId=724062 for more details. - The navigation '{entityType}.{navigation}' cannot be configured as required since the dependent side of the underlying foreign key {foreignKey} cannot be determined. To identify the dependent side of the relationship, configure the foreign key property. See http://go.microsoft.com/fwlink/?LinkId=724062 for more details. + The navigation '{entityType}.{navigation}' cannot be configured as required since the dependent side of the underlying foreign key {foreignKeyProperties} cannot be determined. To identify the dependent side of the relationship, configure the foreign key property in 'OnModelCreating'. See http://go.microsoft.com/fwlink/?LinkId=724062 for more details. - The foreign key {foreignKey} on entity type '{entityType}' cannot be flipped to entity type '{principalEntityType}' since it was configured as required before the dependent side was configured. Configure the foreign key property or the principal key before configuring the foreign key as required. See http://go.microsoft.com/fwlink/?LinkId=724062 for more details. + The foreign key {foreignKeyProperties} on entity type '{entityType}' cannot be flipped to entity type '{principalEntityType}' since it was configured as required before the dependent side was configured. Configure the foreign key property or the principal key before configuring the foreign key as required. See http://go.microsoft.com/fwlink/?LinkId=724062 for more details. - Both relationships between '{firstDependentToPrincipalNavigationSpecification}' and '{firstPrincipalToDependentNavigationSpecification}' and between '{secondDependentToPrincipalNavigationSpecification}' and '{secondPrincipalToDependentNavigationSpecification}' could use {foreignKeyProperties} as the foreign key. To resolve this configure the foreign key properties explicitly on at least one of the relationships. + Both relationships between '{firstDependentToPrincipalNavigationSpecification}' and '{firstPrincipalToDependentNavigationSpecification}' and between '{secondDependentToPrincipalNavigationSpecification}' and '{secondPrincipalToDependentNavigationSpecification}' could use {foreignKeyProperties} as the foreign key. To resolve this configure the foreign key properties explicitly in 'OnModelCreating' on at least one of the relationships. The dependent side could not be determined for the one-to-one relationship between '{dependentToPrincipalNavigationSpecification}' and '{principalToDependentNavigationSpecification}'. To identify the dependent side of the relationship, configure the foreign key property. If these navigations should not be part of the same relationship configure them independently via separate method chains in 'OnModelCreating'. See http://go.microsoft.com/fwlink/?LinkId=724062 for more details. @@ -148,7 +148,7 @@ The service property '{property}' of type '{serviceType}' cannot be added to the entity type '{entityType}' because there is another property of the same type. Ignore one of the properties using the [NotMapped] attribute or 'EntityTypeBuilder.Ignore' in 'OnModelCreating'. - The annotation '{annotation}' was not found. Ensure that the annotation has been added. + The annotation '{annotation}' was not found. Ensure that the annotation has been added to the object {annotatable} The property '{property}' of the argument '{argument}' cannot be null. @@ -163,7 +163,7 @@ The service dependencies type '{dependenciesType}' has been registered incorrectly in the service collection. Service dependencies types must only be registered by Entity Framework or database providers. - The filter expression '{filter}' cannot be specified for entity type '{entityType}'. A filter may only be applied to the root entity type in a hierarchy. + The filter expression '{filter}' cannot be specified for entity type '{entityType}'. A filter may only be applied to the root entity type '{rootType}'. The filter expression '{filter}' specified for entity type '{entityType}' is invalid. The expression must accept a single parameter of type '{clrType}' and return bool. @@ -214,7 +214,7 @@ The shared-type entity type '{entityType}' cannot be added because the model already contains an entity type with the same name but a different CLR type '{otherClrType}'. Ensure all entity type names are unique. - There is already an entity type named '{ownedTypeName}'. Use a different name when configuring the ownership '{ownerEntityType}.{navigation}'. + There is already an entity type named '{ownedTypeName}'. Use a different name when configuring the ownership '{ownerEntityType}.{navigation}' in 'OnModelCreating'. The type '{entityType}' cannot be marked as owned because the derived entity type - '{derivedType}' has been configured as non-owned. @@ -223,7 +223,7 @@ The type '{entityType}' cannot be marked as owned because a non-owned entity type with the same name already exists. - The shared type entity type '{entityType}' with clr type '{type}' cannot be added to the model because a non shared entity type with the same clr type already exists. + The shared type entity type '{entityType}' with clr type '{type}' cannot be added to the model because a non shared entity type with the same CLR type already exists. The weak entity type '{entityType}' cannot be added to the model because an entity type with the same name already exists. @@ -250,7 +250,7 @@ The property '{property}' cannot exist on type '{entityType}' because the type is marked as shadow state while the property is not. Shadow state types can only contain shadow state properties. - The property '{1_entityType}.{0_property}' is being accessed using the '{CollectionMethod}' method, but is defined in the model as a non-collection, reference navigation property. Use the '{ReferenceMethod}' method to access reference navigation properties. + The property '{1_entityType}.{0_property}' is being accessed using the '{CollectionMethod}' method, but is defined in the model as a non-collection, reference navigation. Use the '{ReferenceMethod}' method to access reference navigation properties. Comparer for type '{type}' cannot be used for '{entityType}.{propertyName}' because its type is '{propertyType}'. @@ -259,13 +259,13 @@ There are multiple properties pointing to navigation '{1_entityType}.{0_navigation}'. To define composite foreign key using data annotations, use [ForeignKey] attribute on navigation. - Entity type '{entityType}' has composite primary key defined with data annotations. To set composite primary key, use fluent API. + Entity type '{entityType}' has composite primary key defined with data annotations. Composite primary keys can only be set in 'OnModelCreating'. A second operation started on this context before a previous operation completed. This is usually caused by different threads using the same instance of DbContext. For more information on how to avoid threading issues with DbContext, see https://go.microsoft.com/fwlink/?linkid=2097913. - Property '{1_entityType}.{0_property}' matches both '{field1}' and '{field2}' by convention. Explicitly specify the backing field to use with '.HasField()' in 'OnModelCreating()'. + Property '{1_entityType}.{0_property}' matches both '{field1}' and '{field2}' by convention. Explicitly specify the backing field to use with '.HasField()' in 'OnModelCreating'. There are multiple [ForeignKey] attributes which are pointing to same set of properties - '{propertyList}' on entity type '{entityType}'. @@ -274,7 +274,7 @@ The property or navigation '{member}' cannot be added to the entity type '{entityType}' because a property or navigation with the same name already exists on entity type '{conflictingEntityType}'. - Cannot create a relationship between '{newPrincipalNavigationSpecification}' and '{newDependentNavigationSpecification}', because there already is a relationship between '{existingPrincipalNavigationSpecification}' and '{existingDependentNavigationSpecification}'. Navigation properties can only participate in a single relationship. If you want to override an existing relationship call Ignore on the navigation '{newDependentNavigationSpecification}' first. + Cannot create a relationship between '{newPrincipalNavigationSpecification}' and '{newDependentNavigationSpecification}', because there already is a relationship between '{existingPrincipalNavigationSpecification}' and '{existingDependentNavigationSpecification}'. Navigation properties can only participate in a single relationship. If you want to override an existing relationship call Ignore on the navigation '{newDependentNavigationSpecification}' first in 'OnModelCreating'. cannot bind '{failedBinds}' in '{parameters}' @@ -322,13 +322,13 @@ Unable to set a base type for entity type '{entityType}' because it has been configured as having no keys. - Unable to set a base type for entity type '{entityType}' because it has one or more keys defined. + Unable to set a base type for entity type '{entityType}' because it has one or more keys defined. Only root types can have keys. - A '{derivedType}' cannot be configured as keyless because it is a derived type. The root type '{rootType}' must be configured as keyless. If you did not intend for '{rootType}' to be included in the model, ensure that it is not included in a DbSet property on your context, referenced in a configuration call to ModelBuilder, or referenced from a navigation property on a type that is included in the model. + A '{derivedType}' cannot be configured as keyless because it is a derived type. The root type '{rootType}' must be configured as keyless. If you did not intend for '{rootType}' to be included in the model, ensure that it is not included in a DbSet property on your context, referenced in a configuration call to ModelBuilder in 'OnModelCreating', or referenced from a navigation on a type that is included in the model. - A key cannot be configured on '{derivedType}' because it is a derived type. The key must be configured on the root type '{rootType}'. If you did not intend for '{rootType}' to be included in the model, ensure that it is not included in a DbSet property on your context, referenced in a configuration call to ModelBuilder, or referenced from a navigation property on a type that is included in the model. + A key cannot be configured on '{derivedType}' because it is a derived type. The key must be configured on the root type '{rootType}'. If you did not intend for '{rootType}' to be included in the model, ensure that it is not included in a DbSet property on your context, referenced in a configuration call to ModelBuilder, or referenced from a navigation on a type that is included in the model. The entity type '{entityType}' cannot have a defining query because it is derived from '{baseType}'. Only base entity types can have a defining query. @@ -355,13 +355,13 @@ The entity type '{entityType}' cannot be added to the model because an entity type with the same name already exists. - The foreign key {foreignKey} cannot be added to the entity type '{entityType}' because a foreign key on the same properties already exists on entity type '{duplicateEntityType}' and also targets the key {key} on '{principalType}'. + The foreign key {foreignKeyProperties} cannot be added to the entity type '{entityType}' because a foreign key on the same properties already exists on entity type '{duplicateEntityType}' and also targets the key {keyProperties} on '{principalType}'. The index {indexProperties} cannot be added to the entity type '{entityType}' because an index on the same properties already exists on entity type '{duplicateEntityType}'. - The key {key} cannot be added to the entity type '{entityType}' because a key on the same properties already exists on entity type '{duplicateEntityType}'. + The key {keyProperties} cannot be added to the entity type '{entityType}' because a key on the same properties already exists on entity type '{duplicateEntityType}'. The index named '{indexName}' defined on properties {indexProperties} cannot be added to the entity type '{entityType}' because an index with the same name already exists on entity type '{duplicateEntityType}'. @@ -385,13 +385,13 @@ This query would cause multiple evaluation of a subquery because entity '{entityType}' has a composite key. Rewrite your query avoiding the subquery. - The entity type '{entityType}' requires a primary key to be defined. If you intended to use a keyless entity type call 'HasNoKey()'. + The entity type '{entityType}' requires a primary key to be defined. If you intended to use a keyless entity type call 'HasNoKey()' in 'OnModelCreating'. The entity type '{entityType}' cannot be removed because '{derivedEntityType}' is derived from it. All derived entity types must be removed or redefined before the entity type can be removed. - The entity type '{entityType}' cannot be removed because it is being referenced by foreign key {foreignKey} on '{referencingEntityType}'. All referencing foreign keys must be removed or redefined before the entity type can be removed. + The entity type '{entityType}' cannot be removed because it is being referenced by foreign key {foreignKeyProperties} on '{referencingEntityType}'. All referencing foreign keys must be removed or redefined before the entity type can be removed. The entity type '{entityType}' cannot be removed because it is being referenced by the skip navigation '{skipNavigation}' on '{referencingEntityType}'. All referencing skip navigations must be removed before the entity type can be removed. @@ -436,7 +436,7 @@ The configured execution strategy '{strategy}' does not support user initiated transactions. Use the execution strategy returned by '{getExecutionStrategyMethod}' to execute all the operations in the transaction as a retriable unit. - An exception was thrown while attempting to evaluate a LINQ query parameter expression. To show additional information call EnableSensitiveDataLogging() when overriding DbContext.OnConfiguring. + An exception was thrown while attempting to evaluate a LINQ query parameter expression. To show additional information call 'EnableSensitiveDataLogging()' when overriding 'DbContext.OnConfiguring'. An exception was thrown while attempting to evaluate the LINQ query parameter expression '{expression}'. @@ -460,16 +460,16 @@ The [ForeignKey] attributes on property '{property}' and navigation '{navigation}' in entity type '{entityType}' do not point at each other. The value of [ForeignKey] attribute on property should be navigation name and the value of [ForeignKey] attribute on navigation should be the foreign key property name. - The number of properties specified for the foreign key {foreignKey} on entity type '{dependentType}' does not match the number of properties in the principal key {principalKey} on entity type '{principalType}'. + The number of properties specified for the foreign key {foreignKeyProperties} on entity type '{dependentType}' does not match the number of properties in the principal key {principalKey} on entity type '{principalType}'. Cannot remove foreign key {foreigKey} from entity type '{entityType}' because it is referenced by a skip navigation '{navigation}' on entity type '{navigationEntityType}'. All referencing skip navigation must be removed before the referenced foreign key can be removed. - The specified foreign key properties {foreignKey} are not declared on the entity type '{entityType}'. Ensure foreign key properties are declared on the target entity type. + The specified foreign key properties {foreignKeyProperties} are not declared on the entity type '{entityType}'. Ensure foreign key properties are declared on the target entity type. - The property '{property}' cannot be part of a foreign key on '{entityType}' because it has value generation enabled and is contained in the key {key} defined on a base entity type '{baseEntityType}'. + The property '{property}' cannot be part of a foreign key on '{entityType}' because it has value generation enabled and is contained in the key {keyProperties} defined on a base entity type '{baseEntityType}'. The provided principal entity key '{principalKey}' is not a key on the entity type '{principalEntityType}'. @@ -478,10 +478,10 @@ The foreign keys on entity type '{dependentType}' cannot target the same entity type because it is a weak entity type. - The types of the properties specified for the foreign key {foreignKey} on entity type '{dependentType}' do not match the types of the properties in the principal key {principalKey} on entity type '{principalType}'. + The types of the properties specified for the foreign key {foreignKeyProperties} on entity type '{dependentType}' do not match the types of the properties in the principal key {principalKey} on entity type '{principalType}'. - The foreign key {foreignKey} targeting the key {key} on '{principalType}' cannot be removed from the entity type '{entityType}' because it is defined on the entity type '{otherEntityType}'. + The foreign key {foreignKeyProperties} targeting the key {keyProperties} on '{principalType}' cannot be removed from the entity type '{entityType}' because it is defined on the entity type '{otherEntityType}'. The entity type '{entityType}' is configured to use the '{changeTrackingStrategy}' change tracking strategy when full change tracking notifications are required. Use 'ModelBuilder.HasChangeTrackingStrategy' in 'OnModelCreating' to configure all entity types in the model to use the '{fullStrategy}' or '{fullPlusStrategy}' strategy. @@ -530,7 +530,7 @@ The entity type '{entityType}' should derive from '{baseEntityType}' to reflect the hierarchy of the corresponding CLR types. - The entity type '{ownedEntityType}' is configured as owned, but the entity type '{nonOwnedEntityType}' is not. All entity types sharing a CLR type must be configured as owned. + The entity type '{ownedEntityType}' is configured as owned, but the entity type '{nonOwnedEntityType}' is not. All entity types sharing a CLR type must be configured as owned in 'OnModelCreating'. The specified index properties {index} are not declared on the entity type '{entityType}'. Ensure index properties are declared on the target entity type. @@ -539,19 +539,19 @@ The index {indexProperties} cannot be removed from the entity type '{entityType}' because it is defined on the entity type '{otherEntityType}'. - The property '{property}' cannot be ignored on entity type '{entityType}', because it's declared on the base entity type '{baseEntityType}'. To exclude this property from your model, use [NotMapped] attribute or Ignore method on the base type. + The property '{property}' cannot be ignored on entity type '{entityType}', because it's declared on the base entity type '{baseEntityType}'. To exclude this property from your model, use [NotMapped] attribute or 'EntityTypeBuilder.Ignore' on the base type in 'OnModelCreating'. - The property '{entityType}.{navigation}' is of an interface type ('{propertyType}'). If it is a navigation property manually configure the relationship for this property by casting it to a mapped entity type, otherwise ignore the property using the [NotMapped] attribute or 'EntityTypeBuilder.Ignore' in 'OnModelCreating'. + The property '{entityType}.{navigation}' is of an interface type ('{propertyType}'). If it is a navigation manually configure the relationship for this property by casting it to a mapped entity type, otherwise ignore the property using the [NotMapped] attribute or 'EntityTypeBuilder.Ignore' in 'OnModelCreating'. - The entity type related to '{entityType}' cannot be determined because the specified foreign key {foreignKey} references entity type '{principalEntityType}' that it is in the same hierarchy as the entity type that it is declared on '{dependentEntityType}'. + The entity type related to '{entityType}' cannot be determined because the specified foreign key {foreignKeyProperties} references entity type '{principalEntityType}' that it is in the same hierarchy as the entity type that it is declared on '{dependentEntityType}'. Unable to track an entity of type '{entityType}' because alternate key property '{keyProperty}' is null. If the alternate key is not used in a relationship, then consider using a unique index instead. Unique indexes may contain nulls, while alternate keys must not. - The specified type '{type}'must be a non-interface reference type to be used as an entity type. + The specified type '{type}' must be a non-interface reference type to be used as an entity type. The value provided for argument '{argumentName}' must be a valid value of enum type '{enumType}'. @@ -563,7 +563,7 @@ Unable to track an entity of type '{entityType}' because primary key property '{keyProperty}' is null. - Lambda expression used inside Include is not valid. + Lambda expression used inside 'Include' is not valid. The expression '{expression}' is not a valid member access expression. The expression should represent a simple property or field access: 't => t.MyProperty'. @@ -575,7 +575,7 @@ The expression '{expression}' is not a valid members access expression. The expression should represent a simple property or field access: 't => t.MyProperty'. When specifying multiple properties or fields use an anonymous type: 't => new {{ t.MyProperty, t.MyField }}'. - The [InverseProperty] attribute on property '{1_entityType}.{0_property}' is not valid. The property '{referencedProperty}' is not a valid navigation property on the related type '{referencedEntityType}'. Ensure that the property exists and is a valid reference or collection navigation property. + The [InverseProperty] attribute on property '{1_entityType}.{0_property}' is not valid. The property '{referencedProperty}' is not a valid navigation on the related type '{referencedEntityType}'. Ensure that the property exists and is a valid reference or collection navigation. The specified poolSize must be greater than 0. @@ -619,7 +619,7 @@ The value for property '{1_entityType}.{0_property}' cannot be set to a value of type '{valueType}' because its type is '{propertyType}'. - Invalid type conversion when specifying include. + Invalid type conversion specified in 'Include' call. A call was made to '{useService}', but Entity Framework is not building its own internal service provider. Either allow EF to build the service provider by removing the call to '{useInternalServiceProvider}', or build the '{service}' services to use into the service provider before passing it to '{useInternalServiceProvider}'. @@ -643,7 +643,7 @@ The derived type '{derivedType}' cannot have [Key] attribute on property '{property}' since primary key can only be declared on the root type. - Cannot remove key {key} from entity type '{entityType}' because it is referenced by a foreign key {foreignKey} in entity type '{dependentType}'. All foreign keys must be removed or redefined before the referenced key can be removed. + Cannot remove key {keyProperties} from entity type '{entityType}' because it is referenced by a foreign key {foreignKeyProperties} in entity type '{dependentType}'. All foreign keys must be removed or redefined before the referenced key can be removed. The entity type '{entityType}' cannot be marked as keyless because it contains a key. @@ -652,13 +652,13 @@ Unable to track an instance of type '{type}' because it does not have a primary key. Only entity types with primary keys may be tracked. - The key {key} cannot be added to keyless type '{entityType}'. + The key {keyProperties} cannot be added to keyless type '{entityType}'. - The specified key properties {key} are not declared on the entity type '{entityType}'. Ensure key properties are declared on the target entity type. + The specified key properties {keyProperties} are not declared on the entity type '{entityType}'. Ensure key properties are declared on the target entity type. - The property '{1_entityType}.{0_property}' cannot be marked as nullable/optional because it has been included in a key {key}. + The property '{1_entityType}.{0_property}' cannot be marked as nullable/optional because it has been included in a key {keyProperties}. The property '{1_entityType}.{0_property}' cannot be part of a key because it has value generation enabled and is contained in a foreign key defined on a derived entity type. @@ -670,13 +670,13 @@ The property '{1_entityType}.{0_property}' is part of a key and so cannot be modified or marked as modified. To change the principal of an existing entity with an identifying foreign key first delete the dependent and invoke 'SaveChanges' then associate the dependent with the new principal. - The key {key} cannot be removed from the entity type '{entityType}' because it is defined on the entity type '{otherEntityType}'. + The key {keyProperties} cannot be removed from the entity type '{entityType}' because it is defined on the entity type '{otherEntityType}'. The type mapping for '{type}' has not implemented code literal generation. - The foreign key {foreignKey} on entity type '{entityType}' should not be configured as required since the dependent side cannot be determined. To identify the dependent side of the relationship, configure the foreign key property or the principal key before configuring the foreign key as required. See http://go.microsoft.com/fwlink/?LinkId=724062 for more details. + The foreign key {foreignKeyProperties} on entity type '{entityType}' should not be configured as required since the dependent side cannot be determined. To identify the dependent side of the relationship, configure the foreign key property or the principal key before configuring the foreign key as required in 'OnModelCreating'. See http://go.microsoft.com/fwlink/?LinkId=724062 for more details. Warning CoreEventId.AmbiguousEndRequiredWarning string string @@ -696,11 +696,11 @@ Debug CoreEventId.CascadeDelete string string EntityState string string - Detected {addedCount} entities added and {removedCount} entities removed from navigation property '{entityType}.{property}'. Consider using 'DbContextOptionsBuilder.EnableSensitiveDataLogging' to see key values. + Detected {addedCount} entities added and {removedCount} entities removed from navigation '{entityType}.{property}'. Consider using 'DbContextOptionsBuilder.EnableSensitiveDataLogging' to see key values. Debug CoreEventId.CollectionChangeDetected int int string string - Detected {addedCount} entities added and {removedCount} entities removed from navigation property '{entityType}.{property}' on entity with key '{keyValues}'. + Detected {addedCount} entities added and {removedCount} entities removed from navigation '{entityType}.{property}' on entity with key '{keyValues}'. Debug CoreEventId.CollectionChangeDetected int int string string string @@ -712,7 +712,7 @@ Warning CoreEventId.ConflictingForeignKeyAttributesOnNavigationAndPropertyWarning string string string string - Conflicting attributes have been applied: the 'Key' attribute on property '{property}' and the 'Keyless' attribute on its entity '{entity}'. Note that the entity will have no key unless you use fluent API to override this. + Conflicting attributes have been applied: the 'Key' attribute on property '{property}' and the 'Keyless' attribute on its entity '{entity}'. Note that the entity will have no key unless you configure one in 'OnModelCreating'. Warning CoreEventId.ConflictingKeylessAndKeyAttributesWarning string string @@ -728,7 +728,7 @@ Information CoreEventId.ContextInitialized string string string string - An attempt was made to lazy-load navigation property '{navigation}' on detached entity of type '{entityType}'. Lazy-loading is not supported for detached entities or entities that are loaded with 'AsNoTracking()'. + An attempt was made to lazy-load navigation '{navigation}' on detached entity of type '{entityType}'. Lazy-loading is not supported for detached entities or entities that are loaded with 'AsNoTracking()'. Warning CoreEventId.DetachedLazyLoadingWarning string string @@ -776,7 +776,7 @@ Debug CoreEventId.ForeignKeyChangeDetected string string object object string - For the relationship between dependent '{dependentToPrincipalNavigationSpecification}' and principal '{principalToDependentNavigationSpecification}', the foreign key properties haven't been configured by convention because the best match {foreignKey} are incompatible with the current principal key {principalKey}. This message can be disregarded if explicit configuration has been specified. + For the relationship between dependent '{dependentToPrincipalNavigationSpecification}' and principal '{principalToDependentNavigationSpecification}', the foreign key properties haven't been configured by convention because the best match {foreignKeyProperties} are incompatible with the current principal key {principalKey}. This message can be disregarded if explicit configuration has been specified in 'OnModelCreating'. Debug CoreEventId.IncompatibleMatchingForeignKeyProperties string string string string @@ -784,7 +784,7 @@ Error CoreEventId.InvalidIncludePathError object object - An attempt was made to lazy-load navigation property '{1_entityType}.{0_navigation}' after the associated DbContext was disposed. + An attempt was made to lazy-load navigation '{1_entityType}.{0_navigation}' after the associated DbContext was disposed. Warning CoreEventId.LazyLoadOnDisposedContextWarning string string @@ -796,11 +796,11 @@ Warning CoreEventId.MultipleInversePropertiesSameTargetWarning string string - No relationship from '{firstEntityType}' to '{secondEntityType}' has been configured by convention because there are multiple properties on one entity type {navigationProperties} that could be matched with the properties on the other entity type {inverseNavigations}. This message can be disregarded if explicit configuration has been specified. + No relationship from '{firstEntityType}' to '{secondEntityType}' has been configured by convention because there are multiple properties on one entity type {navigationProperties} that could be matched with the properties on the other entity type {inverseNavigations}. This message can be disregarded if explicit configuration has been specified in 'OnModelCreating'. Debug CoreEventId.MultipleNavigationProperties string string string string - Primary key hasn't been configured by convention as both properties '{firstProperty}' and '{secondProperty}' could be used as the primary key for the entity type '{entityType}'. This message can be disregarded if explicit configuration has been specified. + Primary key hasn't been configured by convention as both properties '{firstProperty}' and '{secondProperty}' could be used as the primary key for the entity type '{entityType}'. This message can be disregarded if explicit configuration has been specified in 'OnModelCreating'. Debug CoreEventId.MultiplePrimaryKeyCandidates string string string @@ -808,7 +808,7 @@ Debug CoreEventId.NavigationBaseIncluded string - Navigation property '{1_entityType}.{0_navigation}' is being lazy-loaded. + The navigation '{1_entityType}.{0_navigation}' is being lazy-loaded. Debug CoreEventId.NavigationLazyLoading string string @@ -816,7 +816,7 @@ Warning CoreEventId.NonDefiningInverseNavigationWarning string string string string string - The navigation property '{navigation}' is non-nullable, causing the entity type '{entityType}' to be configured as the dependent side in the corresponding relationship. + The navigation '{navigation}' is non-nullable, causing the entity type '{entityType}' to be configured as the dependent side in the corresponding relationship. Obsolete Debug CoreEventId.NonNullableInverted string string @@ -876,15 +876,15 @@ Debug CoreEventId.RedundantIndexRemoved string string string - Navigation property '{entityType}.{property}' detected as changed. Consider using 'DbContextOptionsBuilder.EnableSensitiveDataLogging' to see key values. + The navigation '{entityType}.{property}' detected as changed. Consider using 'DbContextOptionsBuilder.EnableSensitiveDataLogging' to see key values. Debug CoreEventId.ReferenceChangeDetected string string - Navigation property '{entityType}.{property}' for entity with key '{keyValues}' detected as changed. + The navigation '{entityType}.{property}' for entity with key '{keyValues}' detected as changed. Debug CoreEventId.ReferenceChangeDetected string string string - The navigation property '{navigation}' has a [Required] attribute causing the entity type '{entityType}' to be configured as the dependent side in the corresponding relationship. + The navigation '{navigation}' has a [Required] attribute causing the entity type '{entityType}' to be configured as the dependent side in the corresponding relationship. Obsolete Debug CoreEventId.RequiredAttributeInverted string string @@ -896,11 +896,11 @@ Debug CoreEventId.RequiredAttributeOnCollection string string - The [Required] attribute on '{principalEntityType}.{principalNavigation}' is invalid. [Required] attribute should only be specified on the navigation pointing to the principal side of the relationship. To change the dependent side configure the foreign key properties. + The [Required] attribute on '{principalEntityType}.{principalNavigation}' is invalid. [Required] attribute should only be specified on the navigation pointing to the principal side of the relationship. To change the dependent side configure the foreign key properties using [ForeignKey] attribute or in 'OnModelCreating'. Obsolete Error CoreEventId.RequiredAttributeOnDependent string string - The [Required] attribute on '{principalEntityType}.{principalNavigation}' was ignored because it is a skip navigation. Instead configure the underlying foreign keys. + The [Required] attribute on '{principalEntityType}.{principalNavigation}' was ignored because it is a skip navigation. Instead configure the underlying foreign keys in 'OnModelCreating'. Debug CoreEventId.RequiredAttributeOnSkipNavigation string string @@ -932,11 +932,11 @@ Debug CoreEventId.ShadowPropertyCreated string string - Detected {addedCount} entities added and {removedCount} entities removed from skip navigation property '{entityType}.{property}'. Consider using 'DbContextOptionsBuilder.EnableSensitiveDataLogging' to see key values. + Detected {addedCount} entities added and {removedCount} entities removed from skip navigation '{entityType}.{property}'. Consider using 'DbContextOptionsBuilder.EnableSensitiveDataLogging' to see key values. Debug CoreEventId.SkipCollectionChangeDetected int int string string - Detected {addedCount} entities added and {removedCount} entities removed from skip navigation property '{entityType}.{property}' on entity with key '{keyValues}'. + Detected {addedCount} entities added and {removedCount} entities removed from skip navigation '{entityType}.{property}' on entity with key '{keyValues}'. Debug CoreEventId.SkipCollectionChangeDetected int int string string string @@ -975,7 +975,7 @@ The specified field '{field}' could not be found for property '{2_entityType}.{1_property}'. - Unable to set up a many-to-many relationship between the entity types '{principalEntityType}' and '{declaringEntityType}' because one of the navigations was not specified. Please provide a navigation property in the HasMany() call. + Unable to set up a many-to-many relationship between the entity types '{principalEntityType}' and '{declaringEntityType}' because one of the navigations was not specified. Please provide a navigation in the 'HasMany()' call in 'OnModelCreating'. The model must be finalized before '{method}' can be used. Ensure that either 'OnModelCreating' has completed or, if using a stand-alone 'ModelBuilder', that 'FinalizeModel' has been called. @@ -1008,46 +1008,46 @@ The index with name {indexName} cannot be removed from the entity type '{entityType}' because no such index exists on that entity type. - The type of navigation property '{1_entityType}.{0_navigation}' is '{foundType}' which is an array type. Collection navigation properties cannot be arrays. + The type of navigation '{1_entityType}.{0_navigation}' is '{foundType}' which is an array type. Collection navigation properties cannot be arrays. - The type of navigation property '{1_entityType}.{0_navigation}' is '{foundType}' which does not implement ICollection<{targetType}>. Collection navigation properties must implement ICollection<> of the target type. + The type of navigation '{1_entityType}.{0_navigation}' is '{foundType}' which does not implement ICollection<{targetType}>. Collection navigation properties must implement ICollection<> of the target type. - The type of navigation property '{1_entityType}.{0_navigation}' is '{foundType}' for which it was not possible to create a concrete instance. Either initialize the property before use, add a public parameterless constructor to the type, or use a type which can be assigned a HashSet<> or List<>. + The type of navigation '{1_entityType}.{0_navigation}' is '{foundType}' for which it was not possible to create a concrete instance. Either initialize the property before use, add a public parameterless constructor to the type, or use a type which can be assigned a HashSet<> or List<>. - The collection navigation property '{navigation}' cannot be added to the entity type '{entityType}' because its CLR type '{clrType}' does not implement 'IEnumerable<{targetType}>'. Collection navigation properties must implement IEnumerable<> of the related entity. + The collection navigation '{navigation}' cannot be added to the entity type '{entityType}' because its CLR type '{clrType}' does not implement 'IEnumerable<{targetType}>'. Collection navigation properties must implement IEnumerable<> of the related entity. - The navigation property '{1_entityType}.{0_navigation}' cannot be associated with foreign key {targetFk} because it was created for foreign key {actualFk}. + The navigation '{1_entityType}.{0_navigation}' cannot be associated with foreign key {targetFk} because it was created for foreign key {actualFk}. - The property '{1_entityType}.{0_property}' is being accessed using the '{ReferenceMethod}' or '{CollectionMethod}' method, but is defined in the model as a non-navigation property. Use the '{PropertyMethod}' method to access non-navigation properties. + The property '{1_entityType}.{0_property}' is being accessed using the '{referenceMethod}' or '{collectionMethod}' method, but is defined in the model as a non-navigation. Use the '{propertyMethod}' method to access non-navigation properties. - The navigation property '{1_entityType}.{0_navigation}' does not have a setter and no writable backing field was found or specified. Read-only collection navigation properties must be initialized before use. + The navigation '{1_entityType}.{0_navigation}' does not have a setter and no writable backing field was found or specified. Read-only collection navigation properties must be initialized before use. - Unable to determine the relationship represented by navigation property '{entityType}.{navigation}' of type '{propertyType}'. Either manually configure the relationship, or ignore this property using the '[NotMapped]' attribute or by using 'EntityTypeBuilder.Ignore' in 'OnModelCreating'. + Unable to determine the relationship represented by navigation '{entityType}.{navigation}' of type '{propertyType}'. Either manually configure the relationship, or ignore this property using the '[NotMapped]' attribute or by using 'EntityTypeBuilder.Ignore' in 'OnModelCreating'. - The navigation property '{navigation}' cannot be added to the entity type '{entityType}' because its CLR type '{clrType}' does not match the expected CLR type '{targetType}'. + The navigation '{navigation}' cannot be added to the entity type '{entityType}' because its CLR type '{clrType}' does not match the expected CLR type '{targetType}'. The navigation '{navigation}' cannot be added because it targets the keyless entity type '{entityType}'. Navigations can only target entity types with keys. - The navigation property '{navigation}' cannot be added to the entity type '{entityType}' because the target entity type '{targetType}' is defined in shadow state and navigations properties cannot point to shadow state entities. + The navigation '{navigation}' cannot be added to the entity type '{entityType}' because the target entity type '{targetType}' is defined in shadow state and navigations properties cannot point to shadow state entities. - No field was found backing property '{1_entityType}.{0_property}'. Either name the backing field so that it is picked up by convention, configure the backing field to use, or use a different '{pam}'. + No field was found backing property '{1_entityType}.{0_property}'. Either name the backing field so that it is picked up by convention, configure the backing field to use, or use a different '{propertyAccessMode}'. No field was found backing property '{1_entityType}.{0_property}'. Lazy-loaded navigation properties must have backing fields. Either name the backing field so that it is picked up by convention or configure the backing field to use. - The navigation property '{navigation}' cannot be added to the entity type '{entityType}' because there is no corresponding CLR property on the underlying type and navigations properties cannot be added in shadow state. + The navigation '{navigation}' cannot be added to the entity type '{entityType}' because there is no corresponding CLR property on the underlying type and navigations properties cannot be added in shadow state. The CLR entity materializer cannot be used for entity type '{entityType}' because it is a shadow state entity type. Materialization to a CLR type is only possible for entity types that have a corresponding CLR type. @@ -1065,7 +1065,7 @@ The entity type '{entityType}' is part of a hierarchy, but does not have a discriminator value configured. - Entity Framework services have not been added to the internal service provider. Either remove the call to UseInternalServiceProvider so that EF will manage its own internal services, or use the method from your database provider to add the required services to the service provider (e.g. AddEntityFrameworkSqlServer). + Entity Framework services have not been added to the internal service provider. Either remove the call to 'UseInternalServiceProvider' so that EF will manage its own internal services, or use the method from your database provider to add the required services to the service provider (e.g. 'AddEntityFrameworkSqlServer'). No backing field could be found for property '{1_entityType}.{0_property}' and the property does not have a getter. @@ -1074,25 +1074,25 @@ No backing field could be found for property '{1_entityType}.{0_property}' and the property does not have a setter. - The property '{1_entityType}.{0_property}' does not have a getter. Either make the property readable or use a different '{pam}'. + The property '{1_entityType}.{0_property}' does not have a getter. Either make the property readable or use a different '{propertyAccessMode}'. 'InterceptionResult.Result' was called when 'InterceptionResult.HasResult' is false. - There is no navigation on entity type '{entityType}' associated with the foreign key {foreignKey}. + There is no navigation on entity type '{entityType}' associated with the foreign key {foreignKeyProperties}. The entity type '{entityType}' cannot inherit from '{baseEntityType}' because '{baseEntityType}' is a shadow state entity type while '{entityType}' is not. - Property '{entityType}.{property}' cannot be used as a key because it has type '{providerType}' which does not implement 'IComparable<T>', 'IComparable' or 'IStructuralComparable'. Use 'HasConversion()' in 'OnModelCreating()' to wrap '{providerType}' with a type that can be compared. + Property '{entityType}.{property}' cannot be used as a key because it has type '{providerType}' which does not implement 'IComparable<T>', 'IComparable' or 'IStructuralComparable'. Use 'HasConversion()' in 'OnModelCreating' to wrap '{providerType}' with a type that can be compared. Property '{entityType}.{property}' cannot be used as a key because it has type '{modelType}' and provider type '{providerType}' neither of which implement 'IComparable<T>', 'IComparable' or 'IStructuralComparable'. Make '{modelType}' implement one of these interfaces to use it as a key. - The navigation '{1_entityType}.{0_navigation}' must be configured using Fluent API with an explicit name for the target shared type entity type or excluded by calling 'EntityTypeBuilder.Ignore'. + The navigation '{1_entityType}.{0_navigation}' must be configured in 'OnModelCreating' with an explicit name for the target shared type entity type or excluded by calling 'EntityTypeBuilder.Ignore'. The ownership by '{ownershipNavigation}' should use defining navigation '{definingNavigation}' for the owned type '{entityType}' @@ -1104,13 +1104,13 @@ Cannot add property '{1_entityType}.{0_property}' since there is no indexer on '{1_entityType}' taking a single argument of type '{type}'. - The collection type being used for navigation property '{1_entityType}.{0_navigation}' does not implement 'INotifyCollectionChanged'. Any entity type configured to use the '{changeTrackingStrategy}' change tracking strategy must use collections that implement 'INotifyCollectionChanged'. Consider using 'ObservableCollection<T>' for this. + The collection type being used for navigation '{1_entityType}.{0_navigation}' does not implement 'INotifyCollectionChanged'. Any entity type configured to use the '{changeTrackingStrategy}' change tracking strategy must use collections that implement 'INotifyCollectionChanged'. Consider using 'ObservableCollection<T>' for this. The entity type '{entityType}' cannot inherit from '{baseEntityType}' because '{entityType}' is a shadow state entity type while '{baseEntityType}' is not. - The foreign key {foreignKey} on the entity type '{declaringEntityType}' cannot have a required dependent end since it is not unique. + The foreign key {foreignKeyProperties} on the entity type '{declaringEntityType}' cannot have a required dependent end since it is not unique. '{principalEntityType}.{principalNavigation}' cannot be configured as required since it contains a collection. @@ -1119,7 +1119,7 @@ A parameterless constructor was not found on entity type '{entityType}'. In order to create an instance of '{entityType}' EF requires that a parameterless constructor be declared. - No property was associated with field '{field}' of entity type '{entity}'. Either configure a property or use a different '{pam}'. + No property was associated with field '{field}' of entity type '{entity}'. Either configure a property or use a different '{propertyAccessMode}'. The property '{property}' cannot be added to the type '{entityType}' because there was no property type specified and there is no corresponding CLR property or field. To add a shadow state property the property type must be specified. @@ -1131,7 +1131,7 @@ Unable to resolve service for type '{service}'. This is often because no database provider has been configured for this DbContext. A provider can be configured by overriding the DbContext.OnConfiguring method or by using AddDbContext on the application service provider. If AddDbContext is used, then also ensure that your DbContext type accepts a DbContextOptions<TContext> object in its constructor and passes it to the base constructor for DbContext. - The property '{1_entityType}.{0_property}' does not have a setter. Either make the property writable or use a different '{pam}'. + The property '{1_entityType}.{0_property}' does not have a setter. Either make the property writable or use a different '{propertyAccessMode}'. The database provider attempted to register an implementation of the '{service}' service. This is not a service defined by EF and as such must be registered as a provider-specific service using the 'TryAddProviderSpecificServices' method. @@ -1143,7 +1143,7 @@ The given 'IQueryable' does not support generation of query strings. - The '{1_entityType}.{0_property}' does not have a value set and no value generator is available for properties of type '{propertyType}'. Either set a value for the property before adding the entity or configure a value generator for properties of type '{propertyType}'. + The '{1_entityType}.{0_property}' does not have a value set and no value generator is available for properties of type '{propertyType}'. Either set a value for the property before adding the entity or configure a value generator for properties of type '{propertyType}' in 'OnModelCreating'. A key on entity type '{entityType}' cannot contain the property '{property}' because it is nullable/optional. All properties on which a key is declared must be marked as non-nullable/required. @@ -1158,7 +1158,7 @@ The owned entity type '{entityType}' cannot have a base type. - A tracking query projects owned entity without corresponding owner in result. Owned entities cannot be tracked without their owner. Either include the owner entity in the result or make query non-tracking using AsNoTracking(). + A tracking query projects owned entity without corresponding owner in result. Owned entities cannot be tracked without their owner. Either include the owner entity in the result or make query non-tracking using 'AsNoTracking()'. The owned entity type '{ownedType}' requires to be referenced from another entity type via a navigation. Add a navigation to an entity type that points at '{ownedType}'. @@ -1194,16 +1194,16 @@ The property '{property}' belongs to entity type '{entityType}' but is being used with an instance of entity type '{expectedType}'. - The property '{property}' cannot be removed from entity type '{entityType}' because it is being used in the foreign key {foreignKey} on '{foreignKeyType}'. All containing foreign keys must be removed or redefined before the property can be removed. + The property '{property}' cannot be removed from entity type '{entityType}' because it is being used in the foreign key {foreignKeyProperties} on '{foreignKeyType}'. All containing foreign keys must be removed or redefined before the property can be removed. The property '{property}' cannot be removed from entity type '{entityType}' because it is being used in the index {index} on '{indexType}'. All containing indexes must be removed or redefined before the property can be removed. - The property '{property}' cannot be removed from entity type '{entityType}' because it is being used in the key {key}. All containing keys must be removed or redefined before the property can be removed. + The property '{property}' cannot be removed from entity type '{entityType}' because it is being used in the key {keyProperties}. All containing keys must be removed or redefined before the property can be removed. - The property '{1_entityType}.{0_property}' is being accessed using the '{propertyMethod}' method, but is defined in the model as a navigation property. Use either the '{referenceMethod}' or '{collectionMethod}' method to access navigation properties. + The property '{1_entityType}.{0_property}' is being accessed using the '{propertyMethod}' method, but is defined in the model as a navigation. Use either the '{referenceMethod}' or '{collectionMethod}' method to access navigation properties. The EF.Property<T> method may only be used within LINQ queries. @@ -1229,9 +1229,6 @@ The CLR property '{property}' cannot be added to entity type '{entityType}' because it is declared on the CLR type '{clrType}'. - - The CLR property '{property}' cannot be added to entity type '{entityType}'({sharedType}) because it is declared on the CLR type '{clrType}'. - The property '{property}' cannot be added to type '{entityType}' because the name of the given CLR property or field '{clrName}' is different. @@ -1263,19 +1260,19 @@ Translation of 'string.Equals' method which takes 'StringComparison' argument is not supported. See https://go.microsoft.com/fwlink/?linkid=2129535 for more information. - An attempt was made to use the context while it is being configured. A DbContext instance cannot be used inside OnConfiguring since it is still being configured at this point. This can happen if a second operation is started on this context before a previous operation completed. Any instance members are not guaranteed to be thread safe. + An attempt was made to use the context while it is being configured. A DbContext instance cannot be used inside 'OnConfiguring' since it is still being configured at this point. This can happen if a second operation is started on this context before a previous operation completed. Any instance members are not guaranteed to be thread safe. - An attempt was made to use the model while it was being created. A DbContext instance cannot be used inside OnModelCreating in any way that makes use of the model that is being created. + An attempt was made to use the model while it was being created. A DbContext instance cannot be used inside 'OnModelCreating' in any way that makes use of the model that is being created. The relationship from '{referencingEntityTypeOrNavigation}' to '{referencedEntityTypeOrNavigation}' with foreign key properties {foreignKeyPropertiesWithTypes} cannot target the primary key {primaryKeyPropertiesWithTypes} because it is not compatible. Configure a principal key or a set of compatible foreign key properties for this relationship. - The property '{1_entityType}.{0_property}' is being accessed using the '{ReferenceMethod}' method, but is defined in the model as a collection navigation property. Use the '{CollectionMethod}' method to access collection navigation properties. + The property '{1_entityType}.{0_property}' is being accessed using the '{referenceMethod}' method, but is defined in the model as a collection navigation. Use the '{collectionMethod}' method to access collection navigation properties. - Navigation property '{1_entityType}.{0_navigation}' cannot have 'IsLoaded' set to false because the referenced entity is non-null and therefore is loaded. + The navigation '{1_entityType}.{0_navigation}' cannot have 'IsLoaded' set to false because the referenced entity is non-null and therefore is loaded. The principal and dependent ends of the relationship cannot be flipped once foreign key or principal key properties have been specified. @@ -1329,7 +1326,10 @@ The seed entity for entity type '{entityType}' cannot be added because a non-zero value is required for property '{property}'. Consider providing a negative value to avoid collisions with non-seed data. - A relationship cannot be established from property '{1_entityType}.{0_property}' to property '{3_referencedEntityType}.{2_referencedProperty}'. Check the values in the [InverseProperty] attribute to ensure relationship definitions are unique and reference from one navigation property to its corresponding inverse navigation property. + A relationship cannot be established from property '{1_entityType}.{0_property}' to property '{3_referencedEntityType}.{2_referencedProperty}'. Check the values in the [InverseProperty] attribute to ensure relationship definitions are unique and reference from one navigation to its corresponding inverse navigation. + + + To show additional information call EnableSensitiveDataLogging() when overriding DbContext.OnConfiguring. Sequence contains more than one element. @@ -1347,7 +1347,7 @@ configuration removed for '{key}' - When performing a set operation, both operands must have the same Include operations. + When performing a set operation, both operands must have the same 'Include' operations. Entity type '{entityType}' is in shadow-state. A valid model requires all entity types to have corresponding CLR type. @@ -1362,16 +1362,16 @@ An attempt was made to register an instance for the '{scope}' service '{service}'. Instances can only be registered for 'Singleton' services. - The foreign key '{foreignKey}' cannot be set for the skip navigation '{navigation}' as it uses the join entity type '{joinType}' while the inverse skip navigation '{inverse}' is using the join entity type '{inverseJoinType}'. The inverse should use the same join entity type. + The foreign key {foreignKeyProperties} cannot be set for the skip navigation '{navigation}' as it uses the join entity type '{joinType}' while the inverse skip navigation '{inverse}' is using the join entity type '{inverseJoinType}'. The inverse should use the same join entity type. The skip navigation '{inverse}' using the join entity type '{inverseJoinType}' cannot be set as the inverse of '{navigation}' that uses the join entity type '{joinType}'. The inverse should use the same join entity type. - The foreign key {foreignKey} cannot be used for the skip navigation property '{2_entityType}.{1_navigation}' because it is expected to be on the dependent entity type '{dependentEntityType}'. + The foreign key {foreignKeyProperties} cannot be used for the skip navigation '{2_entityType}.{1_navigation}' because it is expected to be on the dependent entity type '{dependentEntityType}'. - The foreign key {foreignKey} cannot be used for the skip navigation property '{2_entityType}.{1_navigation}' because it is expected to be on the principal entity type '{principalEntityType}'. + The foreign key {foreignKeyProperties} cannot be used for the skip navigation '{2_entityType}.{1_navigation}' because it is expected to be on the principal entity type '{principalEntityType}'. The skip navigation '{skipNavigation}' cannot be removed because it is set as the inverse of the skip navigation '{inverseSkipNavigation}' on '{referencingEntityType}'. All referencing skip navigations must be removed before this skip navigation can be removed. @@ -1389,7 +1389,7 @@ The skip navigation '{inverse}' declared on the entity type '{inverseEntityType}' cannot be set as the inverse of '{navigation}' that targets '{targetEntityType}'. The inverse should be declared on the target entity type. - The skip navigation property '{navigation}' cannot be removed from the entity type '{entityType}' because it is defined on the entity type '{otherEntityType}'. + The skip navigation '{navigation}' cannot be removed from the entity type '{entityType}' because it is defined on the entity type '{otherEntityType}'. The property '{1_entityType}.{0_property}' cannot be assigned a value generated by the database. Store-generated values can only be assigned to properties configured to use store-generated values. @@ -1407,10 +1407,10 @@ Current provider doesn't support System.Transaction. - The LINQ expression '{expression}' could not be translated. Either rewrite the query in a form that can be translated, or switch to client evaluation explicitly by inserting a call to either AsEnumerable(), AsAsyncEnumerable(), ToList(), or ToListAsync(). See https://go.microsoft.com/fwlink/?linkid=2101038 for more information. + The LINQ expression '{expression}' could not be translated. Either rewrite the query in a form that can be translated, or switch to client evaluation explicitly by inserting a call to either 'AsEnumerable()', 'AsAsyncEnumerable()', 'ToList()', or 'ToListAsync()'. See https://go.microsoft.com/fwlink/?linkid=2101038 for more information. - The LINQ expression '{expression}' could not be translated. Additional information: {details} Either rewrite the query in a form that can be translated, or switch to client evaluation explicitly by inserting a call to either AsEnumerable(), AsAsyncEnumerable(), ToList(), or ToListAsync(). See https://go.microsoft.com/fwlink/?linkid=2101038 for more information. + The LINQ expression '{expression}' could not be translated. Additional information: {details} Either rewrite the query in a form that can be translated, or switch to client evaluation explicitly by inserting a call to either 'AsEnumerable()', 'AsAsyncEnumerable()', 'ToList()', or 'ToListAsync()'. See https://go.microsoft.com/fwlink/?linkid=2101038 for more information. Type '{type}' is not been configured as shared type in the model. Before calling 'UsingEntity', please mark the type as shared or add the entity type in the model as shared entity. @@ -1419,7 +1419,7 @@ Unable to materialize entity of type '{entityType}'. No discriminators matched '{discriminator}'. - Unable to set IsUnique to '{isUnique}' on the relationship underlying the navigation property '{2_entityType}.{1_navigationName}' because the navigation property has the opposite multiplicity. + Unable to set IsUnique to '{isUnique}' on the relationship underlying the navigation '{2_entityType}.{1_navigationName}' because the navigation has the opposite multiplicity. Unhandled expression node type '{nodeType}'. @@ -1437,7 +1437,7 @@ The value of '{entityType}.{property}' is unknown when attempting to save changes. This is because the property is also part of a foreign key for which the principal entity in the relationship is not known. - The unnamed index on the entity type '{entityType}' with properties {indexPropertyList} is invalid. The property '{propertyName}' has been marked NotMapped or Ignore(). An index cannot use such properties. + The unnamed index on the entity type '{entityType}' with properties {indexPropertyList} is invalid. The property '{propertyName}' was ignored by [NotMapped] attribute or 'Ignore()' in 'OnModelCreating'. An index cannot use such properties. An unnamed index on the entity type '{entityType}' specifies properties {indexPropertyList}. But no property with name '{propertyName}' exists on that entity type or any of its base types. @@ -1467,6 +1467,6 @@ Property '{1_entityType}.{0_property}' is of type '{actualType}' but the generic type provided is of type '{genericType}'. - Cannot start tracking InternalEntityEntry for entity type '{entityType}' because it was created by a different StateManager instance. + Cannot start tracking the entry for entity type '{entityType}' because it was created by a different StateManager instance. \ No newline at end of file diff --git a/src/Shared/Multigraph.cs b/src/Shared/Multigraph.cs index 4ea986e5482..5723a8ca0c9 100644 --- a/src/Shared/Multigraph.cs +++ b/src/Shared/Multigraph.cs @@ -261,7 +261,7 @@ private void ThrowCycle(List cycle, Func "); + cycleString = cycle.Select(ToString).Join(" ->" + Environment.NewLine); } else { diff --git a/test/EFCore.Relational.Specification.Tests/TestUtilities/TestSqlLoggerFactory.cs b/test/EFCore.Relational.Specification.Tests/TestUtilities/TestSqlLoggerFactory.cs index 65b4c068e84..dbd2fdcf8f9 100644 --- a/test/EFCore.Relational.Specification.Tests/TestUtilities/TestSqlLoggerFactory.cs +++ b/test/EFCore.Relational.Specification.Tests/TestUtilities/TestSqlLoggerFactory.cs @@ -62,7 +62,7 @@ public void AssertBaseline(string[] expected, bool assertOrder = true) { foreach (var expectedFragment in expected) { - var normalizedExpectedFragment = expectedFragment.Replace("\r", string.Empty).Replace("\n", _eol); + var normalizedExpectedFragment = NormalizeLineEndings(expectedFragment); Assert.Contains( normalizedExpectedFragment, SqlStatements); diff --git a/test/EFCore.Relational.Tests/Update/CommandBatchPreparerTest.cs b/test/EFCore.Relational.Tests/Update/CommandBatchPreparerTest.cs index a6a9c68c602..4499ed6eb30 100644 --- a/test/EFCore.Relational.Tests/Update/CommandBatchPreparerTest.cs +++ b/test/EFCore.Relational.Tests/Update/CommandBatchPreparerTest.cs @@ -401,11 +401,15 @@ public void Batch_command_throws_on_commands_with_circular_dependencies(bool sen var modelData = new UpdateAdapter(stateManager); var expectedCycle = sensitiveLogging - ? "FakeEntity { 'Id': 42 } [Added] <- ForeignKey { 'RelatedId': 42 } RelatedFakeEntity { 'Id': 1 } [Added] <- ForeignKey { 'RelatedId': 1 } FakeEntity { 'Id': 42 } [Added]" - : "FakeEntity [Added] <- ForeignKey { 'RelatedId' } RelatedFakeEntity [Added] <- ForeignKey { 'RelatedId' } FakeEntity [Added]"; - + ? @"FakeEntity { 'Id': 42 } [Added] <- +ForeignKey { 'RelatedId': 42 } RelatedFakeEntity { 'Id': 1 } [Added] <- +ForeignKey { 'RelatedId': 1 } FakeEntity { 'Id': 42 } [Added]" + : @"FakeEntity [Added] <- +ForeignKey { 'RelatedId' } RelatedFakeEntity [Added] <- +ForeignKey { 'RelatedId' } FakeEntity [Added]" + CoreStrings.SensitiveDataDisabled; + Assert.Equal( - CoreStrings.CircularDependency(expectedCycle), + CoreStrings.CircularDependency(ListLoggerFactory.NormalizeLineEndings(expectedCycle)), Assert.Throws( () => CreateCommandBatchPreparer(updateAdapter: modelData, sensitiveLogging: sensitiveLogging) .BatchCommands(new[] { fakeEntry, relatedFakeEntry }, modelData).ToArray()).Message); @@ -441,11 +445,17 @@ public void Batch_command_throws_on_commands_with_circular_dependencies_includin var modelData = new UpdateAdapter(stateManager); var expectedCycle = sensitiveLogging - ? "FakeEntity { 'Id': 42 } [Added] <- ForeignKey { 'RelatedId': 42 } RelatedFakeEntity { 'Id': 1 } [Added] <- ForeignKey { 'RelatedId': 1 } FakeEntity { 'Id': 2 } [Modified] <- Index { 'UniqueValue': Test } FakeEntity { 'Id': 42 } [Added]" - : "FakeEntity [Added] <- ForeignKey { 'RelatedId' } RelatedFakeEntity [Added] <- ForeignKey { 'RelatedId' } FakeEntity [Modified] <- Index { 'UniqueValue' } FakeEntity [Added]"; + ? @"FakeEntity { 'Id': 42 } [Added] <- +ForeignKey { 'RelatedId': 42 } RelatedFakeEntity { 'Id': 1 } [Added] <- +ForeignKey { 'RelatedId': 1 } FakeEntity { 'Id': 2 } [Modified] <- +Index { 'UniqueValue': Test } FakeEntity { 'Id': 42 } [Added]" + : @"FakeEntity [Added] <- +ForeignKey { 'RelatedId' } RelatedFakeEntity [Added] <- +ForeignKey { 'RelatedId' } FakeEntity [Modified] <- +Index { 'UniqueValue' } FakeEntity [Added]" + CoreStrings.SensitiveDataDisabled; Assert.Equal( - CoreStrings.CircularDependency(expectedCycle), + CoreStrings.CircularDependency(ListLoggerFactory.NormalizeLineEndings(expectedCycle)), Assert.Throws( () => CreateCommandBatchPreparer(updateAdapter: modelData, sensitiveLogging: sensitiveLogging) .BatchCommands(new[] { fakeEntry, relatedFakeEntry, fakeEntry2 }, modelData).ToArray()).Message); @@ -475,11 +485,15 @@ public void Batch_command_throws_on_delete_commands_with_circular_dependencies(b var modelData = new UpdateAdapter(stateManager); var expectedCycle = sensitiveLogging - ? "FakeEntity { 'Id': 1 } [Deleted] ForeignKey { 'RelatedId': 2 } <- RelatedFakeEntity { 'Id': 2 } [Deleted] ForeignKey { 'RelatedId': 1 } <- FakeEntity { 'Id': 1 } [Deleted]" - : "FakeEntity [Deleted] ForeignKey { 'RelatedId' } <- RelatedFakeEntity [Deleted] ForeignKey { 'RelatedId' } <- FakeEntity [Deleted]"; + ? @"FakeEntity { 'Id': 1 } [Deleted] ForeignKey { 'RelatedId': 2 } <- +RelatedFakeEntity { 'Id': 2 } [Deleted] ForeignKey { 'RelatedId': 1 } <- +FakeEntity { 'Id': 1 } [Deleted]" + : @"FakeEntity [Deleted] ForeignKey { 'RelatedId' } <- +RelatedFakeEntity [Deleted] ForeignKey { 'RelatedId' } <- +FakeEntity [Deleted]" + CoreStrings.SensitiveDataDisabled; Assert.Equal( - CoreStrings.CircularDependency(expectedCycle), + CoreStrings.CircularDependency(ListLoggerFactory.NormalizeLineEndings(expectedCycle)), Assert.Throws( () => CreateCommandBatchPreparer(updateAdapter: modelData, sensitiveLogging: sensitiveLogging).BatchCommands( // Order is important for this test. Entry which is not part of cycle but tail should come first. @@ -744,7 +758,7 @@ public void BatchCommands_throws_on_conflicting_values_for_shared_table_added_en Assert.Equal( RelationalStrings.ConflictingRowValuesSensitive( nameof(FakeEntity), nameof(RelatedFakeEntity), - "{Id: 42}", "{RelatedId: 1}", "{RelatedId: 2}", "{'RelatedId'}"), + "{Id: 42}", "{RelatedId: 1}", "{RelatedId: 2}", "RelatedId"), Assert.Throws( () => CreateCommandBatchPreparer(updateAdapter: modelData, sensitiveLogging: true) .BatchCommands(new[] { firstEntry, secondEntry }, modelData).ToArray()).Message); @@ -754,7 +768,7 @@ public void BatchCommands_throws_on_conflicting_values_for_shared_table_added_en Assert.Equal( RelationalStrings.ConflictingRowValues( nameof(FakeEntity), nameof(RelatedFakeEntity), - "{'RelatedId'}", "{'RelatedId'}", "{'RelatedId'}"), + "{'RelatedId'}", "{'RelatedId'}", "RelatedId"), Assert.Throws( () => CreateCommandBatchPreparer(updateAdapter: modelData, sensitiveLogging: false) .BatchCommands(new[] { firstEntry, secondEntry }, modelData).ToArray()).Message); @@ -767,7 +781,7 @@ public void BatchCommands_throws_on_conflicting_values_for_shared_table_added_en Assert.Equal( RelationalStrings.ConflictingOriginalRowValuesSensitive( nameof(FakeEntity), nameof(RelatedFakeEntity), - "{Id: 42}", "{RelatedId: 1}", "{RelatedId: 2}", "{'RelatedId'}"), + "{Id: 42}", "{RelatedId: 1}", "{RelatedId: 2}", "RelatedId"), Assert.Throws( () => CreateCommandBatchPreparer(updateAdapter: modelData, sensitiveLogging: true) .BatchCommands(new[] { firstEntry, secondEntry }, modelData).ToArray()).Message); @@ -777,7 +791,7 @@ public void BatchCommands_throws_on_conflicting_values_for_shared_table_added_en Assert.Equal( RelationalStrings.ConflictingOriginalRowValues( nameof(FakeEntity), nameof(RelatedFakeEntity), - "{'RelatedId'}", "{'RelatedId'}", "{'RelatedId'}"), + "{'RelatedId'}", "{'RelatedId'}", "RelatedId"), Assert.Throws( () => CreateCommandBatchPreparer(updateAdapter: modelData, sensitiveLogging: false) .BatchCommands(new[] { firstEntry, secondEntry }, modelData).ToArray()).Message); diff --git a/test/EFCore.Specification.Tests/TestUtilities/ListLoggerFactory.cs b/test/EFCore.Specification.Tests/TestUtilities/ListLoggerFactory.cs index 182128ee31d..090bda6b7c4 100644 --- a/test/EFCore.Specification.Tests/TestUtilities/ListLoggerFactory.cs +++ b/test/EFCore.Specification.Tests/TestUtilities/ListLoggerFactory.cs @@ -72,6 +72,9 @@ public void Dispose() _disposed = true; } + public static string NormalizeLineEndings(string expectedString) + => expectedString.Replace("\r", string.Empty).Replace("\n", Environment.NewLine); + protected class ListLogger : ILogger { private readonly object _sync = new object(); diff --git a/test/EFCore.Tests/Infrastructure/AnnotatableTest.cs b/test/EFCore.Tests/Infrastructure/AnnotatableTest.cs index 169d302afc0..f13103d074a 100644 --- a/test/EFCore.Tests/Infrastructure/AnnotatableTest.cs +++ b/test/EFCore.Tests/Infrastructure/AnnotatableTest.cs @@ -68,7 +68,7 @@ public void Can_get_and_set_model_annotations() Assert.Empty(annotatable.GetAnnotations()); Assert.Equal( - CoreStrings.AnnotationNotFound("Foo"), + CoreStrings.AnnotationNotFound("Foo", "Microsoft.EntityFrameworkCore.Infrastructure.Annotatable"), Assert.Throws(() => annotatable.GetAnnotation("Foo")).Message); } diff --git a/test/EFCore.Tests/Infrastructure/ModelValidatorTest.cs b/test/EFCore.Tests/Infrastructure/ModelValidatorTest.cs index b42b882bd82..6509bdd26b2 100644 --- a/test/EFCore.Tests/Infrastructure/ModelValidatorTest.cs +++ b/test/EFCore.Tests/Infrastructure/ModelValidatorTest.cs @@ -164,12 +164,13 @@ private class WithStringAndBinaryKey public virtual void Detects_filter_on_derived_type() { var modelBuilder = CreateConventionalModelBuilder(); - modelBuilder.Entity(); + var entityTypeA = modelBuilder.Entity().Metadata; var entityTypeD = modelBuilder.Entity().Metadata; entityTypeD.SetQueryFilter((Expression>)(_ => true)); - VerifyError(CoreStrings.BadFilterDerivedType(entityTypeD.GetQueryFilter(), entityTypeD.DisplayName()), modelBuilder.Model); + VerifyError(CoreStrings.BadFilterDerivedType(entityTypeD.GetQueryFilter(), entityTypeD.DisplayName(), entityTypeA.DisplayName()), + modelBuilder.Model); } [ConditionalFact] @@ -1356,7 +1357,7 @@ public virtual void Shared_type_inheritance_throws() modelBuilder.SharedTypeEntity("Shared1"); modelBuilder.SharedTypeEntity("Shared2").HasBaseType("Shared1"); - VerifyError(CoreStrings.SharedTypeDerivedType("Shared2"), modelBuilder.Model); + VerifyError(CoreStrings.SharedTypeDerivedType("Shared2 (C)"), modelBuilder.Model); } // INotify interfaces not really implemented; just marking the classes to test metadata construction diff --git a/test/EFCore.Tests/Metadata/Internal/EntityTypeTest.cs b/test/EFCore.Tests/Metadata/Internal/EntityTypeTest.cs index e2f4aa6169e..dbba0789335 100644 --- a/test/EFCore.Tests/Metadata/Internal/EntityTypeTest.cs +++ b/test/EFCore.Tests/Metadata/Internal/EntityTypeTest.cs @@ -139,7 +139,7 @@ public void Display_name_is_entity_type_name_when_no_CLR_type() [ConditionalFact] public void Display_name_is_entity_type_name_when_shared_entity_type() - => Assert.Equal("PostTag", CreateModel().AddEntityType("PostTag", typeof(Dictionary)).DisplayName()); + => Assert.Equal("PostTag (Dictionary)", CreateModel().AddEntityType("PostTag", typeof(Dictionary)).DisplayName()); [ConditionalFact] public void Name_is_prettified_CLR_full_name() diff --git a/test/EFCore.Tests/Utilities/MultigraphTest.cs b/test/EFCore.Tests/Utilities/MultigraphTest.cs index 7889f3468c5..a74a87a4bde 100644 --- a/test/EFCore.Tests/Utilities/MultigraphTest.cs +++ b/test/EFCore.Tests/Utilities/MultigraphTest.cs @@ -350,7 +350,7 @@ public void TopologicalSort_throws_with_default_message_when_cycle_cannot_be_bro Assert.Equal( CoreStrings.CircularDependency( - string.Join(" -> ", new[] { vertexOne, vertexTwo, vertexThree, vertexOne }.Select(v => v.ToString()))), + string.Join(" ->" + Environment.NewLine, new[] { vertexOne, vertexTwo, vertexThree, vertexOne }.Select(v => v.ToString()))), Assert.Throws(() => graph.TopologicalSort()).Message); } @@ -656,7 +656,7 @@ public void BatchingTopologicalSort_sorts_self_ref() graph.Populate(entityTypeA); Assert.Equal( - CoreStrings.CircularDependency(nameof(A) + " -> " + nameof(A)), + CoreStrings.CircularDependency(nameof(A) + " ->" + Environment.NewLine + nameof(A)), Assert.Throws(() => graph.BatchingTopologicalSort()).Message); } @@ -682,7 +682,7 @@ public void BatchingTopologicalSort_sorts_circular_direct() graph.Populate(entityTypeC, entityTypeA, entityTypeB); Assert.Equal( - CoreStrings.CircularDependency(nameof(A) + " -> " + nameof(B) + " -> " + nameof(A)), + CoreStrings.CircularDependency(nameof(A) + " ->" + Environment.NewLine + nameof(B) + " ->" + Environment.NewLine + nameof(A)), Assert.Throws(() => graph.BatchingTopologicalSort()).Message); } @@ -709,7 +709,10 @@ public void BatchingTopologicalSort_sorts_circular_transitive() graph.Populate(entityTypeA, entityTypeB, entityTypeC); Assert.Equal( - CoreStrings.CircularDependency(nameof(A) + " -> " + nameof(C) + " -> " + nameof(B) + " -> " + nameof(A)), + CoreStrings.CircularDependency(nameof(A) + " ->" + Environment.NewLine + + nameof(C) + " ->" + Environment.NewLine + + nameof(B) + " ->" + Environment.NewLine + + nameof(A)), Assert.Throws(() => graph.BatchingTopologicalSort()).Message); } @@ -747,7 +750,10 @@ public void BatchingTopologicalSort_sorts_two_cycles() graph.Populate(entityTypeA, entityTypeB, entityTypeC, entityTypeD, entityTypeE); Assert.Equal( - CoreStrings.CircularDependency(nameof(A) + " -> " + nameof(C) + " -> " + nameof(B) + " -> " + nameof(A)), + CoreStrings.CircularDependency(nameof(A) + " ->" + Environment.NewLine + + nameof(C) + " ->" + Environment.NewLine + + nameof(B) + " ->" + Environment.NewLine + + nameof(A)), Assert.Throws(() => graph.BatchingTopologicalSort()).Message); } @@ -774,7 +780,7 @@ public void BatchingTopologicalSort_sorts_leafy_cycle() graph.Populate(entityTypeA, entityTypeB, entityTypeC); Assert.Equal( - CoreStrings.CircularDependency(nameof(C) + " -> " + nameof(B) + " -> " + nameof(C)), + CoreStrings.CircularDependency(nameof(C) + " ->" + Environment.NewLine + nameof(B) + " ->" + Environment.NewLine + nameof(C)), Assert.Throws(() => graph.BatchingTopologicalSort()).Message); }