public async Task <IActionResult> UpdateAsync(CustomerDTO model) { Response <string> response = new Response <string>(); try { if (model == null) { return(BadRequest()); } response = await _CustomerApplication.UpdateAsync(model); if (response.IsSuccess) { return(Ok(response)); } else { return(BadRequest(response)); } } catch (Exception ex) { response.Data = null; response.IsSuccess = false; response.Message = ex.Message; return(BadRequest(response)); } }
public async Task <IActionResult> UpdateAsync([FromBody] CustomerDTO customerDTO) { if (customerDTO == null) { return(BadRequest()); } var response = await _customerApplication.UpdateAsync(customerDTO); if (response.IsSuccess) { return(Ok(response)); } return(BadRequest(response.Message)); }