{"record":{"id":"ca5bd8723754c1ff","repo":"dotnet/efcore","slug":"there-is-no-property-mapped-to-the-column-table","errorCode":null,"errorMessage":"There is no property mapped to the column '{table}.{column}' which is used in a data operation. Either add a property mapped to this column, or specify the column types in the data operation.","messagePattern":"There is no property mapped to the column '(.+?)\\.(.+?)' which is used in a data operation\\. Either add a property mapped to this column, or specify the column types in the data operation\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/EFCore.Relational/Migrations/MigrationsSqlGenerator.cs","lineNumber":1182,"sourceCode":"        string? schema,\n        IModel? model)\n    {\n        var table = model?.GetRelationalModel().FindTable(tableName, schema ?? model.GetDefaultSchema());\n        if (table == null)\n        {\n            throw new InvalidOperationException(\n                RelationalStrings.DataOperationNoTable(\n                    FormatTable(tableName, schema)));\n        }\n\n        var properties = new IColumnMapping[names.Length];\n        for (var i = 0; i < names.Length; i++)\n        {\n            var name = names[i];\n            var column = table.FindColumn(name);\n            if (column == null)\n            {\n                throw new InvalidOperationException(\n                    RelationalStrings.DataOperationNoProperty(\n                        FormatTable(tableName, schema), name));\n            }\n\n            properties[i] = column.PropertyMappings.First();\n        }\n\n        return properties;\n    }\n\n    /// <summary>\n    ///     Generates a SQL fragment configuring a sequence in a <see cref=\"AlterSequenceOperation\" />.\n    /// </summary>\n    /// <param name=\"operation\">The operation.</param>\n    /// <param name=\"model\">The target model which may be <see langword=\"null\" /> if the operations exist without a model.</param>\n    /// <param name=\"builder\">The command builder to use to add the SQL fragment.</param>\n    protected virtual void SequenceOptions(\n        AlterSequenceOperation operation,","sourceCodeStart":1164,"sourceCodeEnd":1200,"githubUrl":"https://github.com/dotnet/efcore/blob/3a2006ef569de08368d59db5e1468aa8f407e4f8/src/EFCore.Relational/Migrations/MigrationsSqlGenerator.cs#L1164-L1200","documentation":"Thrown by GetPropertyMappings when the table exists in the relational model but no column with the given name is mapped. EF walks each column name through table.FindColumn(name) and aborts on the first miss.","triggerScenarios":"DeleteData/UpdateData with a keyColumns/columns entry that does not match any column on the resolved table. Only fires when explicit types are not supplied.","commonSituations":"Column renamed in entity but migration hand-edited with the old name. Misspelled column name. Composite key with a column not actually mapped. Schema drift between model and migration.","solutions":["Correct the column name to match the mapped property's column name.","Add the property/column mapping to the entity if it should exist.","Supply keyColumnTypes/columnTypes to bypass model column lookup.","Re-scaffold the migration to use the correct column names."],"exampleFix":"// before\nmigrationBuilder.DeleteData(\n    table: \"Users\",\n    keyColumns: new[] { \"UserId\" }, // column is actually \"Id\"\n    keyValues: new object[,] { { 10 } });\n\n// after\nmigrationBuilder.DeleteData(\n    table: \"Users\",\n    keyColumns: new[] { \"Id\" },\n    keyValues: new object[,] { { 10 } });","handlingStrategy":"validation","validationCode":"static void VerifyColumnsExist(IModel model, string table, string? schema, IEnumerable<string> columns)\n{\n    var t = model.GetRelationalModel().FindTable(table, schema ?? model.GetDefaultSchema())\n        ?? throw new InvalidOperationException($\"Table {table} missing.\");\n    foreach (var c in columns)\n        if (t.FindColumn(c) is null)\n            throw new InvalidOperationException($\"Column {table}.{c} not mapped.\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use column names from the entity's column mapping, not property names, when they differ.","Supply explicit column types to bypass the model lookup.","Re-scaffold migrations after model column renames."],"tags":["ef-core","migrations","data-seed","model-binding"],"backgroundTag":null,"analyzedSha":"3a2006ef569de08368d59db5e1468aa8f407e4f8","analyzedAt":"2026-08-11T23:42:04.146Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}