blob: 76f11e11166e477bd656dd3ca7e010c298bd1028 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Design;
namespace Elements.Data;
public class ApplicationContextFactory : IDesignTimeDbContextFactory<ApplicationDbContext>
{
public ApplicationDbContext CreateDbContext(string[] args)
{
DbContextOptionsBuilder<ApplicationDbContext> optionsBuilder = new();
optionsBuilder.UseNpgsql("Server=database;Port=5432;Database=elements;User Id=elements;Password=elementspass");
return new ApplicationDbContext(optionsBuilder.Options);
}
}
|