{"record":{"id":"d0f9904921ca1d97","repo":"dotnet/efcore","slug":"the-property-entitytype-property-is-mapped-t","errorCode":null,"errorMessage":"The property '{entityType}.{property}' is mapped to a result column of the stored procedure '{sproc}', but it is not configured as store-generated.","messagePattern":"The property '(.+?)\\.(.+?)' is mapped to a result column of the stored procedure '(.+?)', but it is not configured as store-generated\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/EFCore.Relational/Infrastructure/RelationalModelValidator.cs","lineNumber":682,"sourceCode":"            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            {\n                case StoreObjectType.InsertStoredProcedure:\n                case StoreObjectType.UpdateStoredProcedure:\n                    if (!storeGeneratedProperties.ContainsKey(property.Name))\n                    {\n                        throw new InvalidOperationException(\n                            RelationalStrings.StoredProcedureResultColumnNotGenerated(\n                                entityType.DisplayName(), resultColumn.PropertyName, storeObjectIdentifier.DisplayName()));\n                    }\n\n                    break;\n                case StoreObjectType.DeleteStoredProcedure:\n                    throw new InvalidOperationException(\n                        RelationalStrings.StoredProcedureResultColumnDelete(\n                            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)","sourceCodeStart":664,"sourceCodeEnd":700,"githubUrl":"https://github.com/dotnet/efcore/blob/dbf9771522148d61a2467854921bd5dc6f6e6916/src/EFCore.Relational/Infrastructure/RelationalModelValidator.cs#L664-L700","documentation":"Thrown when a property mapped to a result column is not configured as store-generated. Result columns carry values the database produces, so the property must be marked ValueGenerated.OnAdd (for insert) or OnUpdate (for update). The validator rejects the property if it is absent from the storeGeneratedProperties set.","triggerScenarios":".HasResultColumn(\"Id\") on an insert sproc without .ValueGenerated(ValueGenerated.OnAdd) on the Id property; mapping a regular column to a result column.","commonSituations":"Forgetting to mark an identity/computed column as ValueGenerated; treating a client-set property as store output.","solutions":["Mark the property store-generated: .ValueGenerated(ValueGenerated.OnAdd) (insert) or .ValueGenerated.OnUpdate (update).","Or annotate it as a computed column via HasComputedColumnSql.","Remove the result column if the property is not actually store-generated."],"exampleFix":"// before\nsp.HasResultColumn(\"Id\"); // Id not configured as generated\n\n// after\nmodelBuilder.Entity<Blog>().Property(b => b.Id).ValueGeneratedOnAdd();\nsp.HasResultColumn(\"Id\");","handlingStrategy":"validation","validationCode":"foreach (var et in modelBuilder.Model.GetEntityTypes())\n{\n    foreach (var kv in new[] { (StoreObjectType.InsertStoredProcedure, et.GetInsertStoredProcedure()), (StoreObjectType.UpdateStoredProcedure, et.GetUpdateStoredProcedure()) })\n    {\n        var (t, s) = kv; if (s == null) continue;\n        foreach (var rc in s.ResultColumns.Where(r => r.PropertyName != null))\n        {\n            var p = et.FindProperty(rc.PropertyName);\n            var needed = t == StoreObjectType.InsertStoredProcedure ? ValueGenerated.OnAdd : ValueGenerated.OnUpdate;\n            if (p != null && (p.ValueGenerated & needed) == 0)\n                throw new InvalidOperationException($\"{rc.PropertyName} must be store-generated\");\n        }\n    }\n}","typeGuard":null,"tryCatchPattern":"try { _ = ctx.Model; } catch (InvalidOperationException ex) when (ex.Message.Contains(\"not configured as store-generated\")) { /* mark the property ValueGenerated or remove the result column */ }","preventionTips":["Only map result columns to properties marked ValueGenerated.OnAdd/OnUpdate.","Use result columns exclusively for identity, computed, and timestamp columns."],"tags":["ef-core","stored-procedures","result-column","store-generated","model-validation"],"analyzedSha":"dbf9771522148d61a2467854921bd5dc6f6e6916","analyzedAt":"2026-08-06T20:46:03.226Z","schemaVersion":2},"datasetVersion":"2026-08-07T03:17:09.362Z"}