public async Task <IActionResult> EditProjectClient(int projectId, int clientId, ClientDAO client) { if (clientId != client.Id) { return(BadRequest()); } if (ProjectExists(projectId, clientId)) { _context.Entry(client).State = EntityState.Modified; } else { NoContent(); } try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ProjectExists(projectId, clientId)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutClient(int id, ClientDAO client) { if (id != client.Id) { return(BadRequest()); } _context.Entry(client).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ClientExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }