Commands auf Async umgestellt

This commit is contained in:
HuskyTeufel
2021-09-15 19:12:31 +02:00
parent 00718f9821
commit e0c9839275
13 changed files with 242 additions and 90 deletions

View File

@@ -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;
}
}
}