Esempio n. 1
0
        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();
        }
Esempio n. 2
0
 public DatabaseQueries(QuestionGeneratorContext context)
 {
     this.context = context;
 }