Refactor: the project is now divided into a more clear structure, with **Infrastructure** and **Application** layers added. Refactor: configurations are split into sections for different layers. Fix: now EF Core related operations, such as migration, should be invoked in `OptixServe.Infrastructure`, with config file and data dir passed into `dotnet ef` command. See `OptixServe.Infrastructure/Utilites/DesignTimeDbContextFactory.cs` for details. Fix: EF migrations are ignored in gitignore on purpose in early development.
12 lines
239 B
C#
12 lines
239 B
C#
namespace OptixServe.Infrastructure.Data;
|
|
|
|
public class DbInitializer(AppDbContext dbContext)
|
|
{
|
|
private readonly AppDbContext _context = dbContext;
|
|
|
|
public void Initialize()
|
|
{
|
|
_context.Database.EnsureCreated();
|
|
}
|
|
}
|