{"record":{"id":"87568747cece950e","repo":"dotnet/efcore","slug":"entity-type-entitytype-doesn-t-contain-a-prope","errorCode":null,"errorMessage":"Entity type '{entityType}' doesn't contain a property mapped to the store-generated concurrency token column '{missingColumn}' which is used by another entity type sharing the table '{table}'. Add a store-generated property to '{entityType}' which is mapped to the same column; it may be in shadow state.","messagePattern":"Entity type '(.+?)' doesn't contain a property mapped to the store-generated concurrency token column '(.+?)' which is used by another entity type sharing the table '(.+?)'\\. Add a store-generated property to '(.+?)' which is mapped to the same column; it may be in shadow state\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/EFCore.Relational/Infrastructure/RelationalModelValidator.cs","lineNumber":1455,"sourceCode":"            if (missingConcurrencyTokens != null)\n            {\n                missingConcurrencyTokens.Clear();\n                foreach (var (concurrencyColumn, concurrencyProperties) in concurrencyColumns!)\n                {\n                    if (TableSharingConcurrencyTokenConvention.IsConcurrencyTokenMissing(concurrencyProperties, entityType, mappedTypes))\n                    {\n                        missingConcurrencyTokens.Add(concurrencyColumn);\n                    }\n                }\n            }\n\n            ValidateCompatible(entityType, storeObject, propertyMappings, missingConcurrencyTokens, logger);\n\n            if (missingConcurrencyTokens != null)\n            {\n                foreach (var concurrencyColumn in missingConcurrencyTokens)\n                {\n                    throw new InvalidOperationException(\n                        RelationalStrings.MissingConcurrencyColumn(\n                            entityType.DisplayName(), concurrencyColumn, storeObject.DisplayName()));\n                }\n            }\n        }\n\n        var columnOrders = new Dictionary<int, List<string>>();\n        foreach (var property in propertyMappings.Values)\n        {\n            var columnOrder = property.GetColumnOrder(storeObject);\n            if (!columnOrder.HasValue)\n            {\n                continue;\n            }\n\n            var columns = columnOrders.GetOrAddNew(columnOrder.Value);\n            columns.Add(property.GetColumnName(storeObject)!);\n        }","sourceCodeStart":1437,"sourceCodeEnd":1473,"githubUrl":"https://github.com/dotnet/efcore/blob/dbf9771522148d61a2467854921bd5dc6f6e6916/src/EFCore.Relational/Infrastructure/RelationalModelValidator.cs#L1437-L1473","documentation":"When entity types share a table, a store-generated concurrency token column (e.g. rowversion) must be mapped by every sharing type, because SQL Server generates a new token value on any update to the row regardless of which entity triggered it. If one entity omits the token property, an update through that entity would not receive the new token and the next optimistic-concurrency check on the other entity would fail. The validator at line 1442-1458 builds the set of missing token columns per entity and throws MissingConcurrencyColumn.","triggerScenarios":"An owned/table-splitting entity whose principal has a `[Timestamp]`/`.IsRowVersion()`/`.IsConcurrencyToken()` property, but the dependent entity does not declare a property mapped to the same concurrency column. Detected by TableSharingConcurrencyTokenConvention.IsConcurrencyTokenMissing.","commonSituations":"Adding a rowversion column to the principal after the dependent was already configured; the dependent was generated by scaffolding before the token existed; using table splitting and forgetting to mirror the token.","solutions":["Add a shadow or declared concurrency-token property to the dependent entity mapped to the same column: .Property<byte[]>(\"RowVersion\").IsRowVersion().HasColumnName(\"RowVersion\").","Remove the concurrency token from the principal if optimistic concurrency is not needed for the shared table.","Stop sharing the table (map the dependent to its own table) so the token scoping is per-table."],"exampleFix":"// before\nmodelBuilder.Entity<Order>()\n    .Property(o => o.RowVersion).IsRowVersion();\nmodelBuilder.Entity<Order>().OwnsOne(o => o.Details); // no token on Details\n\n// after - add a shadow token property on the dependent mapped to the same column\nmodelBuilder.Entity<Order>()\n    .OwnsOne(o => o.Details, d =>\n    {\n        d.Property<byte[]>(\"RowVersion\").IsRowVersion().HasColumnName(\"RowVersion\");\n    });","handlingStrategy":"validation","validationCode":"foreach (var et in modelBuilder.Model.GetEntityTypes())\n{\n    var table = et.GetTableName();\n    if (table == null) continue;\n    var storeObj = StoreObjectIdentifier.Table(table, et.GetSchema());\n    // gather token columns used by any type sharing this table\n    var tokenCols = modelBuilder.Model.GetEntityTypes()\n        .Where(e => e.GetTableName() == table)\n        .SelectMany(e => e.GetProperties())\n        .Where(p => p.IsConcurrencyToken && (p.ValueGenerated & ValueGenerated.OnAddOrUpdate) != 0)\n        .Select(p => p.GetColumnName(storeObj))\n        .Where(n => n != null).Distinct().ToList();\n    var ownCols = et.GetProperties().Select(p => p.GetColumnName(storeObj)).ToHashSet();\n    var missing = tokenCols.Where(c => !ownCols.Contains(c)).ToList();\n    if (missing.Count > 0)\n        throw new InvalidOperationException(\n            $\"{et.Name} sharing table '{table}' is missing concurrency columns: {string.Join(\", \", missing)}\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["When you add a rowversion/Timestamp to a principal that uses table splitting, mirror it as a shadow IsRowVersion() property on every dependent sharing the table.","Run the model through FinalizeModel() in tests to surface this at build time.","Centralize rowversion configuration in an extension applied to all sharing types."],"tags":["ef-core","table-sharing","concurrency","model-validation"],"analyzedSha":"dbf9771522148d61a2467854921bd5dc6f6e6916","analyzedAt":"2026-08-06T20:46:03.226Z","schemaVersion":2},"datasetVersion":"2026-08-07T02:17:10.218Z"}