public async Task <IActionResult> Post([FromBody] ClientTagDTO clieTagDto) { var clietag = _mapper.Map <ClientTag>(clieTagDto); await _clientTag.Add(clietag); clieTagDto = _mapper.Map <ClientTagDTO>(clietag); var response = new GenericResponse <ClientTagDTO>(clieTagDto); return(Ok(response)); }
public async Task <IActionResult> Put(int id, ClientTagDTO clieTag) { try { var clienTag = _mapper.Map <ClientTag>(clieTag); clienTag.ClientTag_Id = id; await _clientTag.Update(clienTag); 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); } }