public async Task <ActionResult <FastFoodChain> > PostFastFoodChain(FastFoodChain fastFoodChain) { _context.FastFoodChain.Add(fastFoodChain); await _context.SaveChangesAsync(); return(CreatedAtAction("GetFastFoodChain", new { id = fastFoodChain.Id }, fastFoodChain)); }
public async Task <IActionResult> PutFastFoodChain(int id, FastFoodChain fastFoodChain) { if (id != fastFoodChain.Id) { return(BadRequest()); } _context.Entry(fastFoodChain).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!FastFoodChainExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }