public async Task <IActionResult> PutStatus([FromRoute] int id, [FromBody] Status status) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != status.Id) { return(BadRequest()); } _context.Entry(status).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!StatusExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutProject([FromRoute] Guid guid, [FromBody] Project project) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (guid != project.Guid) { return(BadRequest()); } _context.Entry(project).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ProjectExists(guid)) { return(NotFound()); } else { throw; } } return(NoContent()); }