diff --git a/src/FlexLabs.EntityFrameworkCore.Upsert/Runners/RelationalUpsertCommandRunner.cs b/src/FlexLabs.EntityFrameworkCore.Upsert/Runners/RelationalUpsertCommandRunner.cs index c0bdab7..b894662 100644 --- a/src/FlexLabs.EntityFrameworkCore.Upsert/Runners/RelationalUpsertCommandRunner.cs +++ b/src/FlexLabs.EntityFrameworkCore.Upsert/Runners/RelationalUpsertCommandRunner.cs @@ -68,7 +68,7 @@ public abstract string GenerateCommand(string tableName, ICollectionThe fully qualified and escaped table reference protected virtual string GetTableName(IEntityType entityType) { - var tableName = entityType.GetTableName() + var tableName = entityType.GetTableName() ?? entityType.GetViewName() ?? throw new InvalidOperationException(Resources.FormatCouldNotGetTableNameForEntityType(entityType?.Name)); return GetSchema(entityType) + EscapeName(tableName); }