public async Task <IActionResult> PutPcoLicenceDetail(string id, PcoLicenceDetail pcoLicenceDetail) { if (id != pcoLicenceDetail.AppUserId) { return(BadRequest()); } _context.Entry(pcoLicenceDetail).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PcoLicenceDetailExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <PcoLicenceDetail> > PostPcoLicenceDetail(PcoLicenceDetail pcoLicenceDetail) { try { _context.PcoDetails.Add(pcoLicenceDetail); await _context.SaveChangesAsync(); return(CreatedAtAction("GetPcoLicenceDetail", new { id = pcoLicenceDetail.AppUserId }, pcoLicenceDetail)); } catch (System.Exception ex) { var errMsg = ex.Message; throw; } }