Begin seed work

This commit is contained in:
Stedoss 2022-10-29 22:44:47 +01:00
parent 7d5a176d05
commit f9dfe68409
2 changed files with 26 additions and 0 deletions

View File

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

View File

@ -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()
{
}
}