Begin seed work
This commit is contained in:
parent
7d5a176d05
commit
f9dfe68409
@ -1,4 +1,5 @@
|
||||
using LeedsBeerQuest.API.Data.Models;
|
||||
using LeedsBeerQuest.API.Data.Seed;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace LeedsBeerQuest.API.Data.Contexts;
|
||||
@ -17,4 +18,10 @@ public class LeedsBeerQuestDbContext : DbContext
|
||||
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder options)
|
||||
=> options.UseSqlite("Data Source=lbq.db");
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
var seeder = new LeedsBeerQuestSeeder(modelBuilder, "");
|
||||
seeder.Seed();
|
||||
}
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace LeedsBeerQuest.API.Data.Seed;
|
||||
|
||||
public class LeedsBeerQuestSeeder
|
||||
{
|
||||
private readonly ModelBuilder _modelBuilder;
|
||||
private readonly string _dataSourcePath;
|
||||
|
||||
public LeedsBeerQuestSeeder(ModelBuilder modelBuilder, string dataSourcePath)
|
||||
{
|
||||
_modelBuilder = modelBuilder;
|
||||
_dataSourcePath = dataSourcePath;
|
||||
}
|
||||
|
||||
public void Seed()
|
||||
{
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user