public async Task <IActionResult> PutUserReport([FromRoute] string id, [FromBody] UserReport userReport) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != userReport.ReportID) { return(BadRequest()); } _context.Entry(userReport).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!UserReportExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutCarparkCompanies([FromRoute] string id, [FromBody] CarparkCompanies carparkCompanies) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != carparkCompanies.CompanyID) { return(BadRequest()); } _context.Entry(carparkCompanies).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CarparkCompaniesExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }