public async Task <IActionResult> AddClientType([FromBody] ClientTypeDTO clientType) { if (!ModelState.IsValid) { return(BadRequest("Invalid model")); } var result = await clientTypeService.AddClientTypeAsync(clientType); return(Json(result)); }
public async Task <RequestResultDTO> UpdateClientTypeAsync(ClientTypeDTO clientTypeDTO) { try { var clientType = mapper.Map <ClientType>(clientTypeDTO); await unitOfWork.ClientTypeRepository.UpdateAsync(clientType); return(new RequestResultDTO()); } catch (Exception ex) { return(ex.RequestResult()); } }
public async Task <IActionResult> UpdateClientType([FromBody] ClientTypeDTO clientType) { var result = await clientTypeService.UpdateClientTypeAsync(clientType); return(Json(result)); }