public async Task <IActionResult> PutFrontCounterModel([FromRoute] int id, [FromBody] FrontCounterModel FrontCounterModel) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != FrontCounterModel.ID) { return(BadRequest()); } _context.Entry(FrontCounterModel).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!FrontCounterModelExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PostFrontCounterModel([FromBody] FrontCounterModel FrontCounterModel) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.Add(FrontCounterModel); db.Save(); //_context.DriveThru.Add(FrontCounterModel); //await _context.SaveChangesAsync(); return(CreatedAtAction("GetFrontCounterModel", new { id = FrontCounterModel.ID }, FrontCounterModel)); }