// private readonly IMemoryCache memoryCache;
        public ActivitiesController(IActivitiesService activitiesService, IDestinationsService destinationsService /*, IMemoryCache memoryCache*/)
        {
            this.activitiesService   = activitiesService;
            this.destinationsService = destinationsService;

            // this.memoryCache = memoryCache;
        }
Beispiel #2
0
        // private readonly IMemoryCache memoryCache;
        public RestaurantsController(IRestaurantsService restaurantsService, IDestinationsService destinationsService /*, IMemoryCache memoryCache*/)
        {
            this.restaurantsService  = restaurantsService;
            this.destinationsService = destinationsService;

            // this.memoryCache = memoryCache;
        }
Beispiel #3
0
 public HomeController(IDestinationsService destinationsService, IUsersService usersService, IReservationsService reservationService, UserManager <ApplicationUser> userManager, IHotelsService hotelsService)
 {
     this.destinationsService = destinationsService;
     this.usersService        = usersService;
     this.reservationService  = reservationService;
     this.userManager         = userManager;
     this.hotelsService       = hotelsService;
 }
Beispiel #4
0
        public BusesController(
            IDestinationsService destinationsService,
            IBusesService busesService)
        {
            if (destinationsService is null)
            {
                throw new ArgumentNullException(nameof(destinationsService));
            }

            if (busesService is null)
            {
                throw new ArgumentNullException(nameof(busesService));
            }

            this.destinationsService = destinationsService;
            this.busesService        = busesService;
        }
Beispiel #5
0
        public FlightsController(
            IDestinationsService destinationsService,
            IFlightsService flightsService)
        {
            // Guard clauses
            if (destinationsService is null)
            {
                throw new ArgumentNullException(nameof(destinationsService));
            }

            if (flightsService is null)
            {
                throw new ArgumentNullException(nameof(flightsService));
            }

            this.destinationsService = destinationsService;
            this.flightsService      = flightsService;
        }
Beispiel #6
0
        public static IEnumerable <SelectListItem> GetAllDestinations(IDestinationsService destinationsService)
        {
            var destinations = destinationsService.GetAllDestinationsAsync().GetAwaiter().GetResult();
            var groups       = new List <SelectListGroup>();

            foreach (var destinationViewModel in destinations)
            {
                if (groups.All(g => g.Name != destinationViewModel.CountryName))
                {
                    groups.Add(new SelectListGroup {
                        Name = destinationViewModel.CountryName
                    });
                }
            }

            return(destinations.Select(x => new SelectListItem
            {
                Value = x.Id.ToString(),
                Text = x.Name,
                Group = groups.FirstOrDefault(g => g.Name == x.CountryName),
            }).OrderBy(x => x.Group.Name));
        }
 public FlightsController(IDestinationsService destinationsService, IFlightsService flightsService)
 {
     this.destinationsService = destinationsService;
     this.flightsService      = flightsService;
 }
 public DestinationsController(IDestinationsService destinationsService, ICountriesService countriesService)
 {
     this.destinationsService = destinationsService;
     this.countriesService    = countriesService;
 }
Beispiel #9
0
 public HotelsController(IDestinationsService destinationsService, IHotelsService hotelsService)
 {
     this.destinationsService = destinationsService;
     this.hotelsService       = hotelsService;
 }
Beispiel #10
0
        // private readonly IMemoryCache memoryCache;
        public DestinationsController(IDestinationsService destinationsService /*, IMemoryCache memoryCache*/)
        {
            this.destinationsService = destinationsService;

            // this.memoryCache = memoryCache;
        }
Beispiel #11
0
 public BusesController(IBusesService busesService, IDestinationsService destinationsService)
 {
     this.busesService        = busesService;
     this.destinationsService = destinationsService;
 }
Beispiel #12
0
 public OrganizedTripsController(IOrganizedTripsService tripsService, IHotelsService hotelsService, IDestinationsService destinationsService)
 {
     this.tripsService        = tripsService;
     this.hotelsService       = hotelsService;
     this.destinationsService = destinationsService;
 }
Beispiel #13
0
 public RestaurantsController(IRestaurantsService restaurantsService, IDestinationsService destinationsService)
 {
     this.restaurantsService  = restaurantsService;
     this.destinationsService = destinationsService;
 }
 public DestinationsController(IDestinationsService destinationsService)
 {
     this.destinationsService = destinationsService;
 }
Beispiel #15
0
 public OrganizedTripsController(IDestinationsService destinationsService, IOrganizedTripsService organizedTripsService)
 {
     this.destinationsService   = destinationsService;
     this.organizedTripsService = organizedTripsService;
 }
 public ActivitiesController(IActivitiesService activitiesService, IDestinationsService destinationsService)
 {
     this.activitiesService   = activitiesService;
     this.destinationsService = destinationsService;
 }