Update DatabaseErrorPageMiddleware to use HasTables
This commit is contained in:
parent
9ea20ddef3
commit
730c3e0053
|
|
@ -5,7 +5,6 @@ using System;
|
|||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
|
|
@ -134,8 +133,7 @@ namespace Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore
|
|||
|
||||
if (databaseExists)
|
||||
{
|
||||
// Also check if the database is completely empty - see https://github.com/aspnet/EntityFrameworkCore/issues/15997
|
||||
databaseExists = (bool)typeof(RelationalDatabaseCreator).GetMethod("HasTables", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public).Invoke(relationalDatabaseCreator, null);
|
||||
databaseExists = await relationalDatabaseCreator.HasTablesAsync();
|
||||
}
|
||||
|
||||
var migrationsAssembly = context.GetService<IMigrationsAssembly>();
|
||||
|
|
|
|||
Loading…
Reference in New Issue