Skip to content

Commit f887709

Browse files
committed
Suppress warning about non-parameterized SQL because table names cannot be parameterized
1 parent c9823e7 commit f887709

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

test/TestBuildingBlocks/DbContextExtensions.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ private static async Task ClearTablesAsync(this DbContext dbContext, params Type
4444
}
4545
else
4646
{
47+
#pragma warning disable EF1002 // Risk of vulnerability to SQL injection.
4748
await dbContext.Database.ExecuteSqlRawAsync($"DELETE FROM \"{tableName}\"");
49+
#pragma warning restore EF1002 // Risk of vulnerability to SQL injection.
4850
}
4951
}
5052
}

0 commit comments

Comments
 (0)