{"record":{"id":"c2f4cd092f9c1dd5","repo":"dotnet/efcore","slug":"no-property-named-property-found-on-the-entity","errorCode":null,"errorMessage":"No property named '{property}' found on the entity type '{entityType}' corresponding to the result column on the stored procedure '{sproc}'.","messagePattern":"No property named '(.+?)' found on the entity type '(.+?)' corresponding to the result column on the stored procedure '(.+?)'\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/EFCore.Relational/Infrastructure/RelationalModelValidator.cs","lineNumber":659,"sourceCode":"\n        if (mappingStrategy == RelationalAnnotationNames.TptMappingStrategy\n            && storeObjectIdentifier.StoreObjectType == StoreObjectType.InsertStoredProcedure\n            && entityType.BaseType?.GetInsertStoredProcedure() != null)\n        {\n            foreach (var property in primaryKey.Properties)\n            {\n                storeGeneratedProperties.Remove(property.Name);\n            }\n        }\n\n        var resultColumnNames = new HashSet<string>();\n        foreach (var resultColumn in sproc.ResultColumns)\n        {\n            IProperty? property = null!;\n            if (resultColumn.PropertyName != null\n                && !properties.TryGetValue(resultColumn.PropertyName, out property))\n            {\n                throw new InvalidOperationException(\n                    RelationalStrings.StoredProcedureResultColumnNotFound(\n                        resultColumn.PropertyName, entityType.DisplayName(), storeObjectIdentifier.DisplayName()));\n            }\n\n            if (!resultColumnNames.Add(resultColumn.Name))\n            {\n                throw new InvalidOperationException(\n                    RelationalStrings.StoredProcedureDuplicateResultColumnName(\n                        resultColumn.Name, storeObjectIdentifier.DisplayName()));\n            }\n\n            if (resultColumn.PropertyName == null)\n            {\n                continue;\n            }\n\n            switch (storeObjectIdentifier.StoreObjectType)\n            {","sourceCodeStart":641,"sourceCodeEnd":677,"githubUrl":"https://github.com/dotnet/efcore/blob/dbf9771522148d61a2467854921bd5dc6f6e6916/src/EFCore.Relational/Infrastructure/RelationalModelValidator.cs#L641-L677","documentation":"Thrown when a stored procedure result column references a property name that is not found in the valid property set for the entity and mapping strategy. The validator looks up resultColumn.PropertyName in the properties dictionary (which varies by TPH/TPT/TPC) and rejects an unknown name. Result columns must correspond to actual properties.","triggerScenarios":"Calling .HasResultColumn(\"TypoName\"); referencing a property that was renamed or removed; referencing a derived property under a strategy that excludes it.","commonSituations":"Renaming a property without updating the sproc config; strategy changes (e.g. TPH->TPT) that alter which properties are in scope; stale sproc mappings after model refactors.","solutions":["Verify the property name exactly matches an existing property on the entity.","Check the mapping strategy; ensure the property is in scope (e.g. derived properties need TPH).","Remove the result column if it references a non-existent property."],"exampleFix":"// before\n.InsertStoredProcedure(\"sp_InsertBlog\", sp =>\n{\n    sp.HasResultColumn(\"CreateDate\"); // property is actually named CreatedOn\n});\n\n// after\nsp.HasResultColumn(\"CreatedOn\");","handlingStrategy":"validation","validationCode":"foreach (var et in modelBuilder.Model.GetEntityTypes())\n{\n    var names = et.GetProperties().Select(p => p.Name).ToHashSet();\n    foreach (var t in new[] { StoreObjectType.InsertStoredProcedure, StoreObjectType.UpdateStoredProcedure })\n    {\n        var sproc = t == StoreObjectType.InsertStoredProcedure ? et.GetInsertStoredProcedure() : et.GetUpdateStoredProcedure();\n        if (sproc == null) continue;\n        foreach (var rc in sproc.ResultColumns)\n            if (rc.PropertyName != null && !names.Contains(rc.PropertyName))\n                throw new InvalidOperationException($\"Result column {rc.PropertyName} not a property of {et.DisplayName()}\");\n    }\n}","typeGuard":null,"tryCatchPattern":"try { _ = ctx.Model; } catch (InvalidOperationException ex) when (ex.Message.Contains(\"No property named\")) { /* fix the result column property name */ }","preventionTips":["Use nameof(Property) when configuring result columns.","Update sproc config whenever a property is renamed or removed."],"tags":["ef-core","stored-procedures","result-column","properties","model-validation"],"analyzedSha":"dbf9771522148d61a2467854921bd5dc6f6e6916","analyzedAt":"2026-08-06T20:46:03.226Z","schemaVersion":2},"datasetVersion":"2026-08-07T03:17:09.362Z"}