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

    }
}
