Commands auf Async umgestellt
This commit is contained in:
@@ -8,13 +8,21 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace DaSaSo.EntityFramework
|
||||
{
|
||||
public class DaSaSoDbContextFactory : IDesignTimeDbContextFactory<DaSaSoDbContext>
|
||||
public class DaSaSoDbContextFactory
|
||||
{
|
||||
public DaSaSoDbContext CreateDbContext(string[]? args = null)
|
||||
private readonly string _connectionString;
|
||||
|
||||
public DaSaSoDbContextFactory(string connectionString)
|
||||
{
|
||||
_connectionString = connectionString;
|
||||
}
|
||||
|
||||
public DaSaSoDbContext CreateDbContext()
|
||||
{
|
||||
var options = new DbContextOptionsBuilder<DaSaSoDbContext>();
|
||||
options.UseNpgsql("Host = localhost; Database = dasaso; Username = kansan; Password = kansan");
|
||||
return new DaSaSoDbContext(options.Options);
|
||||
options.UseNpgsql(_connectionString);
|
||||
DaSaSoDbContext result = new DaSaSoDbContext(options.Options);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user