use .GetMAppStoreObjects to try get the correct table (this is especially needed for properties in split tables). Default to the original storeObject if can't find anything

7.0-servicing
Christopher Jolly 2 years ago
parent 9e6617903f
commit fbf0f794a7

@ -188,9 +188,14 @@ namespace EntityFrameworkCore.Jet.Internal
foreach (var property in mappedTypes.SelectMany(et => et.GetDeclaredProperties()))
{
if (property.GetValueGenerationStrategy(storeObject) == JetValueGenerationStrategy.IdentityColumn)
var declaringTable = property.GetMappedStoreObjects(StoreObjectType.Table).FirstOrDefault();
if (declaringTable.Name == null)
{
var columnName = property.GetColumnName(storeObject);
declaringTable = storeObject;
}
if (property.GetValueGenerationStrategy(declaringTable) == JetValueGenerationStrategy.IdentityColumn)
{
var columnName = property.GetColumnName(declaringTable);
if (columnName == null)
{
continue;

Loading…
Cancel
Save