public FileService(ReservationDbContext context, IOptionsSnapshot <SiteSettings> siteSettings)
 {
     _context = context;
     _context.CheckArgumentIsNull(nameof(_context));
     _siteSettings = siteSettings;
     _siteSettings.CheckArgumentIsNull(nameof(_siteSettings));
 }
Exemplo n.º 2
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app,
                              IHostingEnvironment env,
                              ILoggerFactory loggerFactory,
                              IGreeter greeter, ReservationDbContext dbContext)
        {
            loggerFactory.AddConsole();

            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            app.UseStaticFiles();

            app.UseAuthentication();

            app.UseNodeModules(env.ContentRootPath);

            app.UseMvc(ConfigureRoute);

            app.Run(async(context) =>
            {
                //var greet = greeter.GreetGuest();
                await context.Response.WriteAsync("");
            });

            DatabaseInitializer.Initialize(dbContext);
        }
 public UsersService(ISecurityService securityService, ReservationDbContext context)
 {
     _securityService = securityService;
     _securityService.CheckArgumentIsNull(nameof(_securityService));
     _context = context;
     _context.CheckArgumentIsNull(nameof(_context));
 }
Exemplo n.º 4
0
 public MemberController(IHostingEnvironment env, ReservationDbContext dbcontext, NPOLJwtTokenService tokensrv, ServiceConfig serviceConfig, SMSService smsService)
 {
     db                 = dbcontext;
     tokenservice       = tokensrv;
     this.serviceConfig = serviceConfig;
     this.smsService    = smsService;
     membersPath        = Path.Combine(env.WebRootPath, "images", "members");
 }
Exemplo n.º 5
0
        public static ReservationDbContext Create()
        {
            var options = CreateNewContextOptions();

            var context = new ReservationDbContext(options);

            return(context);
        }
 public ReservationController(ReservationDbContext dbcontext, NPOLJwtTokenService tokenservice, SMSService smsService, CultureContext cultureContext,
                              ICaptchaProtectionProvider captchaProtectionProvider, IHumanReadableIntegerProvider humanReadableIntegerProvider) : base(cultureContext)
 {
     db = dbcontext;
     this.tokenservice                 = tokenservice;
     this.smsService                   = smsService;
     this.cultureContext               = cultureContext;
     this.captchaProtectionProvider    = captchaProtectionProvider;
     this.humanReadableIntegerProvider = humanReadableIntegerProvider;
 }
Exemplo n.º 7
0
        public static void SeedHostDb(ReservationDbContext context)
        {
            context.SuppressAutoSetTenantId = true;

            // Host seed
            new InitialHostDbBuilder(context).Create();

            // Default tenant seed (in host database).
            new DefaultTenantBuilder(context).Create();
            new TenantRoleAndUserBuilder(context, 1).Create();
        }
Exemplo n.º 8
0
        public DbInitializerService(
            IServiceScopeFactory scopeFactory,
            ISecurityService securityService, ReservationDbContext context)
        {
            _scopeFactory = scopeFactory;
            _scopeFactory.CheckArgumentIsNull(nameof(_scopeFactory));

            _securityService = securityService;
            _securityService.CheckArgumentIsNull(nameof(_securityService));
            _context = context;
            _context.CheckArgumentIsNull(nameof(_context));
        }
        public static void SeedUsers(UserManager <User> userManager, RoleManager <Role> roleManager,
                                     ReservationDbContext reservationDbContext)
        {
            if (userManager.Users.Any())
            {
                return;
            }

            var contactTypes = new List <ContactType>()
            {
                new ContactType {
                    Name = "ContactType #1"
                },
                new ContactType {
                    Name = "ContactType #2"
                },
                new ContactType {
                    Name = "ContactType #3"
                },
            };

            reservationDbContext.ContactTypes.AddRange(contactTypes);
            reservationDbContext.SaveChangesAsync().Wait();

            var roles = new List <Role>()
            {
                new Role()
                {
                    Name = Constants.RoleNameAdmin
                }
            };

            roles.ForEach(role => roleManager.CreateAsync(role).Wait());

            var adminUser = new User()
            {
                UserName = "******"
            };

            userManager.CreateAsync(adminUser, "Password*123").Wait();
            userManager.AddToRoleAsync(adminUser, Constants.RoleNameAdmin).Wait();
        }
        public TokenStoreService(
            ReservationDbContext uow,
            ISecurityService securityService,
            IRolesService rolesService,
            IOptionsSnapshot <BearerTokensOptions> configuration)
        {
            _uow = uow;
            _uow.CheckArgumentIsNull(nameof(_uow));

            _securityService = securityService;
            _securityService.CheckArgumentIsNull(nameof(_securityService));

            _rolesService = rolesService;
            _rolesService.CheckArgumentIsNull(nameof(rolesService));

            _tokens = _uow.Set <UserToken>();

            _configuration = configuration;
            _configuration.CheckArgumentIsNull(nameof(configuration));
        }
 public RoomReserveRepository(ReservationDbContext db)
 {
     Db = db;
 }
Exemplo n.º 12
0
 public SiteRepository(ReservationDbContext context) : base(context)
 {
 }
Exemplo n.º 13
0
 public HostRoleAndUserCreator(ReservationDbContext context)
 {
     _context = context;
 }
Exemplo n.º 14
0
 public GroupAuthenticationService(ReservationDbContext context)
 {
     _context = context;
     _context.CheckArgumentIsNull(nameof(_context));
 }
Exemplo n.º 15
0
 public BookingsController(ReservationDbContext context)
 {
     _context = context;
 }
Exemplo n.º 16
0
 public ContactRepository(ReservationDbContext context) : base(context)
 {
 }
Exemplo n.º 17
0
 public UsersController()
 {
     this.dbContext = new ReservationDbContext();
 }
 public RequestManager(ReservationDbContext context)
 {
     _context = context ?? throw new ArgumentNullException(nameof(context));
 }
Exemplo n.º 19
0
 public OrganizationsController()
 {
     this.dbContext = new ReservationDbContext();
 }
 public InitialHostDbBuilder(ReservationDbContext context)
 {
     _context = context;
 }
 public ContactController(ReservationDbContext context)
 {
     _context = context;
 }
Exemplo n.º 22
0
 public ReservationRepository(ReservationDbContext dbContext) : base(dbContext)
 {
 }
Exemplo n.º 23
0
 public RoomRepository(ReservationDbContext dbContext)
 {
     _dbContext = dbContext;
 }
Exemplo n.º 24
0
 public ServeListRepository()
 {
     _context = new ReservationDbContext();
 }
Exemplo n.º 25
0
 public ProvinceService(ReservationDbContext context)
 {
     _context = context;
     _context.CheckArgumentIsNull(nameof(_context));
 }
Exemplo n.º 26
0
 public BaseRepository(ReservationDbContext context)
 {
     _context = context;
 }
Exemplo n.º 27
0
 protected BaseRepository(ReservationDbContext dbContext)
 {
     currentDbcontext = dbContext;
 }
Exemplo n.º 28
0
 public CartLineRepository()
 {
     _context = new ReservationDbContext();
 }
Exemplo n.º 29
0
 public OrderLineRepository()
 {
     _context = new ReservationDbContext();
 }
Exemplo n.º 30
0
 public ServiceCategoryRepository(ReservationDbContext context) : base(context)
 {
 }