public async Task <IActionResult> Post([FromBody] RolesClientDTO rolesclieDto) { var rolecli = _mapper.Map <RolesClient>(rolesclieDto); await _rolesClientServices.Add(rolecli); rolesclieDto = _mapper.Map <RolesClientDTO>(rolecli); var response = new GenericResponse <RolesClientDTO>(rolesclieDto); return(Ok(response)); }
public async Task <IActionResult> Put(int id, RolesClientDTO rolecliDto) { try { var rolecli = _mapper.Map <RolesClient>(rolecliDto); rolecli.RolesClient_Id = id; await _rolesClientServices.Update(rolecli); var response = new GenericResponse <bool>(true); return(Ok(response)); } catch (Exception ex) { throw new BusinessException(MessageCodes.PROPERTY_NO_VALID, GetErrorDescription(MessageCodes.PROPERTY_NO_VALID), ex.Message); } }