Ejemplo n.º 1
0
        public async Task SeedDatabase()
        {
            using (var context = new QAF())
            {
                var foodItems = new List <FoodItem>
                {
                    new FoodItem {
                        Name = "Test", Description = "TestDescription", Price = 3, Ingredients = "TestIngredients", Allergy = "TestAllergies"
                    }
                };

                foodItems.ForEach(s => context.FoodItems.Add(s));
                await context.SaveChangesAsync();

                var testers = new List <Tester>
                {
                    new Tester {
                        UserId = "32bdff18-fc6a-4e4e-b015-aec0cd80dc91"
                    }
                };

                testers.ForEach(s => context.Testers.Add(s));
                await context.SaveChangesAsync();
            }
        }
Ejemplo n.º 2
0
 public async Task UpdateScoreAsync(Marks testerGrade)
 {
     using (var context = new QAF())
     {
         context.Marks.Attach(testerGrade);
         context.Entry(testerGrade).State = EntityState.Modified;
         await context.SaveChangesAsync();
     }
 }
Ejemplo n.º 3
0
        public async Task <Tester> SetTesterAysnc(Tester tester)
        {
            using (var context = new QAF())
            {
                context.Testers.Add(tester);
                await context.SaveChangesAsync();

                return(tester);
            }
        }
Ejemplo n.º 4
0
        public async Task <Marks> AddScoreAsync(Marks testerGrade)
        {
            using (var context = new QAF())
            {
                context.Marks.Add(testerGrade);
                await context.SaveChangesAsync();

                return(testerGrade);
            }
        }