public async Task <Volume> GetAsync(int id) { using (var dbContext = new Upstart13beerappContext()) { return(await dbContext.Volume.FindAsync(id)); } }
public async Task <FoodPairing> GetAsync(int id) { using (var dbContext = new Upstart13beerappContext()) { return(await dbContext.FoodPairing.FindAsync(id)); } }
public async Task <Ingredient> GetAsync(int id) { using (var dbContext = new Upstart13beerappContext()) { return(await dbContext.Ingredient.FindAsync(id)); } }
public async Task ImportAsync(IEnumerable <Beer> beerList) { using (var dbContext = new Upstart13beerappContext()) { await dbContext.BulkInsertOrUpdateAsync(beerList.ToList()); } }
public async Task <IEnumerable <Volume> > ListAsync(int beerId) { using (var dbContext = new Upstart13beerappContext()) { return(await(from c in dbContext.Volume where c.BeerId == beerId select c).ToListAsync()); } }
public async Task <IEnumerable <Beer> > ListAsync() { using (var dbContext = new Upstart13beerappContext()) { return(await dbContext.Beer.ToListAsync()); } }
public async Task DeleteAsync(int id) { using (var dbContext = new Upstart13beerappContext()) { var ingredientToDelete = await GetAsync(id); dbContext.Ingredient.Remove(ingredientToDelete); await dbContext.SaveChangesAsync(); } }
public async Task DeleteAsync(int id) { using (var dbContext = new Upstart13beerappContext()) { var volumeToDelete = await GetAsync(id); dbContext.Volume.Remove(volumeToDelete); await dbContext.SaveChangesAsync(); } }
public async Task DeleteAsync(int id) { using (var dbContext = new Upstart13beerappContext()) { var foodPairingToDelete = await GetAsync(id); dbContext.FoodPairing.Remove(foodPairingToDelete); await dbContext.SaveChangesAsync(); } }
public async Task <Method> UpdateAsync(Method method) { using (var dbContext = new Upstart13beerappContext()) { dbContext.Attach(method); dbContext.Entry(method).State = EntityState.Modified; await dbContext.SaveChangesAsync(); return(method); } }
public async Task <Volume> UpdateAsync(Volume volume) { using (var dbContext = new Upstart13beerappContext()) { dbContext.Attach(volume); dbContext.Entry(volume).State = EntityState.Modified; await dbContext.SaveChangesAsync(); return(volume); } }
public async Task <Volume> AddAsync(Volume volume) { using (var dbContext = new Upstart13beerappContext()) { await dbContext.Volume.AddAsync(volume); await dbContext.SaveChangesAsync(); return(volume); } }
public async Task <Beer> UpdateAsync(Beer beer) { using (var dbContext = new Upstart13beerappContext()) { dbContext.Attach(beer); dbContext.Entry(beer).State = EntityState.Modified; await dbContext.SaveChangesAsync(); return(beer); } }
public async Task <Ingredient> AddAsync(Ingredient ingredient) { using (var dbContext = new Upstart13beerappContext()) { await dbContext.Ingredient.AddAsync(ingredient); await dbContext.SaveChangesAsync(); return(ingredient); } }
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); } }
public async Task <Ingredient> UpdateAsync(Ingredient ingredient) { using (var dbContext = new Upstart13beerappContext()) { dbContext.Attach(ingredient); dbContext.Entry(ingredient).State = EntityState.Modified; await dbContext.SaveChangesAsync(); return(ingredient); } }
public async Task <Beer> AddAsync(Beer beer) { using (var dbContext = new Upstart13beerappContext()) { await dbContext.Beer.AddAsync(beer); await dbContext.SaveChangesAsync(); return(beer); } }
public async Task <Method> AddAsync(Method method) { using (var dbContext = new Upstart13beerappContext()) { await dbContext.Method.AddAsync(method); await dbContext.SaveChangesAsync(); return(method); } }