public BusStopOnRouteModel MapToBusStopOnRouteModel() { var result = new BusStopOnRouteModel { Id = this.Id, RouteId = this.RouteId, BusStopId = this.BusStopId, PreviousBusStopOnRouteId = this.PreviousBusStopOnRouteId }; return(result); }
public ArrivalModel(Arrival arrival) { if (arrival == null) { return; } Id = arrival.Id; CourseId = arrival.CourseId; BusStopOnRouteId = arrival.BusStopOnRouteId; Time = arrival.Time; Course = new CourseModel(arrival.Course); BusStopOnRoute = new BusStopOnRouteModel(arrival.BusStopOnRoute); }
public BaseContractResponse UpdateBusStopOnRoute(BusStopOnRouteModel busStopOnRouteModel) { return(ExecuteAction <BaseContractResponse>(r => { var busStopOnRoute = _dbContext.BusStopsOnRoute.FirstOrDefault(u => u.Id == busStopOnRouteModel.Id); busStopOnRoute.Id = busStopOnRouteModel.Id; busStopOnRoute.RouteId = busStopOnRouteModel.RouteId; busStopOnRoute.BusStopId = busStopOnRouteModel.BusStopId; busStopOnRoute.PreviousBusStopOnRouteId = busStopOnRouteModel.PreviousBusStopOnRouteId; _dbContext.BusStopsOnRoute.Update(busStopOnRoute); _dbContext.SaveChanges(); })); }
public CreateBusStopOnRouteResponse CreateBusStopOnRoute(BusStopOnRouteModel busStopOnRouteModel) { return(ExecuteAction <CreateBusStopOnRouteResponse>(r => { var busStopOnRoute = new BusStopOnRoute() { Id = busStopOnRouteModel.Id, RouteId = busStopOnRouteModel.RouteId, BusStopId = busStopOnRouteModel.BusStopId, PreviousBusStopOnRouteId = busStopOnRouteModel.PreviousBusStopOnRouteId }; _dbContext.BusStopsOnRoute.Add(busStopOnRoute); _dbContext.SaveChanges(); r.Id = busStopOnRoute.Id; })); }