From 11394a2d5fce4b6b19305c0b8a67647b499b11c8 Mon Sep 17 00:00:00 2001 From: ajcvickers Date: Sat, 29 Aug 2020 14:03:44 -0700 Subject: [PATCH] Part of #7201 This PR contains the specific changes we made in the meeting, plus using ``{entityType}.{property/navigation}' in EFCore consistently. The tt files has been updated to allow moving of parameters without changing the method signature and hence without needing to update all call sites, which is error prone. I have also added other changes we discussed as check boxes in #7201 so that we can track this like we do API reviews. --- src/EFCore/Properties/CoreStrings.Designer.cs | 294 +++++++++--------- src/EFCore/Properties/CoreStrings.resx | 206 ++++++------ tools/Resources.tt | 24 +- 3 files changed, 269 insertions(+), 255 deletions(-) diff --git a/src/EFCore/Properties/CoreStrings.Designer.cs b/src/EFCore/Properties/CoreStrings.Designer.cs index 799af263efe..471bbe878ed 100644 --- a/src/EFCore/Properties/CoreStrings.Designer.cs +++ b/src/EFCore/Properties/CoreStrings.Designer.cs @@ -1,4 +1,4 @@ -// +// using System; using System.Reflection; @@ -49,7 +49,7 @@ public static string AmbiguousEndRequiredDependent([CanBeNull] object foreignKey foreignKey, entityType); /// - /// '{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 {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. /// public static string AmbiguousEndRequiredDependentNavigation([CanBeNull] object entityType, [CanBeNull] object navigation, [CanBeNull] object foreignKey) => string.Format( @@ -73,7 +73,7 @@ public static string AmbiguousForeignKeyPropertyCandidates([CanBeNull] object fi firstDependentToPrincipalNavigationSpecification, firstPrincipalToDependentNavigationSpecification, secondDependentToPrincipalNavigationSpecification, secondPrincipalToDependentNavigationSpecification, foreignKeyProperties); /// - /// 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 without specifying the inverse. See http://go.microsoft.com/fwlink/?LinkId=724062 for more details. + /// 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. /// public static string AmbiguousOneToOneRelationship([CanBeNull] object dependentToPrincipalNavigationSpecification, [CanBeNull] object principalToDependentNavigationSpecification) => string.Format( @@ -121,7 +121,7 @@ public static string AttemptToCreateEntityTypeBasedOnProxyClass([CanBeNull] obje typeName); /// - /// Cannot set backing field '{field}' for the indexer property '{entityType}.{property}'. Indexer properties are not allowed to use a backing field. + /// Cannot set backing field '{field}' for the indexer property '{entityType}.{property}'. Ensure no backing fields are specified for indexer properties. /// public static string BackingFieldOnIndexer([CanBeNull] object field, [CanBeNull] object entityType, [CanBeNull] object property) => string.Format( @@ -129,7 +129,7 @@ public static string BackingFieldOnIndexer([CanBeNull] object field, [CanBeNull] field, entityType, property); /// - /// The specified field '{field}' of type '{fieldType}' cannot be used for the property '{entityType}.{property}' of type '{propertyType}'. Only backing fields of types that are assignable from the property type can be used. + /// The specified field '{field}' of type '{fieldType}' cannot be used for the property '{entityType}.{property}' of type '{propertyType}'. Only backing fields of types that are compatible with the property type can be used. /// public static string BadBackingFieldType([CanBeNull] object field, [CanBeNull] object fieldType, [CanBeNull] object entityType, [CanBeNull] object property, [CanBeNull] object propertyType) => string.Format( @@ -137,7 +137,7 @@ public static string BadBackingFieldType([CanBeNull] object field, [CanBeNull] o field, fieldType, entityType, property, propertyType); /// - /// The service dependencies type '{dependenciesType}' has been registered inappropriately in the service collection. Service dependencies types must only be registered by Entity Framework, or in rare cases by database providers and then only to change the service lifetime. + /// 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. /// public static string BadDependencyRegistration([CanBeNull] object dependenciesType) => string.Format( @@ -153,7 +153,7 @@ public static string BadFilterDerivedType([CanBeNull] object filter, [CanBeNull] filter, entityType); /// - /// The filter expression '{filter}' specified for entity type '{entityType}' is invalid. The expression must accept a single parameter of type '{clrType}', return bool, and may not contain references to navigation properties. + /// The filter expression '{filter}' specified for entity type '{entityType}' is invalid. The expression must accept a single parameter of type '{clrType}' and return bool. /// public static string BadFilterExpression([CanBeNull] object filter, [CanBeNull] object entityType, [CanBeNull] object clrType) => string.Format( @@ -161,7 +161,7 @@ public static string BadFilterExpression([CanBeNull] object filter, [CanBeNull] filter, entityType, clrType); /// - /// The filter expression '{filter}' cannot be specified for entity type '{entityType}'. A filter may only be applied to the entity that is not owned. + /// The filter expression '{filter}' cannot be specified for owned entity type '{entityType}'. A filter may only be applied to the entity that is not owned. /// public static string BadFilterOwnedType([CanBeNull] object filter, [CanBeNull] object entityType) => string.Format( @@ -169,7 +169,7 @@ public static string BadFilterOwnedType([CanBeNull] object filter, [CanBeNull] o filter, entityType); /// - /// The type '{givenType}' cannot be used as a value generator because it does not inherit from '{expectedType}'. + /// The type '{givenType}' cannot be used as a value generator because it does not inherit from '{expectedType}'. Make sure to inherit value generators from '{expectedType}'. /// public static string BadValueGeneratorType([CanBeNull] object givenType, [CanBeNull] object expectedType) => string.Format( @@ -183,19 +183,19 @@ public static string CanConnectNotImplemented => GetString("CanConnectNotImplemented"); /// - /// The property '{property}' on entity type '{entityType}' cannot be marked as nullable/optional because the type of the property is '{propertyType}' which is not a nullable type. Any property can be marked as non-nullable/required, but only properties of nullable types and which are not part of primary key can be marked as nullable/optional. + /// The property '{1_entityType}.{0_property}' cannot be marked as nullable/optional because the type of the property is '{propertyType}' which is not a nullable type. Any property can be marked as non-nullable/required, but only properties of nullable types can be marked as nullable/optional. /// public static string CannotBeNullable([CanBeNull] object property, [CanBeNull] object entityType, [CanBeNull] object propertyType) => string.Format( - GetString("CannotBeNullable", nameof(property), nameof(entityType), nameof(propertyType)), + GetString("CannotBeNullable", "0_property", "1_entityType", nameof(propertyType)), property, entityType, propertyType); /// - /// The property '{property}' on entity type '{entityType}' cannot be marked as nullable/optional because the property is a part of a key. Any property can be marked as non-nullable/required, but only properties of nullable types and which are not part of a key can be marked as nullable/optional. + /// The property '{1_entityType}.{0_property}' cannot be marked as nullable/optional because the property is a part of a key. Any property can be marked as non-nullable/required, but only properties of nullable types and which are not part of a key can be marked as nullable/optional. /// public static string CannotBeNullablePK([CanBeNull] object property, [CanBeNull] object entityType) => string.Format( - GetString("CannotBeNullablePK", nameof(property), nameof(entityType)), + GetString("CannotBeNullablePK", "0_property", "1_entityType"), property, entityType); /// @@ -213,15 +213,15 @@ public static string CannotCreateValueGenerator([CanBeNull] object generatorType generatorType); /// - /// Navigation property '{navigation}' on entity of type '{entityType}' cannot be loaded because the entity is not being tracked. Navigation properties can only be loaded for tracked entities. + /// The navigation '{1_entityType}.{0_navigation}' cannot be loaded because the entity is not being tracked. Navigations can only be loaded for tracked entities. /// public static string CannotLoadDetached([CanBeNull] object navigation, [CanBeNull] object entityType) => string.Format( - GetString("CannotLoadDetached", nameof(navigation), nameof(entityType)), + GetString("CannotLoadDetached", "0_navigation", "1_entityType"), navigation, entityType); /// - /// Type '{type}' cannot be marked as shared type since entity type with same CLR type exists in the model. + /// The type '{type}' cannot be marked as a shared type since an entity type with the same CLR type already exists in the model. /// public static string CannotMarkShared([CanBeNull] object type) => string.Format( @@ -229,7 +229,7 @@ public static string CannotMarkShared([CanBeNull] object type) type); /// - /// Unable to create an instance of type entity type '{entityType}' because it is abstract. Either make it non-abstract or consider mapping at least one derived type. + /// Unable to create an instance of entity type '{entityType}' because it is abstract. Either make it non-abstract or consider mapping at least one derived type. /// public static string CannotMaterializeAbstractType([CanBeNull] object entityType) => string.Format( @@ -237,15 +237,15 @@ public static string CannotMaterializeAbstractType([CanBeNull] object entityType entityType); /// - /// There is no navigation property with name '{navigationName}' on entity type '{entityType}'. Please add the navigation to the entity type before configuring it. + /// There is no navigation '{1_entityType}.{0_navigationName}'. Please add the navigation to the entity type before configuring it. /// public static string CanOnlyConfigureExistingNavigations([CanBeNull] object navigationName, [CanBeNull] object entityType) => string.Format( - GetString("CanOnlyConfigureExistingNavigations", nameof(navigationName), nameof(entityType)), + GetString("CanOnlyConfigureExistingNavigations", "0_navigationName", "1_entityType"), navigationName, entityType); /// - /// The entity type '{entityType}' is configured to use the '{changeTrackingStrategy}' change tracking strategy but does not implement the required '{notificationInterface}' interface. + /// The entity type '{entityType}' is configured to use the '{changeTrackingStrategy}' change tracking strategy but does not implement the required '{notificationInterface}' interface. Implement '{notificationInterface}' on '{entityType}' or use a different change tracking strategy. /// public static string ChangeTrackingInterfaceMissing([CanBeNull] object entityType, [CanBeNull] object changeTrackingStrategy, [CanBeNull] object notificationInterface) => string.Format( @@ -261,7 +261,7 @@ public static string CircularDependency([CanBeNull] object cycle) cycle); /// - /// The entity type '{entityType}' cannot inherit from '{baseEntityType}' because '{baseEntityType}' is a descendant of '{entityType}'. + /// The entity type '{entityType}' cannot inherit from '{baseEntityType}' because '{baseEntityType}' is a descendant of '{entityType}'. Review your model configuration. /// public static string CircularInheritance([CanBeNull] object entityType, [CanBeNull] object baseEntityType) => string.Format( @@ -269,7 +269,7 @@ public static string CircularInheritance([CanBeNull] object entityType, [CanBeNu entityType, baseEntityType); /// - /// The shared type entity type '{entityType}' cannot be added to the model because a shared entity type with the same name but different clr type '{otherClrType}' already exists. + /// 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. /// public static string ClashingMismatchedSharedType([CanBeNull] object entityType, [CanBeNull] object otherClrType) => string.Format( @@ -373,11 +373,11 @@ public static string ClrPropertyOnShadowEntity([CanBeNull] object property, [Can property, entityType); /// - /// The property '{property}' on entity type '{entityType}' 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 property. 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( - GetString("CollectionIsReference", nameof(property), nameof(entityType), nameof(CollectionMethod), nameof(ReferenceMethod)), + GetString("CollectionIsReference", "0_property", "1_entityType", nameof(CollectionMethod), nameof(ReferenceMethod)), property, entityType, CollectionMethod, ReferenceMethod); /// @@ -389,11 +389,11 @@ public static string ComparerPropertyMismatch([CanBeNull] object type, [CanBeNul type, entityType, propertyName, propertyType); /// - /// There are multiple properties pointing to navigation '{navigation}' in entity type '{entityType}'. To define composite foreign key using data annotations, use ForeignKeyAttribute on navigation. + /// There are multiple properties pointing to navigation '{1_entityType}.{0_navigation}'. To define composite foreign key using data annotations, use ForeignKeyAttribute on navigation. /// public static string CompositeFkOnProperty([CanBeNull] object navigation, [CanBeNull] object entityType) => string.Format( - GetString("CompositeFkOnProperty", nameof(navigation), nameof(entityType)), + GetString("CompositeFkOnProperty", "0_navigation", "1_entityType"), navigation, entityType); /// @@ -411,11 +411,11 @@ public static string ConcurrentMethodInvocation => GetString("ConcurrentMethodInvocation"); /// - /// Property '{property}' on entity type '{entityType}' 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( - GetString("ConflictingBackingFields", nameof(property), nameof(entityType), nameof(field1), nameof(field2)), + GetString("ConflictingBackingFields", "0_property", "1_entityType", nameof(field1), nameof(field2)), property, entityType, field1, field2); /// @@ -1212,11 +1212,11 @@ public static string InvalidMembersExpression([CanBeNull] object expression) expression); /// - /// The InversePropertyAttribute on property '{property}' on type '{entityType}' 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 InversePropertyAttribute 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. /// public static string InvalidNavigationWithInverseProperty([CanBeNull] object property, [CanBeNull] object entityType, [CanBeNull] object referencedProperty, [CanBeNull] object referencedEntityType) => string.Format( - GetString("InvalidNavigationWithInverseProperty", nameof(property), nameof(entityType), nameof(referencedProperty), nameof(referencedEntityType)), + GetString("InvalidNavigationWithInverseProperty", "0_property", "1_entityType", nameof(referencedProperty), nameof(referencedEntityType)), property, entityType, referencedProperty, referencedEntityType); /// @@ -1244,19 +1244,19 @@ public static string InvalidPropertyExpression([CanBeNull] object expression) expression); /// - /// The property list specified using ForeignKeyAttribute on navigation '{navigation}' in entity type '{entityType}' is incorrect. The attribute value should be comma-separated list of property names. + /// The property list specified using ForeignKeyAttribute on navigation '{1_entityType}.{0_navigation}' is incorrect. The attribute value should be comma-separated list of property names. /// public static string InvalidPropertyListOnNavigation([CanBeNull] object navigation, [CanBeNull] object entityType) => string.Format( - GetString("InvalidPropertyListOnNavigation", nameof(navigation), nameof(entityType)), + GetString("InvalidPropertyListOnNavigation", "0_navigation", "1_entityType"), navigation, entityType); /// - /// Invalid relationship has been specified using InversePropertyAttribute and ForeignKeyAttribute. The navigation '{navigation}' in entity type '{entityType}' and the navigation '{referencedNavigation}' in entity type '{referencedEntityType}' are related by InversePropertyAttribute but the ForeignKeyAttribute specified for both navigations have different values. + /// Invalid relationship has been specified using InversePropertyAttribute and ForeignKeyAttribute. The navigation '{1_entityType}.{0_navigation}' and the navigation '{3_referencedEntityType}.{2_referencedNavigation}' are related by InversePropertyAttribute but the ForeignKeyAttribute specified for both navigations have different values. /// public static string InvalidRelationshipUsingDataAnnotations([CanBeNull] object navigation, [CanBeNull] object entityType, [CanBeNull] object referencedNavigation, [CanBeNull] object referencedEntityType) => string.Format( - GetString("InvalidRelationshipUsingDataAnnotations", nameof(navigation), nameof(entityType), nameof(referencedNavigation), nameof(referencedEntityType)), + GetString("InvalidRelationshipUsingDataAnnotations", "0_navigation", "1_entityType", "2_referencedNavigation", "3_referencedEntityType"), navigation, entityType, referencedNavigation, referencedEntityType); /// @@ -1316,11 +1316,11 @@ public static string InvalidSwitch([CanBeNull] object name, [CanBeNull] object v name, value); /// - /// The value for property '{property}' of entity type '{entityType}' cannot be set to a value of type '{valueType}' because its type is '{propertyType}'. + /// The value for property '{1_entityType}.{0_property}' cannot be set to a value of type '{valueType}' because its type is '{propertyType}'. /// public static string InvalidType([CanBeNull] object property, [CanBeNull] object entityType, [CanBeNull] object valueType, [CanBeNull] object propertyType) => string.Format( - GetString("InvalidType", nameof(property), nameof(entityType), nameof(valueType), nameof(propertyType)), + GetString("InvalidType", "0_property", "1_entityType", nameof(valueType), nameof(propertyType)), property, entityType, valueType, propertyType); /// @@ -1338,19 +1338,19 @@ public static string InvalidUseService([CanBeNull] object useService, [CanBeNull useService, useInternalServiceProvider, service); /// - /// The '{factory}' cannot create a value generator for property '{property}' on entity type '{entityType}'. Only integer properties are supported. + /// The '{factory}' cannot create a value generator for property '{2_entityType}.{1_property}'. Only integer properties are supported. /// public static string InvalidValueGeneratorFactoryProperty([CanBeNull] object factory, [CanBeNull] object property, [CanBeNull] object entityType) => string.Format( - GetString("InvalidValueGeneratorFactoryProperty", nameof(factory), nameof(property), nameof(entityType)), + GetString("InvalidValueGeneratorFactoryProperty", nameof(factory), "1_property", "2_entityType"), factory, property, entityType); /// - /// InversePropertyAttributes on navigation '{navigation}' in entity type '{entityType}' and on navigation '{referencedNavigation}' in entity type '{referencedEntityType}' are not pointing to each other. + /// InversePropertyAttributes on navigation '{1_entityType}.{0_navigation}' and on navigation '{3_referencedEntityType}.{2_referencedNavigation}' are not pointing to each other. /// public static string InversePropertyMismatch([CanBeNull] object navigation, [CanBeNull] object entityType, [CanBeNull] object referencedNavigation, [CanBeNull] object referencedEntityType) => string.Format( - GetString("InversePropertyMismatch", nameof(navigation), nameof(entityType), nameof(referencedNavigation), nameof(referencedEntityType)), + GetString("InversePropertyMismatch", "0_navigation", "1_entityType", "2_referencedNavigation", "3_referencedEntityType"), navigation, entityType, referencedNavigation, referencedEntityType); /// @@ -1424,35 +1424,35 @@ public static string KeyPropertiesWrongEntity([CanBeNull] object key, [CanBeNull key, entityType); /// - /// The property '{property}' on entity type '{entityType}' 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 {key}. /// public static string KeyPropertyCannotBeNullable([CanBeNull] object property, [CanBeNull] object entityType, [CanBeNull] object key) => string.Format( - GetString("KeyPropertyCannotBeNullable", nameof(property), nameof(entityType), nameof(key)), + GetString("KeyPropertyCannotBeNullable", "0_property", "1_entityType", nameof(key)), property, entityType, key); /// - /// The property '{property}' cannot be part of a key on '{entityType}' because it has value generation enabled and is contained in a foreign key defined on a derived entity type. + /// 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. /// public static string KeyPropertyInForeignKey([CanBeNull] object property, [CanBeNull] object entityType) => string.Format( - GetString("KeyPropertyInForeignKey", nameof(property), nameof(entityType)), + GetString("KeyPropertyInForeignKey", "0_property", "1_entityType"), property, entityType); /// - /// The property '{property}' on entity type '{entityType}' must be marked as read-only after it has been saved because it is part of a key. Key properties are always read-only once an entity has been saved for the first time. + /// The property '{1_entityType}.{0_property}' must be marked as read-only after it has been saved because it is part of a key. Key properties are always read-only once an entity has been saved for the first time. /// public static string KeyPropertyMustBeReadOnly([CanBeNull] object property, [CanBeNull] object entityType) => string.Format( - GetString("KeyPropertyMustBeReadOnly", nameof(property), nameof(entityType)), + GetString("KeyPropertyMustBeReadOnly", "0_property", "1_entityType"), property, entityType); /// - /// The property '{property}' on entity type '{entityType}' 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 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. /// public static string KeyReadOnly([CanBeNull] object property, [CanBeNull] object entityType) => string.Format( - GetString("KeyReadOnly", nameof(property), nameof(entityType)), + GetString("KeyReadOnly", "0_property", "1_entityType"), property, entityType); /// @@ -1472,11 +1472,11 @@ public static string LiteralGenerationNotSupported([CanBeNull] object type) type); /// - /// The specified field '{field}' could not be found for property '{property}' on entity type '{entityType}'. + /// The specified field '{field}' could not be found for property '{2_entityType}.{1_property}'. /// public static string MissingBackingField([CanBeNull] object field, [CanBeNull] object property, [CanBeNull] object entityType) => string.Format( - GetString("MissingBackingField", nameof(field), nameof(property), nameof(entityType)), + GetString("MissingBackingField", nameof(field), "1_property", "2_entityType"), field, property, entityType); /// @@ -1568,27 +1568,27 @@ public static string NamedIndexWrongType([CanBeNull] object indexName, [CanBeNul indexName, entityType); /// - /// The type of navigation property '{navigation}' on the entity type '{entityType}' 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 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( - GetString("NavigationArray", nameof(navigation), nameof(entityType), nameof(foundType)), + GetString("NavigationArray", "0_navigation", "1_entityType", nameof(foundType)), navigation, entityType, foundType); /// - /// The type of navigation property '{navigation}' on the entity type '{entityType}' 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}' 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( - GetString("NavigationBadType", nameof(navigation), nameof(entityType), nameof(foundType), nameof(targetType)), + GetString("NavigationBadType", "0_navigation", "1_entityType", nameof(foundType), nameof(targetType)), navigation, entityType, foundType, targetType); /// - /// The type of navigation property '{navigation}' on the entity type '{entityType}' 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 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<>. /// public static string NavigationCannotCreateType([CanBeNull] object navigation, [CanBeNull] object entityType, [CanBeNull] object foundType) => string.Format( - GetString("NavigationCannotCreateType", nameof(navigation), nameof(entityType), nameof(foundType)), + GetString("NavigationCannotCreateType", "0_navigation", "1_entityType", nameof(foundType)), navigation, entityType, foundType); /// @@ -1600,27 +1600,27 @@ public static string NavigationCollectionWrongClrType([CanBeNull] object navigat navigation, entityType, clrType, targetType); /// - /// The navigation property '{navigation}' on entity type '{entityType}' cannot be associated with foreign key {targetFk} because it was created for foreign key {actualFk}. + /// The navigation property '{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( - GetString("NavigationForWrongForeignKey", nameof(navigation), nameof(entityType), nameof(targetFk), nameof(actualFk)), + GetString("NavigationForWrongForeignKey", "0_navigation", "1_entityType", nameof(targetFk), nameof(actualFk)), navigation, entityType, targetFk, actualFk); /// - /// The property '{property}' on entity type '{entityType}' 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 property. 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) => string.Format( - GetString("NavigationIsProperty", nameof(property), nameof(entityType), nameof(ReferenceMethod), nameof(CollectionMethod), nameof(PropertyMethod)), + GetString("NavigationIsProperty", "0_property", "1_entityType", nameof(ReferenceMethod), nameof(CollectionMethod), nameof(PropertyMethod)), property, entityType, ReferenceMethod, CollectionMethod, PropertyMethod); /// - /// The navigation property '{navigation}' on the entity type '{entityType}' 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 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. /// public static string NavigationNoSetter([CanBeNull] object navigation, [CanBeNull] object entityType) => string.Format( - GetString("NavigationNoSetter", nameof(navigation), nameof(entityType)), + GetString("NavigationNoSetter", "0_navigation", "1_entityType"), navigation, entityType); /// @@ -1656,20 +1656,20 @@ public static string NavigationToShadowEntity([CanBeNull] object navigation, [Ca navigation, entityType, targetType); /// - /// No field was found backing property '{property}' of entity type '{entity}'. 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 '{pam}'. /// - public static string NoBackingField([CanBeNull] object property, [CanBeNull] object entity, [CanBeNull] object pam) + public static string NoBackingField([CanBeNull] object property, [CanBeNull] object entityType, [CanBeNull] object pam) => string.Format( - GetString("NoBackingField", nameof(property), nameof(entity), nameof(pam)), - property, entity, pam); + GetString("NoBackingField", "0_property", "1_entityType", nameof(pam)), + property, entityType, pam); /// - /// No field was found backing property '{property}' of entity type '{entity}'. 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. + /// 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. /// - public static string NoBackingFieldLazyLoading([CanBeNull] object property, [CanBeNull] object entity) + public static string NoBackingFieldLazyLoading([CanBeNull] object property, [CanBeNull] object entityType) => string.Format( - GetString("NoBackingFieldLazyLoading", nameof(property), nameof(entity)), - property, entity); + GetString("NoBackingFieldLazyLoading", "0_property", "1_entityType"), + 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. @@ -1726,28 +1726,28 @@ public static string NoEfServices => GetString("NoEfServices"); /// - /// No backing field could be found for property '{property}' of entity type '{entity}' and the property does not have a getter. + /// No backing field could be found for property '{1_entityType}.{0_property}' and the property does not have a getter. /// - public static string NoFieldOrGetter([CanBeNull] object property, [CanBeNull] object entity) + public static string NoFieldOrGetter([CanBeNull] object property, [CanBeNull] object entityType) => string.Format( - GetString("NoFieldOrGetter", nameof(property), nameof(entity)), - property, entity); + GetString("NoFieldOrGetter", "0_property", "1_entityType"), + property, entityType); /// - /// No backing field could be found for property '{property}' of entity type '{entity}' and the property does not have a setter. + /// No backing field could be found for property '{1_entityType}.{0_property}' and the property does not have a setter. /// - public static string NoFieldOrSetter([CanBeNull] object property, [CanBeNull] object entity) + public static string NoFieldOrSetter([CanBeNull] object property, [CanBeNull] object entityType) => string.Format( - GetString("NoFieldOrSetter", nameof(property), nameof(entity)), - property, entity); + GetString("NoFieldOrSetter", "0_property", "1_entityType"), + property, entityType); /// - /// The property '{property}' of entity type '{entity}' 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 '{pam}'. /// - public static string NoGetter([CanBeNull] object property, [CanBeNull] object entity, [CanBeNull] object pam) + public static string NoGetter([CanBeNull] object property, [CanBeNull] object entityType, [CanBeNull] object pam) => string.Format( - GetString("NoGetter", nameof(property), nameof(entity), nameof(pam)), - property, entity, pam); + GetString("NoGetter", "0_property", "1_entityType", nameof(pam)), + property, entityType, pam); /// /// 'InterceptionResult.Result' was called when 'InterceptionResult.HasResult' is false. @@ -1788,11 +1788,11 @@ public static string NonComparableKeyTypes([CanBeNull] object entityType, [CanBe entityType, property, modelType, providerType); /// - /// The navigation '{navigation}' on '{entityType}' 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 using Fluent API 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( - GetString("NonConfiguredNavigationToSharedType", nameof(navigation), nameof(entityType)), + GetString("NonConfiguredNavigationToSharedType", "0_navigation", "1_entityType"), navigation, entityType); /// @@ -1812,19 +1812,19 @@ public static string NonGenericOptions([CanBeNull] object contextType) contextType); /// - /// Cannot add property '{property}' on entity type '{entity}' since there is no indexer on '{entity}' taking a single argument of type '{type}'. + /// Cannot add property '{1_entityType}.{0_property}' since there is no indexer on '{1_entityType}' taking a single argument of type '{type}'. /// - public static string NonIndexerEntityType([CanBeNull] object property, [CanBeNull] object entity, [CanBeNull] object type) + public static string NonIndexerEntityType([CanBeNull] object property, [CanBeNull] object entityType, [CanBeNull] object type) => string.Format( - GetString("NonIndexerEntityType", nameof(property), nameof(entity), nameof(type)), - property, entity, type); + GetString("NonIndexerEntityType", "0_property", "1_entityType", nameof(type)), + property, entityType, type); /// - /// The collection type being used for navigation property '{navigation}' on entity type '{entityType}' 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 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. /// public static string NonNotifyingCollection([CanBeNull] object navigation, [CanBeNull] object entityType, [CanBeNull] object changeTrackingStrategy) => string.Format( - GetString("NonNotifyingCollection", nameof(navigation), nameof(entityType), nameof(changeTrackingStrategy)), + GetString("NonNotifyingCollection", "0_navigation", "1_entityType", nameof(changeTrackingStrategy)), navigation, entityType, changeTrackingStrategy); /// @@ -1890,12 +1890,12 @@ public static string NoProviderConfiguredFailedToResolveService([CanBeNull] obje service); /// - /// The property '{property}' of entity type '{entity}' 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 '{pam}'. /// - public static string NoSetter([CanBeNull] object property, [CanBeNull] object entity, [CanBeNull] object pam) + public static string NoSetter([CanBeNull] object property, [CanBeNull] object entityType, [CanBeNull] object pam) => string.Format( - GetString("NoSetter", nameof(property), nameof(entity), nameof(pam)), - property, entity, pam); + GetString("NoSetter", "0_property", "1_entityType", nameof(pam)), + property, entityType, pam); /// /// 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,11 +1920,11 @@ public static string NotQueryingEnumerable => GetString("NotQueryingEnumerable"); /// - /// The '{property}' on entity type '{entityType}' 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}'. /// public static string NoValueGenerator([CanBeNull] object property, [CanBeNull] object entityType, [CanBeNull] object propertyType) => string.Format( - GetString("NoValueGenerator", nameof(property), nameof(entityType), nameof(propertyType)), + GetString("NoValueGenerator", "0_property", "1_entityType", nameof(propertyType)), property, entityType, propertyType); /// @@ -1944,11 +1944,11 @@ public static string OptionsExtensionNotFound([CanBeNull] object optionsExtensio optionsExtension); /// - /// The original value for property '{property}' of entity type '{entityType}' cannot be accessed because it is not being tracked. Original values are not recorded for most properties of entities when the 'ChangingAndChangedNotifications' strategy is used. To access all original values use a different change tracking strategy such as 'ChangingAndChangedNotificationsWithOriginalValues'. + /// The original value for property '{1_entityType}.{0_property}' cannot be accessed because it is not being tracked. Original values are not recorded for most properties of entities when the 'ChangingAndChangedNotifications' strategy is used. To access all original values use a different change tracking strategy such as 'ChangingAndChangedNotificationsWithOriginalValues'. /// public static string OriginalValueNotTracked([CanBeNull] object property, [CanBeNull] object entityType) => string.Format( - GetString("OriginalValueNotTracked", nameof(property), nameof(entityType)), + GetString("OriginalValueNotTracked", "0_property", "1_entityType"), property, entityType); /// @@ -2028,15 +2028,15 @@ public static string PropertyClashingNonIndexer([CanBeNull] object property, [Ca property, entityType); /// - /// The property '{property}' on entity type '{entityType}' is marked as null, but this cannot be saved because the property is marked as required. Consider using 'DbContextOptionsBuilder.EnableSensitiveDataLogging' to see the key values. + /// The property '{1_entityType}.{0_property}' is marked as null, but this cannot be saved because the property is marked as required. Consider using 'DbContextOptionsBuilder.EnableSensitiveDataLogging' to see the key values. /// public static string PropertyConceptualNull([CanBeNull] object property, [CanBeNull] object entityType) => string.Format( - GetString("PropertyConceptualNull", nameof(property), nameof(entityType)), + GetString("PropertyConceptualNull", "0_property", "1_entityType"), property, entityType); /// - /// The property '{property}' is marked as null on entity '{entityType}' with the key value '{keyValue}', but this cannot be saved because the property is marked as required. + /// The property '{property}' is marked as null on entity '{entityType}' with the key value '{keyValue}', but this cannot be saved because the property is marked as required. /// public static string PropertyConceptualNullSensitive([CanBeNull] object property, [CanBeNull] object entityType, [CanBeNull] object keyValue) => string.Format( @@ -2076,12 +2076,12 @@ public static string PropertyInUseKey([CanBeNull] object property, [CanBeNull] o property, entityType, key); /// - /// The property '{property}' on entity type '{entityType}' 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 property. 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) + public static string PropertyIsNavigation([CanBeNull] object property, [CanBeNull] object entityType, [CanBeNull] object propertyMethod, [CanBeNull] object referenceMethod, [CanBeNull] object collectionMethod) => string.Format( - GetString("PropertyIsNavigation", nameof(property), nameof(entityType), nameof(PropertyMethod), nameof(ReferenceMethod), nameof(CollectionMethod)), - property, entityType, PropertyMethod, ReferenceMethod, CollectionMethod); + GetString("PropertyIsNavigation", "0_property", "1_entityType", nameof(propertyMethod), nameof(referenceMethod), nameof(collectionMethod)), + property, entityType, propertyMethod, referenceMethod, collectionMethod); /// /// The EF.Property<T> method may only be used within LINQ queries. @@ -2098,11 +2098,11 @@ public static string PropertyNotAdded([CanBeNull] object entityType, [CanBeNull] entityType, property, propertyType); /// - /// The property '{property}' on entity type '{entityType}' could not be found. Ensure that the property exists and has been included in the model. + /// The property '{1_entityType}.{0_property}' could not be found. Ensure that the property exists and has been included in the model. /// public static string PropertyNotFound([CanBeNull] object property, [CanBeNull] object entityType) => string.Format( - GetString("PropertyNotFound", nameof(property), nameof(entityType)), + GetString("PropertyNotFound", "0_property", "1_entityType"), property, entityType); /// @@ -2114,19 +2114,19 @@ public static string PropertyNotMapped([CanBeNull] object entityType, [CanBeNull entityType, property, propertyType); /// - /// The property '{property}' on entity type '{entityType}' is defined to be read-only after it has been saved, but its value has been modified or marked as modified. + /// The property '{1_entityType}.{0_property}' is defined to be read-only after it has been saved, but its value has been modified or marked as modified. /// public static string PropertyReadOnlyAfterSave([CanBeNull] object property, [CanBeNull] object entityType) => string.Format( - GetString("PropertyReadOnlyAfterSave", nameof(property), nameof(entityType)), + GetString("PropertyReadOnlyAfterSave", "0_property", "1_entityType"), property, entityType); /// - /// The property '{property}' on entity type '{entityType}' is defined to be read-only before it is saved, but its value has been set to something other than a temporary or default value. + /// The property '{1_entityType}.{0_property}' is defined to be read-only before it is saved, but its value has been set to something other than a temporary or default value. /// public static string PropertyReadOnlyBeforeSave([CanBeNull] object property, [CanBeNull] object entityType) => string.Format( - GetString("PropertyReadOnlyBeforeSave", nameof(property), nameof(entityType)), + GetString("PropertyReadOnlyBeforeSave", "0_property", "1_entityType"), property, entityType); /// @@ -2250,19 +2250,19 @@ public static string ReferencedShadowKey([CanBeNull] object referencingEntityTyp referencingEntityTypeOrNavigation, referencedEntityTypeOrNavigation, foreignKeyPropertiesWithTypes, primaryKeyPropertiesWithTypes); /// - /// The property '{property}' on entity type '{entityType}' 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 property. 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) => string.Format( - GetString("ReferenceIsCollection", nameof(property), nameof(entityType), nameof(ReferenceMethod), nameof(CollectionMethod)), + GetString("ReferenceIsCollection", "0_property", "1_entityType", nameof(ReferenceMethod), nameof(CollectionMethod)), property, entityType, ReferenceMethod, CollectionMethod); /// - /// Navigation property '{navigation}' on entity type '{entityType}' cannot have 'IsLoaded' set to false because the referenced entity is non-null and therefore is loaded. + /// Navigation property '{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( - GetString("ReferenceMustBeLoaded", nameof(navigation), nameof(entityType)), + GetString("ReferenceMustBeLoaded", "0_navigation", "1_entityType"), navigation, entityType); /// @@ -2396,11 +2396,11 @@ public static string SeedDatumSignedNumericValue([CanBeNull] object entityType, entityType, property); /// - /// A relationship cannot be established from property '{property}' on type '{entityType}' to property '{referencedProperty}' on type '{referencedEntityType}'. Check the values in the InversePropertyAttribute 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 InversePropertyAttribute to ensure relationship definitions are unique and reference from one navigation property to its corresponding inverse navigation property. /// public static string SelfReferencingNavigationWithInverseProperty([CanBeNull] object property, [CanBeNull] object entityType, [CanBeNull] object referencedProperty, [CanBeNull] object referencedEntityType) => string.Format( - GetString("SelfReferencingNavigationWithInverseProperty", nameof(property), nameof(entityType), nameof(referencedProperty), nameof(referencedEntityType)), + GetString("SelfReferencingNavigationWithInverseProperty", "0_property", "1_entityType", "2_referencedProperty", "3_referencedEntityType"), property, entityType, referencedProperty, referencedEntityType); /// @@ -2494,19 +2494,19 @@ public static string SkipInverseMismatchedJoinType([CanBeNull] object inverse, [ inverse, inverseJoinType, navigation, joinType); /// - /// The foreign key {foreignKey} cannot be used for the skip navigation property '{navigation}' on the entity type '{entityType}' 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 dependent entity type '{dependentEntityType}'. /// public static string SkipNavigationForeignKeyWrongDependentType([CanBeNull] object foreignKey, [CanBeNull] object navigation, [CanBeNull] object entityType, [CanBeNull] object dependentEntityType) => string.Format( - GetString("SkipNavigationForeignKeyWrongDependentType", nameof(foreignKey), nameof(navigation), nameof(entityType), nameof(dependentEntityType)), + GetString("SkipNavigationForeignKeyWrongDependentType", nameof(foreignKey), "1_navigation", "2_entityType", nameof(dependentEntityType)), foreignKey, navigation, entityType, dependentEntityType); /// - /// The foreign key {foreignKey} cannot be used for the skip navigation property '{navigation}' on the entity type '{entityType}' because it is expected to be on the principal entity type '{principalEntityType}'. + /// 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}'. /// public static string SkipNavigationForeignKeyWrongPrincipalType([CanBeNull] object foreignKey, [CanBeNull] object navigation, [CanBeNull] object entityType, [CanBeNull] object principalEntityType) => string.Format( - GetString("SkipNavigationForeignKeyWrongPrincipalType", nameof(foreignKey), nameof(navigation), nameof(entityType), nameof(principalEntityType)), + GetString("SkipNavigationForeignKeyWrongPrincipalType", nameof(foreignKey), "1_navigation", "2_entityType", nameof(principalEntityType)), foreignKey, navigation, entityType, principalEntityType); /// @@ -2518,27 +2518,27 @@ public static string SkipNavigationInUseBySkipNavigation([CanBeNull] object skip skipNavigation, inverseSkipNavigation, referencingEntityType); /// - /// The skip navigation '{navigation}' on entity type '{entityType}' doesn't have a foreign key associated with it. Every skip navigation should have a configured foreign key. + /// The skip navigation '{1_entityType}.{0_navigation}' doesn't have a foreign key associated with it. Every skip navigation should have a configured foreign key. /// public static string SkipNavigationNoForeignKey([CanBeNull] object navigation, [CanBeNull] object entityType) => string.Format( - GetString("SkipNavigationNoForeignKey", nameof(navigation), nameof(entityType)), + GetString("SkipNavigationNoForeignKey", "0_navigation", "1_entityType"), navigation, entityType); /// - /// The skip navigation '{navigation}' on entity type '{entityType}' doesn't have an inverse configured. Every skip navigation should have an inverse skip navigation. + /// The skip navigation '{1_entityType}.{0_navigation}' doesn't have an inverse configured. Every skip navigation should have an inverse skip navigation. /// public static string SkipNavigationNoInverse([CanBeNull] object navigation, [CanBeNull] object entityType) => string.Format( - GetString("SkipNavigationNoInverse", nameof(navigation), nameof(entityType)), + GetString("SkipNavigationNoInverse", "0_navigation", "1_entityType"), navigation, entityType); /// - /// The skip navigation '{navigation}' on entity type '{entityType}' is not a collection. Only collection skip navigation properties are currently supported. + /// The skip navigation '{1_entityType}.{0_navigation}' is not a collection. Only collection skip navigation properties are currently supported. /// public static string SkipNavigationNonCollection([CanBeNull] object navigation, [CanBeNull] object entityType) => string.Format( - GetString("SkipNavigationNonCollection", nameof(navigation), nameof(entityType)), + GetString("SkipNavigationNonCollection", "0_navigation", "1_entityType"), navigation, entityType); /// @@ -2558,27 +2558,27 @@ public static string SkipNavigationWrongType([CanBeNull] object navigation, [Can navigation, entityType, otherEntityType); /// - /// The property '{property}' on entity type '{entityType}' cannot be assigned a value generated by the database. Store-generated values can only be assigned to properties configured to use store-generated values. + /// 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. /// public static string StoreGenValue([CanBeNull] object property, [CanBeNull] object entityType) => string.Format( - GetString("StoreGenValue", nameof(property), nameof(entityType)), + GetString("StoreGenValue", "0_property", "1_entityType"), property, entityType); /// - /// The property '{property}' on entity type '{entityType}' cannot be assigned a temporary value. Temporary values can only be assigned to properties configured to use store-generated values. + /// The property '{1_entityType}.{0_property}' cannot be assigned a temporary value. Temporary values can only be assigned to properties configured to use store-generated values. /// public static string TempValue([CanBeNull] object property, [CanBeNull] object entityType) => string.Format( - GetString("TempValue", nameof(property), nameof(entityType)), + GetString("TempValue", "0_property", "1_entityType"), property, entityType); /// - /// The property '{property}' on entity type '{entityType}' has a temporary value while attempting to change the entity's state to '{state}'. Either set a permanent value explicitly or ensure that the database is configured to generate values for this property. + /// The property '{1_entityType}.{0_property}' has a temporary value while attempting to change the entity's state to '{state}'. Either set a permanent value explicitly or ensure that the database is configured to generate values for this property. /// public static string TempValuePersists([CanBeNull] object property, [CanBeNull] object entityType, [CanBeNull] object state) => string.Format( - GetString("TempValuePersists", nameof(property), nameof(entityType), nameof(state)), + GetString("TempValuePersists", "0_property", "1_entityType", nameof(state)), property, entityType, state); /// @@ -2628,11 +2628,11 @@ public static string UnableToDiscriminate([CanBeNull] object entityType, [CanBeN entityType, discriminator); /// - /// Unable to set IsUnique to '{isUnique}' on the relationship underlying the navigation property '{navigationName}' on the entity type '{entityType}' because the navigation property has the opposite multiplicity. + /// 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. /// public static string UnableToSetIsUnique([CanBeNull] object isUnique, [CanBeNull] object navigationName, [CanBeNull] object entityType) => string.Format( - GetString("UnableToSetIsUnique", nameof(isUnique), nameof(navigationName), nameof(entityType)), + GetString("UnableToSetIsUnique", nameof(isUnique), "1_navigationName", "2_entityType"), isUnique, navigationName, entityType); /// @@ -2700,11 +2700,11 @@ public static string UntrackedDependentEntity([CanBeNull] object entityType, [Ca entityType, referenceCall, collectionCall); /// - /// The value for property '{property}' of entity type '{entityType}' cannot be set to null because its type is '{propertyType}' which is not a nullable type. + /// The value for property '{1_entityType}.{0_property}' cannot be set to null because its type is '{propertyType}' which is not a nullable type. /// public static string ValueCannotBeNull([CanBeNull] object property, [CanBeNull] object entityType, [CanBeNull] object propertyType) => string.Format( - GetString("ValueCannotBeNull", nameof(property), nameof(entityType), nameof(propertyType)), + GetString("ValueCannotBeNull", "0_property", "1_entityType", nameof(propertyType)), property, entityType, propertyType); /// @@ -2748,11 +2748,11 @@ public static string WeakDerivedType([CanBeNull] object entityType) entityType); /// - /// Property '{property}' on entity type '{entityType}' is of type '{actualType}' but the generic type provided is of type '{genericType}'. + /// Property '{1_entityType}.{0_property}' is of type '{actualType}' but the generic type provided is of type '{genericType}'. /// public static string WrongGenericPropertyType([CanBeNull] object property, [CanBeNull] object entityType, [CanBeNull] object actualType, [CanBeNull] object genericType) => string.Format( - GetString("WrongGenericPropertyType", nameof(property), nameof(entityType), nameof(actualType), nameof(genericType)), + GetString("WrongGenericPropertyType", "0_property", "1_entityType", nameof(actualType), nameof(genericType)), property, entityType, actualType, genericType); /// @@ -2958,7 +2958,7 @@ public static EventDefinition LogCollectionCha } /// - /// The property '{property}' on entity type '{entityType}' is a collection or enumeration type with a value converter but with no value comparer. Set a value comparer to ensure the collection/enumeration elements are compared correctly. + /// The property '{1_entityType}.{0_property}' is a collection or enumeration type with a value converter but with no value comparer. Set a value comparer to ensure the collection/enumeration elements are compared correctly. /// public static EventDefinition LogCollectionWithoutComparer([NotNull] IDiagnosticsLogger logger) { @@ -3438,7 +3438,7 @@ public static EventDefinition LogInvalidIncludePath([NotNull] ID } /// - /// An attempt was made to lazy-load navigation property '{navigation}' on entity type '{entityType}' after the associated DbContext was disposed. + /// An attempt was made to lazy-load navigation property '{1_entityType}.{0_navigation}' after the associated DbContext was disposed. /// public static EventDefinition LogLazyLoadOnDisposedContext([NotNull] IDiagnosticsLogger logger) { @@ -3582,7 +3582,7 @@ public static EventDefinition LogNavigationBaseIncluded([NotNull] IDiagn } /// - /// Navigation property '{navigation}' of entity type '{entityType}' is being lazy-loaded. + /// Navigation property '{1_entityType}.{0_navigation}' is being lazy-loaded. /// public static EventDefinition LogNavigationLazyLoading([NotNull] IDiagnosticsLogger logger) { @@ -4308,7 +4308,7 @@ public static EventDefinition LogServiceProviderDebugInfo([NotNull] IDia } /// - /// The property '{property}' on entity type '{entityType}' was created in shadow state because there are no eligible CLR members with a matching name. + /// The property '{1_entityType}.{0_property}' was created in shadow state because there are no eligible CLR members with a matching name. /// public static EventDefinition LogShadowPropertyCreated([NotNull] IDiagnosticsLogger logger) { @@ -4476,7 +4476,7 @@ public static EventDefinition } /// - /// '{contextType}' generated a temporary value for the '{property}' property of new '{entityType}' entity. Consider using 'DbContextOptionsBuilder.EnableSensitiveDataLogging' to see key values. + /// '{contextType}' generated a temporary value for the property '{2_entityType}.{1_property}'. Consider using 'DbContextOptionsBuilder.EnableSensitiveDataLogging' to see key values. /// public static EventDefinition LogTempValueGenerated([NotNull] IDiagnosticsLogger logger) { @@ -4500,7 +4500,7 @@ public static EventDefinition LogTempValueGenerated([Not } /// - /// '{contextType}' generated temporary value '{keyValue}' for the '{property}' property of new '{entityType}' entity. + /// '{contextType}' generated temporary value '{keyValue}' for the property '{3_entityType}.{2_property}'. /// public static EventDefinition LogTempValueGeneratedSensitive([NotNull] IDiagnosticsLogger logger) { @@ -4524,7 +4524,7 @@ public static EventDefinition LogTempValueGenera } /// - /// '{contextType}' generated a value for the '{property}' property of new '{entityType}' entity. Consider using 'DbContextOptionsBuilder.EnableSensitiveDataLogging' to see key values. + /// '{contextType}' generated a value for the property '{2_entityType}.{1_property}'. Consider using 'DbContextOptionsBuilder.EnableSensitiveDataLogging' to see key values. /// public static EventDefinition LogValueGenerated([NotNull] IDiagnosticsLogger logger) { @@ -4548,7 +4548,7 @@ public static EventDefinition LogValueGenerated([NotNull } /// - /// '{contextType}' generated value '{keyValue}' for the '{property}' property of new '{entityType}' entity. + /// '{contextType}' generated value '{keyValue}' for the property '{3_entityType}.{2_property}'. /// public static EventDefinition LogValueGeneratedSensitive([NotNull] IDiagnosticsLogger logger) { diff --git a/src/EFCore/Properties/CoreStrings.resx b/src/EFCore/Properties/CoreStrings.resx index 61e499d3b3f..6b8f09f5752 100644 --- a/src/EFCore/Properties/CoreStrings.resx +++ b/src/EFCore/Properties/CoreStrings.resx @@ -1,17 +1,17 @@  - @@ -127,7 +127,7 @@ 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. - '{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 {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 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. @@ -136,7 +136,7 @@ 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. - 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 without specifying the inverse. See http://go.microsoft.com/fwlink/?LinkId=724062 for more details. + 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. Unable to determine the owner for the relationship between '{entityTypeNavigationSpecification}' and '{otherEntityType}' as both types have been marked as owned. Either manually configure the ownership, or ignore the corresponding navigations using the '[NotMapped]' attribute or by using 'EntityTypeBuilder.Ignore' in 'OnModelCreating'. @@ -154,34 +154,34 @@ Cannot add an entity type with type '{typeName}'. That type is a dynamically-generated proxy type. - Cannot set backing field '{field}' for the indexer property '{entityType}.{property}'. Indexer properties are not allowed to use a backing field. + Cannot set backing field '{field}' for the indexer property '{entityType}.{property}'. Ensure no backing fields are specified for indexer properties. - The specified field '{field}' of type '{fieldType}' cannot be used for the property '{entityType}.{property}' of type '{propertyType}'. Only backing fields of types that are assignable from the property type can be used. + The specified field '{field}' of type '{fieldType}' cannot be used for the property '{entityType}.{property}' of type '{propertyType}'. Only backing fields of types that are compatible with the property type can be used. - The service dependencies type '{dependenciesType}' has been registered inappropriately in the service collection. Service dependencies types must only be registered by Entity Framework, or in rare cases by database providers and then only to change the service lifetime. + 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}' specified for entity type '{entityType}' is invalid. The expression must accept a single parameter of type '{clrType}', return bool, and may not contain references to navigation properties. + The filter expression '{filter}' specified for entity type '{entityType}' is invalid. The expression must accept a single parameter of type '{clrType}' and return bool. - The filter expression '{filter}' cannot be specified for entity type '{entityType}'. A filter may only be applied to the entity that is not owned. + The filter expression '{filter}' cannot be specified for owned entity type '{entityType}'. A filter may only be applied to the entity that is not owned. - The type '{givenType}' cannot be used as a value generator because it does not inherit from '{expectedType}'. + The type '{givenType}' cannot be used as a value generator because it does not inherit from '{expectedType}'. Make sure to inherit value generators from '{expectedType}'. The current database provider has not implemented the 'CanConnect' method. - The property '{property}' on entity type '{entityType}' cannot be marked as nullable/optional because the type of the property is '{propertyType}' which is not a nullable type. Any property can be marked as non-nullable/required, but only properties of nullable types and which are not part of primary key can be marked as nullable/optional. + The property '{1_entityType}.{0_property}' cannot be marked as nullable/optional because the type of the property is '{propertyType}' which is not a nullable type. Any property can be marked as non-nullable/required, but only properties of nullable types can be marked as nullable/optional. - The property '{property}' on entity type '{entityType}' cannot be marked as nullable/optional because the property is a part of a key. Any property can be marked as non-nullable/required, but only properties of nullable types and which are not part of a key can be marked as nullable/optional. + The property '{1_entityType}.{0_property}' cannot be marked as nullable/optional because the property is a part of a key. Any property can be marked as non-nullable/required, but only properties of nullable types and which are not part of a key can be marked as nullable/optional. Unable to convert queryable method to enumerable method. @@ -190,28 +190,28 @@ Cannot create instance of value generator type '{generatorType}'. Ensure that the type is instantiable and has a parameterless constructor, or use the overload of HasValueGenerator that accepts a delegate. - Navigation property '{navigation}' on entity of type '{entityType}' cannot be loaded because the entity is not being tracked. Navigation properties can only be loaded for tracked entities. + The navigation '{1_entityType}.{0_navigation}' cannot be loaded because the entity is not being tracked. Navigations can only be loaded for tracked entities. - Type '{type}' cannot be marked as shared type since entity type with same CLR type exists in the model. + The type '{type}' cannot be marked as a shared type since an entity type with the same CLR type already exists in the model. - Unable to create an instance of type entity type '{entityType}' because it is abstract. Either make it non-abstract or consider mapping at least one derived type. + Unable to create an instance of entity type '{entityType}' because it is abstract. Either make it non-abstract or consider mapping at least one derived type. - There is no navigation property with name '{navigationName}' on entity type '{entityType}'. Please add the navigation to the entity type before configuring it. + There is no navigation '{1_entityType}.{0_navigationName}'. Please add the navigation to the entity type before configuring it. - The entity type '{entityType}' is configured to use the '{changeTrackingStrategy}' change tracking strategy but does not implement the required '{notificationInterface}' interface. + The entity type '{entityType}' is configured to use the '{changeTrackingStrategy}' change tracking strategy but does not implement the required '{notificationInterface}' interface. Implement '{notificationInterface}' on '{entityType}' or use a different change tracking strategy. Unable to save changes because a circular dependency was detected in the data to be saved: '{cycle}'. - The entity type '{entityType}' cannot inherit from '{baseEntityType}' because '{baseEntityType}' is a descendant of '{entityType}'. + The entity type '{entityType}' cannot inherit from '{baseEntityType}' because '{baseEntityType}' is a descendant of '{entityType}'. Review your model configuration. - The shared type entity type '{entityType}' cannot be added to the model because a shared entity type with the same name but different clr type '{otherClrType}' already exists. + 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}'. @@ -250,13 +250,13 @@ 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 '{property}' on entity type '{entityType}' 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 property. Use the '{ReferenceMethod}' method to access reference navigation properties. Comparer for type '{type}' cannot be used for '{entityType}.{propertyName}' because its type is '{propertyType}'. - There are multiple properties pointing to navigation '{navigation}' in entity type '{entityType}'. To define composite foreign key using data annotations, use ForeignKeyAttribute on navigation. + There are multiple properties pointing to navigation '{1_entityType}.{0_navigation}'. To define composite foreign key using data annotations, use ForeignKeyAttribute on navigation. Entity type '{entityType}' has composite primary key defined with data annotations. To set composite primary key, use fluent API. @@ -265,7 +265,7 @@ 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 '{property}' on entity type '{entityType}' 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 ForeignKeyAttributes which are pointing to same set of properties - '{propertyList}' on entity type '{entityType}'. @@ -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 InversePropertyAttribute on property '{property}' on type '{entityType}' 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 InversePropertyAttribute 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 specified poolSize must be greater than 0. @@ -589,10 +589,10 @@ Obsolete - The property list specified using ForeignKeyAttribute on navigation '{navigation}' in entity type '{entityType}' is incorrect. The attribute value should be comma-separated list of property names. + The property list specified using ForeignKeyAttribute on navigation '{1_entityType}.{0_navigation}' is incorrect. The attribute value should be comma-separated list of property names. - Invalid relationship has been specified using InversePropertyAttribute and ForeignKeyAttribute. The navigation '{navigation}' in entity type '{entityType}' and the navigation '{referencedNavigation}' in entity type '{referencedEntityType}' are related by InversePropertyAttribute but the ForeignKeyAttribute specified for both navigations have different values. + Invalid relationship has been specified using InversePropertyAttribute and ForeignKeyAttribute. The navigation '{1_entityType}.{0_navigation}' and the navigation '{3_referencedEntityType}.{2_referencedNavigation}' are related by InversePropertyAttribute but the ForeignKeyAttribute specified for both navigations have different values. A call was made to '{replaceService}', 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 replacement services into the service provider before passing it to '{useInternalServiceProvider}'. @@ -616,7 +616,7 @@ Invalid {name}: {value} - The value for property '{property}' of entity type '{entityType}' cannot be set to a value of type '{valueType}' because its type is '{propertyType}'. + 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. @@ -625,10 +625,10 @@ 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}'. - The '{factory}' cannot create a value generator for property '{property}' on entity type '{entityType}'. Only integer properties are supported. + The '{factory}' cannot create a value generator for property '{2_entityType}.{1_property}'. Only integer properties are supported. - InversePropertyAttributes on navigation '{navigation}' in entity type '{entityType}' and on navigation '{referencedNavigation}' in entity type '{referencedEntityType}' are not pointing to each other. + InversePropertyAttributes on navigation '{1_entityType}.{0_navigation}' and on navigation '{3_referencedEntityType}.{2_referencedNavigation}' are not pointing to each other. The navigation '{principalEntityType}.{navigation}' is not supported because it is pointing to an owned entity type '{ownedType}'. Only the ownership navigation from the entity type '{ownerType}' can point to the owned entity type. @@ -658,16 +658,16 @@ The specified key properties {key} are not declared on the entity type '{entityType}'. Ensure key properties are declared on the target entity type. - The property '{property}' on entity type '{entityType}' 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 {key}. - The property '{property}' cannot be part of a key on '{entityType}' because it has value generation enabled and is contained in a foreign key defined on a derived entity type. + 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. - The property '{property}' on entity type '{entityType}' must be marked as read-only after it has been saved because it is part of a key. Key properties are always read-only once an entity has been saved for the first time. + The property '{1_entityType}.{0_property}' must be marked as read-only after it has been saved because it is part of a key. Key properties are always read-only once an entity has been saved for the first time. - The property '{property}' on entity type '{entityType}' 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 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}'. @@ -704,7 +704,7 @@ Debug CoreEventId.CollectionChangeDetected int int string string string - The property '{property}' on entity type '{entityType}' is a collection or enumeration type with a value converter but with no value comparer. Set a value comparer to ensure the collection/enumeration elements are compared correctly. + The property '{1_entityType}.{0_property}' is a collection or enumeration type with a value converter but with no value comparer. Set a value comparer to ensure the collection/enumeration elements are compared correctly. Warning CoreEventId.CollectionWithoutComparer string string @@ -784,7 +784,7 @@ Error CoreEventId.InvalidIncludePathError object object - An attempt was made to lazy-load navigation property '{navigation}' on entity type '{entityType}' after the associated DbContext was disposed. + An attempt was made to lazy-load navigation property '{1_entityType}.{0_navigation}' after the associated DbContext was disposed. Warning CoreEventId.LazyLoadOnDisposedContextWarning string string @@ -808,7 +808,7 @@ Debug CoreEventId.NavigationBaseIncluded string - Navigation property '{navigation}' of entity type '{entityType}' is being lazy-loaded. + Navigation property '{1_entityType}.{0_navigation}' is being lazy-loaded. Debug CoreEventId.NavigationLazyLoading string string @@ -928,7 +928,7 @@ Debug CoreEventId.ServiceProviderDebugInfo string - The property '{property}' on entity type '{entityType}' was created in shadow state because there are no eligible CLR members with a matching name. + The property '{1_entityType}.{0_property}' was created in shadow state because there are no eligible CLR members with a matching name. Debug CoreEventId.ShadowPropertyCreated string string @@ -956,23 +956,23 @@ Debug CoreEventId.StateChanged string string string EntityState EntityState - '{contextType}' generated a temporary value for the '{property}' property of new '{entityType}' entity. Consider using 'DbContextOptionsBuilder.EnableSensitiveDataLogging' to see key values. + '{contextType}' generated a temporary value for the property '{2_entityType}.{1_property}'. Consider using 'DbContextOptionsBuilder.EnableSensitiveDataLogging' to see key values. Debug CoreEventId.ValueGenerated string string string - '{contextType}' generated temporary value '{keyValue}' for the '{property}' property of new '{entityType}' entity. + '{contextType}' generated temporary value '{keyValue}' for the property '{3_entityType}.{2_property}'. Debug CoreEventId.ValueGenerated string object string string - '{contextType}' generated a value for the '{property}' property of new '{entityType}' entity. Consider using 'DbContextOptionsBuilder.EnableSensitiveDataLogging' to see key values. + '{contextType}' generated a value for the property '{2_entityType}.{1_property}'. Consider using 'DbContextOptionsBuilder.EnableSensitiveDataLogging' to see key values. Debug CoreEventId.ValueGenerated string string string - '{contextType}' generated value '{keyValue}' for the '{property}' property of new '{entityType}' entity. + '{contextType}' generated value '{keyValue}' for the property '{3_entityType}.{2_property}'. Debug CoreEventId.ValueGenerated string object string string - The specified field '{field}' could not be found for property '{property}' on entity type '{entityType}'. + 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. @@ -1008,25 +1008,25 @@ 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 '{navigation}' on the entity type '{entityType}' 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 is an array type. Collection navigation properties cannot be arrays. - The type of navigation property '{navigation}' on the entity type '{entityType}' 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}' which does not implement ICollection<{targetType}>. Collection navigation properties must implement ICollection<> of the target type. - The type of navigation property '{navigation}' on the entity type '{entityType}' 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 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 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 navigation property '{navigation}' on entity type '{entityType}' cannot be associated with foreign key {targetFk} because it was created for foreign key {actualFk}. + The navigation property '{1_entityType}.{0_navigation}' cannot be associated with foreign key {targetFk} because it was created for foreign key {actualFk}. - The property '{property}' on entity type '{entityType}' 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 property. Use the '{PropertyMethod}' method to access non-navigation properties. - The navigation property '{navigation}' on the entity type '{entityType}' 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 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. 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'. @@ -1041,10 +1041,10 @@ 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. - No field was found backing property '{property}' of entity type '{entity}'. 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 '{pam}'. - No field was found backing property '{property}' of entity type '{entity}'. 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. + 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. @@ -1068,13 +1068,13 @@ 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 '{property}' of entity type '{entity}' and the property does not have a getter. + No backing field could be found for property '{1_entityType}.{0_property}' and the property does not have a getter. - No backing field could be found for property '{property}' of entity type '{entity}' and the property does not have a setter. + No backing field could be found for property '{1_entityType}.{0_property}' and the property does not have a setter. - The property '{property}' of entity type '{entity}' 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 '{pam}'. 'InterceptionResult.Result' was called when 'InterceptionResult.HasResult' is false. @@ -1092,7 +1092,7 @@ 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 '{navigation}' on '{entityType}' 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 using Fluent API 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}' @@ -1101,10 +1101,10 @@ The DbContextOptions passed to the {contextType} constructor must be a DbContextOptions<{contextType}>. When registering multiple DbContext types make sure that the constructor for each context type has a DbContextOptions<TContext> parameter rather than a non-generic DbContextOptions parameter. - Cannot add property '{property}' on entity type '{entity}' since there is no indexer on '{entity}' taking a single argument of type '{type}'. + 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 '{navigation}' on entity type '{entityType}' 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 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 entity type '{entityType}' cannot inherit from '{baseEntityType}' because '{entityType}' is a shadow state entity type while '{baseEntityType}' is not. @@ -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 '{property}' of entity type '{entity}' 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 '{pam}'. 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 '{property}' on entity type '{entityType}' 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}'. 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. @@ -1152,7 +1152,7 @@ Options extension of type '{optionsExtension}' not found. - The original value for property '{property}' of entity type '{entityType}' cannot be accessed because it is not being tracked. Original values are not recorded for most properties of entities when the 'ChangingAndChangedNotifications' strategy is used. To access all original values use a different change tracking strategy such as 'ChangingAndChangedNotificationsWithOriginalValues'. + The original value for property '{1_entityType}.{0_property}' cannot be accessed because it is not being tracked. Original values are not recorded for most properties of entities when the 'ChangingAndChangedNotifications' strategy is used. To access all original values use a different change tracking strategy such as 'ChangingAndChangedNotificationsWithOriginalValues'. The owned entity type '{entityType}' cannot have a base type. @@ -1185,10 +1185,10 @@ The indexer property '{property}' cannot be added to type '{entityType}' because the CLR class contains a member with the same name. - The property '{property}' on entity type '{entityType}' is marked as null, but this cannot be saved because the property is marked as required. Consider using 'DbContextOptionsBuilder.EnableSensitiveDataLogging' to see the key values. + The property '{1_entityType}.{0_property}' is marked as null, but this cannot be saved because the property is marked as required. Consider using 'DbContextOptionsBuilder.EnableSensitiveDataLogging' to see the key values. - The property '{property}' is marked as null on entity '{entityType}' with the key value '{keyValue}', but this cannot be saved because the property is marked as required. + The property '{property}' is marked as null on entity '{entityType}' with the key value '{keyValue}', but this cannot be saved because the property is marked as required. The property '{property}' belongs to entity type '{entityType}' but is being used with an instance of entity type '{expectedType}'. @@ -1203,7 +1203,7 @@ 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}' on entity type '{entityType}' 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 property. Use either the '{referenceMethod}' or '{collectionMethod}' method to access navigation properties. The EF.Property<T> method may only be used within LINQ queries. @@ -1212,16 +1212,16 @@ The property '{entityType}.{property}' could not be mapped, because it is of type '{propertyType}' which is not a supported primitive type or a valid entity type. Either explicitly map this property, or ignore it using the '[NotMapped]' attribute or by using 'EntityTypeBuilder.Ignore' in 'OnModelCreating'. - The property '{property}' on entity type '{entityType}' could not be found. Ensure that the property exists and has been included in the model. + The property '{1_entityType}.{0_property}' could not be found. Ensure that the property exists and has been included in the model. The property '{entityType}.{property}' is of type '{propertyType}' which is not supported by current database provider. Either change the property CLR type or ignore the property using the '[NotMapped]' attribute or by using 'EntityTypeBuilder.Ignore' in 'OnModelCreating'. - The property '{property}' on entity type '{entityType}' is defined to be read-only after it has been saved, but its value has been modified or marked as modified. + The property '{1_entityType}.{0_property}' is defined to be read-only after it has been saved, but its value has been modified or marked as modified. - The property '{property}' on entity type '{entityType}' is defined to be read-only before it is saved, but its value has been set to something other than a temporary or default value. + The property '{1_entityType}.{0_property}' is defined to be read-only before it is saved, but its value has been set to something other than a temporary or default value. The property '{property}' cannot be added to type '{entityType}' because the type of the corresponding CLR property or field '{clrType}' does not match the specified type '{propertyType}'. @@ -1272,10 +1272,10 @@ 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 '{property}' on entity type '{entityType}' 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 property. Use the '{CollectionMethod}' method to access collection navigation properties. - Navigation property '{navigation}' on entity type '{entityType}' cannot have 'IsLoaded' set to false because the referenced entity is non-null and therefore is loaded. + Navigation property '{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 +1329,7 @@ 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 '{property}' on type '{entityType}' to property '{referencedProperty}' on type '{referencedEntityType}'. Check the values in the InversePropertyAttribute 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 InversePropertyAttribute to ensure relationship definitions are unique and reference from one navigation property to its corresponding inverse navigation property. Sequence contains more than one element. @@ -1368,22 +1368,22 @@ 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 '{navigation}' on the entity type '{entityType}' 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 dependent entity type '{dependentEntityType}'. - The foreign key {foreignKey} cannot be used for the skip navigation property '{navigation}' on the entity type '{entityType}' because it is expected to be on the principal entity type '{principalEntityType}'. + 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 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. - The skip navigation '{navigation}' on entity type '{entityType}' doesn't have a foreign key associated with it. Every skip navigation should have a configured foreign key. + The skip navigation '{1_entityType}.{0_navigation}' doesn't have a foreign key associated with it. Every skip navigation should have a configured foreign key. - The skip navigation '{navigation}' on entity type '{entityType}' doesn't have an inverse configured. Every skip navigation should have an inverse skip navigation. + The skip navigation '{1_entityType}.{0_navigation}' doesn't have an inverse configured. Every skip navigation should have an inverse skip navigation. - The skip navigation '{navigation}' on entity type '{entityType}' is not a collection. Only collection skip navigation properties are currently supported. + The skip navigation '{1_entityType}.{0_navigation}' is not a collection. Only collection skip navigation properties are currently supported. 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. @@ -1392,13 +1392,13 @@ The skip navigation property '{navigation}' cannot be removed from the entity type '{entityType}' because it is defined on the entity type '{otherEntityType}'. - The property '{property}' on entity type '{entityType}' cannot be assigned a value generated by the database. Store-generated values can only be assigned to properties configured to use store-generated values. + 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. - The property '{property}' on entity type '{entityType}' cannot be assigned a temporary value. Temporary values can only be assigned to properties configured to use store-generated values. + The property '{1_entityType}.{0_property}' cannot be assigned a temporary value. Temporary values can only be assigned to properties configured to use store-generated values. - The property '{property}' on entity type '{entityType}' has a temporary value while attempting to change the entity's state to '{state}'. Either set a permanent value explicitly or ensure that the database is configured to generate values for this property. + The property '{1_entityType}.{0_property}' has a temporary value while attempting to change the entity's state to '{state}'. Either set a permanent value explicitly or ensure that the database is configured to generate values for this property. The instance of entity type '{runtimeEntityType}' cannot be tracked as the entity type '{entityType}' because they are not in the same hierarchy. @@ -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 '{navigationName}' on the entity type '{entityType}' because the navigation property has the opposite multiplicity. + 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. Unhandled expression node type '{nodeType}'. @@ -1446,7 +1446,7 @@ The entity type '{entityType}' has a defining navigation and the supplied entity is currently not being tracked. To start tracking this entity call '{referenceCall}' or '{collectionCall}' on the owner entry. - The value for property '{property}' of entity type '{entityType}' cannot be set to null because its type is '{propertyType}' which is not a nullable type. + The value for property '{1_entityType}.{0_property}' cannot be set to null because its type is '{propertyType}' which is not a nullable type. Value generation is not supported for property '{entityType}.{property}' because it has a '{converter}' converter configured. Configure the property to not use value generation using 'ValueGenerated.Never' or 'DatabaseGeneratedOption.None' and specify explicit values instead. @@ -1464,7 +1464,7 @@ The weak entity type '{entityType}' cannot have a base type. - Property '{property}' on entity type '{entityType}' is of type '{actualType}' but the generic type provided is of type '{genericType}'. + 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. diff --git a/tools/Resources.tt b/tools/Resources.tt index d70f6c7b13d..f472cb71d7c 100644 --- a/tools/Resources.tt +++ b/tools/Resources.tt @@ -98,10 +98,10 @@ namespace <#= model.Namespace #> if (resource.Parameters.Any()) { #> - public static string <#= resource.Name #>(<#= List("[CanBeNull] object ", resource.Parameters) #>) + public static string <#= resource.Name #>(<#= List("[CanBeNull] object ", resource.Parameters.Select(e => e.ParamString)) #>) => string.Format( - GetString("<#= resource.Name #>", <#= List("nameof(", resource.Parameters, ")") #>), - <#= List(resource.Parameters) #>); + GetString("<#= resource.Name #>", <#= List(resource.Parameters.Select(e => e.NameOfString)) #>), + <#= List(resource.Parameters.Select(e => e.ParamString)) #>); <# } else @@ -331,12 +331,26 @@ namespace <#= model.Namespace.EndsWith(".Internal") ? model.Namespace : (model.N { Name = node.Name; Value = (string)node.GetValue((ITypeResolutionService)null); - Parameters = Regex.Matches(Value, @"\{(\w+)\}") + var parameters = Regex.Matches(Value, @"\{(\w+)\}") .Cast() .Select(m => m.Groups[1].Value) .Distinct() + .Select(n => ("nameof(" + n + ")", n)) .ToList(); + foreach (var parameter in parameters.ToList()) + { + var rawString = parameter.Item2; + var underscoreIndex = rawString.IndexOf('_'); + if (underscoreIndex > 0) + { + var newIndex = int.Parse(rawString.Substring(0, underscoreIndex)); + parameters[newIndex] = ("\"" + rawString + "\"", rawString.Substring(underscoreIndex + 1)); + } + } + + Parameters = parameters; + var eventInfo = node.Comment.Split(' '); var argumentsRead = 0; if (eventInfo.FirstOrDefault() == "Obsolete") @@ -356,7 +370,7 @@ namespace <#= model.Namespace.EndsWith(".Internal") ? model.Namespace : (model.N public string Level { get; } public bool Obsolete { get; } public bool ForLogging => Name.StartsWith("Log"); - public IEnumerable Parameters { get; } + public IEnumerable<(string NameOfString, string ParamString)> Parameters { get; } public IEnumerable Types { get; } } #> \ No newline at end of file