public async Task <IActionResult> AddCarState([FromBody] CarStateDTO carState) { if (!ModelState.IsValid) { return(BadRequest("Invalid model")); } var result = await carStateService.AddCarStateAsync(carState); return(Json(result)); }
public async Task <RequestResultDTO> UpdateCarStateAsync(CarStateDTO carStateDTO) { try { var carState = mapper.Map <CarState>(carStateDTO); await unitOfWork.CarStateRepository.UpdateAsync(carState); return(new RequestResultDTO()); } catch (Exception ex) { return(ex.RequestResult()); } }
public async Task <IActionResult> UpdateCarState([FromBody] CarStateDTO carState) { var result = await carStateService.UpdateCarStateAsync(carState); return(Json(result)); }