public async Task <IActionResult> PutDepartamentoXCliente(int id, Departamento_X_Cliente DepartamentoXCliente) { if (id != DepartamentoXCliente.DepartamentoId) { return(BadRequest()); } _context.Entry(DepartamentoXCliente).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DepartamentoXClienteExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <Departamento_X_Cliente> > PostDepartamentoXCliente(Departamento_X_Cliente DepartamentoXCliente) { _context.Departamento_X_Cliente.Add(DepartamentoXCliente); await _context.SaveChangesAsync(); return(CreatedAtAction("GetDepartamentoXCliente", new { id = DepartamentoXCliente.DepartamentoId }, DepartamentoXCliente)); }