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); } }
public async Task <FoodPairing> AddAsync(FoodPairing foodPairing) { using (var dbContext = new Upstart13beerappContext()) { await dbContext.FoodPairing.AddAsync(foodPairing); await dbContext.SaveChangesAsync(); return(foodPairing); } }