public async Task <ActionResult> Put(int id, [FromBody] TelefonoClientesCreacionDTO telefonoClienteActualizar) { var telefonoClientes = mapper.Map <TelefonoCliente>(telefonoClienteActualizar); telefonoClientes.CodigoTelefono = id; contexto.Entry(telefonoClientes).State = EntityState.Modified; await contexto.SaveChangesAsync(); return(NoContent()); }
public async Task <ActionResult> Post([FromBody] TelefonoClientesCreacionDTO telefonoClientesCreacion) { var telefonoClientes = mapper.Map <TelefonoCliente>(telefonoClientesCreacion); contexto.Add(telefonoClientes); await contexto.SaveChangesAsync(); var telefonoLCientesDTO = mapper.Map <TelefonoClienteDTO>(telefonoClientes); return(new CreatedAtRouteResult("GetTelefonoCLientes", new { id = telefonoClientes.CodigoTelefono }, telefonoLCientesDTO)); }