public async Task <IActionResult> PutCousine(int id, Model.Cousine cousine) { if (id != cousine.Id) { return(null); } _context.Entry(cousine).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!await CousineExists(id)) { return(null); } else { throw; } } return(null); }
public async Task <ActionResult <Model.Cousine> > PostCousine(Model.Cousine cousine) { _context.Cousine.Add(cousine); await _context.SaveChangesAsync(); return(null); }