{"record":{"id":"374a2daf61069bfd","repo":"dotnet/efcore","slug":"no-property-named-property-found-on-the-entity-374a2d","errorCode":null,"errorMessage":"No property named '{property}' found on the entity type '{entityType}' corresponding to the parameter on the stored procedure '{sproc}'.","messagePattern":"No property named '(.+?)' found on the entity type '(.+?)' corresponding to the parameter on the stored procedure '(.+?)'\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/EFCore.Relational/Infrastructure/RelationalModelValidator.cs","lineNumber":709,"sourceCode":"                            entityType.DisplayName(), resultColumn.PropertyName, storeObjectIdentifier.DisplayName()));\n                default:\n                    Check.DebugFail(\"Unexpected stored procedure type: \" + storeObjectIdentifier.StoreObjectType);\n                    break;\n            }\n        }\n\n        var originalValueProperties = new Dictionary<string, IProperty>(properties);\n        var parameterNames = new HashSet<string>();\n        foreach (var parameter in sproc.Parameters)\n        {\n            IProperty? property = null;\n            if (parameter.PropertyName != null)\n            {\n                if (parameter.ForOriginalValue == true)\n                {\n                    if (!originalValueProperties.TryGetAndRemove(parameter.PropertyName, out property))\n                    {\n                        throw new InvalidOperationException(\n                            RelationalStrings.StoredProcedureParameterNotFound(\n                                parameter.PropertyName, entityType.DisplayName(), storeObjectIdentifier.DisplayName()));\n                    }\n\n                    if (storeObjectIdentifier.StoreObjectType == StoreObjectType.InsertStoredProcedure)\n                    {\n                        throw new InvalidOperationException(\n                            RelationalStrings.StoredProcedureOriginalValueParameterOnInsert(\n                                parameter.Name, storeObjectIdentifier.DisplayName()));\n                    }\n                }\n                else\n                {\n                    if (!properties.TryGetAndRemove(parameter.PropertyName, out property))\n                    {\n                        throw new InvalidOperationException(\n                            RelationalStrings.StoredProcedureParameterNotFound(\n                                parameter.PropertyName, entityType.DisplayName(), storeObjectIdentifier.DisplayName()));","sourceCodeStart":691,"sourceCodeEnd":727,"githubUrl":"https://github.com/dotnet/efcore/blob/dbf9771522148d61a2467854921bd5dc6f6e6916/src/EFCore.Relational/Infrastructure/RelationalModelValidator.cs#L691-L727","documentation":"Thrown when an original-value parameter (HasOriginalValueParameter) references a property name not present in the valid property set for the entity and mapping strategy. The validator fails the lookup in originalValueProperties with TryGetAndRemove returning false. Original-value parameters must map to a real property.","triggerScenarios":".HasOriginalValueParameter(\"TypoName\"); referencing a removed/renamed property; referencing a property excluded by the mapping strategy.","commonSituations":"Renaming a property without updating original-value sproc config; changing mapping strategy so a base property is no longer in scope.","solutions":["Verify the property name matches an actual property on the entity.","Check the mapping strategy ensures the property is in scope.","Remove the original-value parameter if the property does not exist."],"exampleFix":"// before\nsp.HasOriginalValueParameter(\"RowVersionX\"); // typo\n\n// after\nsp.HasOriginalValueParameter(\"RowVersion\");","handlingStrategy":"validation","validationCode":"foreach (var et in modelBuilder.Model.GetEntityTypes())\n{\n    var names = et.GetProperties().Select(p => p.Name).ToHashSet();\n    foreach (var s in new[] { et.GetInsertStoredProcedure(), et.GetUpdateStoredProcedure(), et.GetDeleteStoredProcedure() }.Where(s => s != null))\n        foreach (var p in s.Parameters.Where(p => p.ForOriginalValue == true && p.PropertyName != null))\n            if (!names.Contains(p.PropertyName)) throw new InvalidOperationException($\"Original-value param {p.PropertyName} not a property of {et.DisplayName()}\");\n}","typeGuard":null,"tryCatchPattern":"try { _ = ctx.Model; } catch (InvalidOperationException ex) when (ex.Message.Contains(\"Original value parameter\") && ex.Message.Contains(\"No property named\")) { /* fix the original-value parameter property name */ }","preventionTips":["Use nameof() for original-value parameter names.","Re-validate sproc config after renaming properties."],"tags":["ef-core","stored-procedures","parameters","original-value","model-validation"],"analyzedSha":"dbf9771522148d61a2467854921bd5dc6f6e6916","analyzedAt":"2026-08-06T20:46:03.226Z","schemaVersion":2},"datasetVersion":"2026-08-07T03:17:09.362Z"}