From 7232cbbe1ccd14d424f7aee150d12b68779df044 Mon Sep 17 00:00:00 2001 From: Rik Svendsen Rose Date: Thu, 17 Nov 2022 15:27:35 +0100 Subject: [PATCH] Allow GetViewName for table name --- .../Runners/RelationalUpsertCommandRunner.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/FlexLabs.EntityFrameworkCore.Upsert/Runners/RelationalUpsertCommandRunner.cs b/src/FlexLabs.EntityFrameworkCore.Upsert/Runners/RelationalUpsertCommandRunner.cs index 5b35fc9..062c457 100644 --- a/src/FlexLabs.EntityFrameworkCore.Upsert/Runners/RelationalUpsertCommandRunner.cs +++ b/src/FlexLabs.EntityFrameworkCore.Upsert/Runners/RelationalUpsertCommandRunner.cs @@ -69,7 +69,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(string.Format(CultureInfo.InvariantCulture, Resources.CouldNotGetTableNameForEntityType, entityType?.Name)); return GetSchema(entityType) + EscapeName(tableName); }