public async Task <IActionResult> PutIngredientDisponibily(int id, IngredientDisponibily ingredientDisponibily) { if (id != ingredientDisponibily.Id) { return(BadRequest()); } _context.Entry(ingredientDisponibily).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!IngredientDisponibilyExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <IngredientDisponibily> > PostIngredientDisponibily(IngredientDisponibily ingredientDisponibily) { _context.IngredientDisponibily.Add(ingredientDisponibily); await _context.SaveChangesAsync(); return(CreatedAtAction("GetIngredientDisponibily", new { id = ingredientDisponibily.Id }, ingredientDisponibily)); }