Buildingsite list hinzugefügt

This commit is contained in:
HuskyTeufel
2021-09-15 20:06:55 +02:00
parent e0c9839275
commit 4123cc7aba
18 changed files with 754 additions and 33 deletions

View File

@@ -8,10 +8,14 @@ using System.Threading.Tasks;
namespace DaSaSo.EntityFramework
{
public class DaSaSoDbContextFactory
public class DaSaSoDbContextFactory : IDesignTimeDbContextFactory<DaSaSoDbContext>
{
private readonly string _connectionString;
public DaSaSoDbContextFactory()
{
}
public DaSaSoDbContextFactory(string connectionString)
{
_connectionString = connectionString;
@@ -20,9 +24,18 @@ namespace DaSaSo.EntityFramework
public DaSaSoDbContext CreateDbContext()
{
var options = new DbContextOptionsBuilder<DaSaSoDbContext>();
//_connectionString = "Host = localhost; Database = dasaso; Username = kansan; Password = kansan";
options.UseNpgsql(_connectionString);
DaSaSoDbContext result = new DaSaSoDbContext(options.Options);
return result;
}
public DaSaSoDbContext CreateDbContext(string[]? args = null)
{
var options = new DbContextOptionsBuilder<DaSaSoDbContext>();
options.UseNpgsql("Host = localhost; Database = dasaso; Username = kansan; Password = kansan");
DaSaSoDbContext result = new DaSaSoDbContext(options.Options);
return result;
}
}
}