Example #1
0
 public BusController(IBusRepository busRepository,
                      IBusRouteRepository busRouteRepository,
                      IMapper mapper,
                      IWebHostEnvironment hostEnvironment)
 {
     this.busRepository      = busRepository;
     this.busRouteRepository = busRouteRepository;
     this.mapper             = mapper;
     this.hostEnvironment    = hostEnvironment;
 }
Example #2
0
 public BusRouteQuery(IBusRouteRepository busRouteRepository)
 {
     Field <ListGraphType <BusRouteType> >("BusStops",
                                           //arguments for the current query.
                                           arguments: new QueryArguments(new QueryArgument <IntGraphType> {
         Name = "hour"
     }, new QueryArgument <IntGraphType> {
         Name = "minute"
     }),
                                           resolve: context => {
         var hour   = context.GetArgument <int>("hour");
         var minute = context.GetArgument <int>("minute");
         return(busRouteRepository.GetRoutsForAllTheStops(hour, minute));
     });
 }
Example #3
0
        public BusRouteService(IBusRouteRepository repository)
        {
            Guard.ArgumentNotNull(repository, nameof(repository));

            _repository = repository;
        }
Example #4
0
 public BusRouteType(IBusRouteRepository busRouteRepository)
 {
     Field(x => x.Name);
     Field(x => x.NextStop);
     Field(x => x.ForStop);
 }