public static void Initialise(QuestionGeneratorContext context) { context.Database.EnsureCreated(); if (context.UserDbo.Any()) { return; } var questionTypes = new List <QuestionTypeDbo>() { new QuestionTypeDbo() { Type = "quadratic" }, new QuestionTypeDbo() { Type = "simultaneous" } }; questionTypes.ForEach(questionType => context.QuestionTypeDbo.Add(questionType)); context.SaveChanges(); }
public DatabaseQueries(QuestionGeneratorContext context) { this.context = context; }