示例#1
0
        public async Task <FoodPairing> UpdateAsync(FoodPairing foodPairing)
        {
            using (var dbContext = new Upstart13beerappContext())
            {
                dbContext.Attach(foodPairing);
                dbContext.Entry(foodPairing).State = EntityState.Modified;
                await dbContext.SaveChangesAsync();

                return(foodPairing);
            }
        }
示例#2
0
        public async Task <FoodPairing> AddAsync(FoodPairing foodPairing)
        {
            using (var dbContext = new Upstart13beerappContext())
            {
                await dbContext.FoodPairing.AddAsync(foodPairing);

                await dbContext.SaveChangesAsync();

                return(foodPairing);
            }
        }