public async Task <ActionResult <Models.UserLicence> > PostLicenceModel(Models.UserLicence licenceModel) { _context.UserLicence.Add(licenceModel); await _context.SaveChangesAsync(); return(CreatedAtAction("GetLicenceModel", new { id = licenceModel.Id }, licenceModel)); }
public async Task <IActionResult> PutLicenceModel(int id, Models.UserLicence licenceModel) { if (id != licenceModel.Id) { return(BadRequest()); } _context.Entry(licenceModel).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!LicenceModelExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }