Beispiel #1
0
 static void Bootstrap(Logger logger)
 {
     Task.Run((Action)(async() =>
     {
         if (await AecUserManager.CreateDefaultUserIfStoreIsEmptyAsync(AuthConfig.StartupAdminUser, AuthConfig.StartupAdminPassword))
         {
             logger.Warn("Database was empty, created default admin user.");
         }
     }));
 }
 public BookingRepository(
     BookingCabinsComparer bookingComparer,
     CabinRepository cabinRepository,
     CruiseRepository cruiseRepository,
     DeletedBookingRepository deletedBookingRepository,
     PriceCalculator priceCalculator,
     ProductRepository productRepository,
     CredentialsGenerator credentialsGenerator,
     AecUserManager userManager)
 {
     _bookingComparer          = bookingComparer;
     _cabinRepository          = cabinRepository;
     _cruiseRepository         = cruiseRepository;
     _deletedBookingRepository = deletedBookingRepository;
     _priceCalculator          = priceCalculator;
     _productRepository        = productRepository;
     _credentialsGenerator     = credentialsGenerator;
     _userManager = userManager;
 }
Beispiel #3
0
        static IContainer ConfigureContainer(HttpConfiguration config)
        {
            var container = new Container().WithWebApi(config);

            container.Register <AecCredentialsGenerator, CredentialsGenerator>(Reuse.Singleton);
            container.Register <AecOAuthProvider>(Reuse.Singleton);
            container.Register <AecPaymentRepository>(Reuse.Singleton);
            container.Register <AecPaymentsController <Booking> >(Reuse.Singleton);
            container.Register <AecUserManager>(Made.Of(() => AecUserManager.Create()), Reuse.Singleton);
            container.Register <AecUsersController>(Reuse.Singleton);
            container.Register <AllocationRepository>(Reuse.Singleton);
            container.Register <BookingRepository>(Reuse.Singleton);
            container.Register <BookingCandidateRepository>(Reuse.Singleton);
            container.Register <CabinRepository>(Reuse.Singleton);
            container.Register <CredentialsGenerator>(Reuse.Singleton);
            container.Register <EventRepository>(Reuse.Singleton);
            container.Register <DayBookingRepository>(Reuse.Singleton);

            return(container);
        }
Beispiel #4
0
        static IContainer ConfigureContainer(HttpConfiguration config)
        {
            var container = new Container().WithWebApi(config);

            container.Register <AecCredentialsGenerator, CredentialsGenerator>(Reuse.Singleton);
            container.Register <AecOAuthProvider>(Reuse.Singleton);
            container.Register <AecPaymentRepository>(Reuse.Singleton);
            container.Register <AecPaymentsController <Booking> >(Reuse.Singleton);
            container.Register <AecUserManager>(Made.Of(() => AecUserManager.Create()), Reuse.Singleton);
            container.Register <AecUsersController>(Reuse.Singleton);
            container.Register <BookingCabinsComparer>(Reuse.Singleton);
            container.Register <BookingRepository>(Reuse.Singleton);
            container.Register <CabinRepository>(Reuse.Singleton);
            container.Register <CredentialsGenerator>(Reuse.Singleton);
            container.Register <CruiseRepository>(Reuse.Singleton);
            container.Register <DeletedBookingRepository>(Reuse.Singleton);
            container.Register <PriceCalculator>(Reuse.Singleton);
            container.Register <ProductRepository>(Reuse.Singleton);
            container.Register <ReportingService>(Reuse.Singleton);
            container.Register <ReportRepository>(Reuse.Singleton);

            SqlMapper.AddTypeHandler(new SubCruiseCodeTypeHandler());
            return(container);
        }
 public AecUsersController(AecCredentialsGenerator credentialsGenerator, AecUserManager userManager)
 {
     _credentialsGenerator = credentialsGenerator;
     _userManager          = userManager;
 }
Beispiel #6
0
 public BookingRepository(CredentialsGenerator credentialsGenerator, AecUserManager userManager)
 {
     _credentialsGenerator = credentialsGenerator;
     _userManager          = userManager;
 }