You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
689 B
28 lines
689 B
using DbConnectionLibrairie;
|
|
using Entities;
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
namespace StubbedDbContextLibrary
|
|
{
|
|
public class StubbedDbContext : MyDbContext
|
|
{
|
|
public StubbedDbContext()
|
|
{ }
|
|
|
|
public StubbedDbContext(DbContextOptions<MyDbContext> contextOptions) :
|
|
base(contextOptions)
|
|
{ }
|
|
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
|
{
|
|
base.OnModelCreating(modelBuilder);
|
|
|
|
var fakeDatas = fakeAnswers.datas;
|
|
foreach (var datas in fakeDatas)
|
|
{
|
|
modelBuilder.Entity<AnswerEntity>().HasData(datas);
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|