public async Task <IActionResult> CreateRoute([FromBody] CreateRouteDto routeDto) { var route = _mapper.Map <Route>(routeDto); await _routeService.CreateRouteAsync(route, CurrentUserId); return(Ok()); }
public async Task <ActionResult> CreateOrUpadateRoute(EditRouteViewModel route) { if (route.RouteId == default(int)) { await _routeService.CreateRouteAsync(route.Name, route.CarId, route.DepartureParkingId, route.ArrivalParkingId); } else { await _routeService.UpadeRouteAsync(route.RouteId, route.Name, route.CarId, route.DepartureParkingId, route.ArrivalParkingId); } var routes = await _routeViewModelService.GetAllRouteAsync(); return(RedirectToAction("MyRoutes")); }
public async Task <CreateRouteResponseModel> CreateRoute(CreateRouteRequestModel createRouteRequest) { return(await _routeService.CreateRouteAsync(createRouteRequest)); }