Example #1
0
        public PostController(
            IPostService postService,
            PostViewModelProvider postViewModelProvider,
            CategoryViewModelProvider categoryViewModelProvider,
            IOptionsSnapshot <BehlogSetting> setting,
            FileUploadHelper fileUploader,
            ITagService tagService
            )
        {
            postService.CheckArgumentIsNull();
            _postService = postService;

            postViewModelProvider.CheckArgumentIsNull();
            _postViewModelProvider = postViewModelProvider;

            categoryViewModelProvider.CheckArgumentIsNull();
            _categoryViewModelProvider = categoryViewModelProvider;

            setting.CheckArgumentIsNull();
            _setting = setting;

            fileUploader.CheckArgumentIsNull();
            _fileUploader = fileUploader;

            tagService.CheckArgumentIsNull(nameof(tagService));
            _tagService = tagService;
        }
        public RegisterController(
            IApplicationUserManager userManager,
            IPasswordValidator <User> passwordValidator,
            IUserValidator <User> userValidator,
            IEmailSender emailSender,
            IOptionsSnapshot <SiteSettings> siteOptions,
            ILogger <RegisterController> logger
            )
        {
            _userManager = userManager;
            _userManager.CheckArgumentIsNull(nameof(_userManager));

            _passwordValidator = passwordValidator;
            _passwordValidator.CheckArgumentIsNull(nameof(_passwordValidator));

            _userValidator = userValidator;
            _userValidator.CheckArgumentIsNull(nameof(_userValidator));

            _emailSender = emailSender;
            _emailSender.CheckArgumentIsNull(nameof(_emailSender));

            _logger = logger;
            _logger.CheckArgumentIsNull(nameof(_logger));

            _siteOptions = siteOptions;
            _siteOptions.CheckArgumentIsNull(nameof(_siteOptions));
        }
 public FileService(ReservationDbContext context, IOptionsSnapshot <SiteSettings> siteSettings)
 {
     _context = context;
     _context.CheckArgumentIsNull(nameof(_context));
     _siteSettings = siteSettings;
     _siteSettings.CheckArgumentIsNull(nameof(_siteSettings));
 }
Example #4
0
 public SmsService(IOptionsSnapshot <SiteSettings> siteSettings, HttpClient httpclient)
 {
     _siteSettings = siteSettings;
     _siteSettings.CheckArgumentIsNull(nameof(_siteSettings));
     _httpClient = httpclient;
     _httpClient.CheckArgumentIsNull(nameof(_httpClient));
 }
        public UserTokenStorageService(
            IUnitOfWork unitOfWork,
            ISecurityService securityService,
            IUserTokenFactoryService userTokenFactoryService,
            IRoleService roleService,
            IUserRoleService userRoleService,
            IGroupRoleService groupRoleService,
            IOptionsSnapshot <SiteSettings> options)
        {
            _unitOfWork = unitOfWork;
            _unitOfWork.CheckArgumentIsNull(nameof(_unitOfWork));

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

            _userTokenFactoryService = userTokenFactoryService;
            _userTokenFactoryService.CheckArgumentIsNull(nameof(userTokenFactoryService));

            _roleService = roleService;
            _roleService.CheckArgumentIsNull(nameof(roleService));

            _userRoleService = userRoleService;
            _userRoleService.CheckArgumentIsNull(nameof(_userRoleService));

            _groupRoleService = groupRoleService;
            _groupRoleService.CheckArgumentIsNull(nameof(_groupRoleService));

            options.CheckArgumentIsNull(nameof(options));
            _bearerTokensOptions = options.Value.BearerTokensOptions;

            _userTokenStorages = _unitOfWork.Set <UserTokenStorage>();
        }
Example #6
0
        public TokenStoreService(
            IUnitOfWork uow,
            ISecurityService securityService,
            IRolesService rolesService,
            IUsersService userService,
            IOptionsSnapshot <BearerTokensOptions> configuration)
        {
            _uow = uow;
            _uow.CheckArgumentIsNull(nameof(_uow));

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

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

            _userService = userService;
            _rolesService.CheckArgumentIsNull(nameof(userService));

            _tokens = _uow.Repository <UserToken>() as IUserTokenRepository;
            _users  = _uow.Repository <User>() as IUserRepository;

            _configuration = configuration;
            _configuration.CheckArgumentIsNull(nameof(configuration));
        }
Example #7
0
 public FileService(ExperienceManagementDbContext context, IOptionsSnapshot <SiteSettings> siteSettings)
 {
     _context = context;
     _context.CheckArgumentIsNull(nameof(_context));
     _siteSettings = siteSettings;
     _siteSettings.CheckArgumentIsNull(nameof(_siteSettings));
 }
 public FileService(StockAssistanceProviderDbContext context, IOptionsSnapshot <SiteSettings> siteSettings)
 {
     _context = context;
     _context.CheckArgumentIsNull(nameof(_context));
     _siteSettings = siteSettings;
     _siteSettings.CheckArgumentIsNull(nameof(_siteSettings));
 }
Example #9
0
        public IdentityDbInitializer(
            IApplicationUserManager applicationUserManager,
            IServiceScopeFactory scopeFactory,
            IApplicationRoleManager roleManager,
            IOptionsSnapshot <SiteSettings> adminUserSeedOptions,
            ILogger <IdentityDbInitializer> logger,
            IApiResourceRepository apiResourceRepository,
            IIdentityResourceDataSeeder identityResourceDataSeeder,
            IClientRepository clientRepository,
            IApiScopeRepository apiScopeRepository,
            IConfiguration configuration
            )
        {
            _applicationUserManager = applicationUserManager;
            _applicationUserManager.CheckArgumentIsNull(nameof(_applicationUserManager));

            _scopeFactory = scopeFactory;
            _scopeFactory.CheckArgumentIsNull(nameof(_scopeFactory));

            _roleManager = roleManager;
            _roleManager.CheckArgumentIsNull(nameof(_roleManager));

            _adminUserSeedOptions = adminUserSeedOptions;
            _adminUserSeedOptions.CheckArgumentIsNull(nameof(_adminUserSeedOptions));

            _logger = logger;
            _apiResourceRepository      = apiResourceRepository;
            _identityResourceDataSeeder = identityResourceDataSeeder;
            _clientRepository           = clientRepository;
            _apiScopeRepository         = apiScopeRepository;
            _configuration = configuration;
            _logger.CheckArgumentIsNull(nameof(_logger));
        }
Example #10
0
        public ChangePasswordController(
            IApplicationUserManager userManager,
            IApplicationSignInManager signInManager,
            IEmailSender emailSender,
            IPasswordValidator <User> passwordValidator,
            IUsedPasswordsService usedPasswordsService,
            IOptionsSnapshot <SiteSettings> siteOptions)
        {
            _userManager = userManager;
            _userManager.CheckArgumentIsNull(nameof(_userManager));

            _signInManager = signInManager;
            _signInManager.CheckArgumentIsNull(nameof(_signInManager));

            _passwordValidator = passwordValidator;
            _passwordValidator.CheckArgumentIsNull(nameof(_passwordValidator));

            _usedPasswordsService = usedPasswordsService;
            _usedPasswordsService.CheckArgumentIsNull(nameof(_usedPasswordsService));

            _emailSender = emailSender;
            _emailSender.CheckArgumentIsNull(nameof(_emailSender));

            _siteOptions = siteOptions;
            _siteOptions.CheckArgumentIsNull(nameof(_siteOptions));
        }
Example #11
0
        public FooterViewComponent(/*IMenuService menuService,*/ IOptionsSnapshot <ShowingSettingSite> settings)
        {
            //_menuService = menuService;
            //_menuService.CheckArgumentIsNull(nameof(_menuService));

            _settings = settings;
            _settings.CheckArgumentIsNull(nameof(_settings));
        }
Example #12
0
        public SiteSettingsController(IOptionsSnapshot <ShowingSettingSite> settings, IHostingEnvironment hostingEnvironment)
        {
            _settings = settings;
            _settings.CheckArgumentIsNull(nameof(_settings));

            _hostingEnvironment = hostingEnvironment;
            _hostingEnvironment.CheckArgumentIsNull(nameof(_hostingEnvironment));
        }
Example #13
0
        public RobotsController(IPageService pageService, IOptionsSnapshot <ShowingSettingSite> settings)
        {
            _pageService = pageService;
            _pageService.CheckArgumentIsNull(nameof(_pageService));

            _settings = settings;
            _settings.CheckArgumentIsNull(nameof(_settings));
        }
Example #14
0
        public MenuViewComponent(IMenuService menuService, IOptionsSnapshot <ShowingSettingSite> settings)
        {
            _menuService = menuService;
            _menuService.CheckArgumentIsNull(nameof(_menuService));

            _settings = settings;
            _settings.CheckArgumentIsNull(nameof(_settings));
        }
Example #15
0
        public HomeController(IContactUsService contactUsService, IOptionsSnapshot <ShowingSettingSite> settings)
        {
            _contactUsService = contactUsService;
            _contactUsService.CheckArgumentIsNull(nameof(_contactUsService));

            _settings = settings;
            _settings.CheckArgumentIsNull(nameof(_settings));
        }
        public AuthMessageSender(
            IOptionsSnapshot <SiteSettings> smtpConfig,
            IWebMailService webMailService)
        {
            _smtpConfig = smtpConfig;
            _smtpConfig.CheckArgumentIsNull(nameof(_smtpConfig));

            _webMailService = webMailService;
            _webMailService.CheckArgumentIsNull(nameof(webMailService));
        }
Example #17
0
        public AuthMessageSender(
            IOptionsSnapshot <SiteSettings> smtpConfig,
            IViewRendererService viewRendererService)
        {
            _smtpConfig = smtpConfig;
            _smtpConfig.CheckArgumentIsNull(nameof(_smtpConfig));

            _viewRendererService = viewRendererService;
            _viewRendererService.CheckArgumentIsNull(nameof(_viewRendererService));
        }
        public CustomUserValidator(IdentityErrorDescriber errors, IOptionsSnapshot <AppSettings> configurationRoot) : base(errors)
        {
            configurationRoot.CheckArgumentIsNull(nameof(configurationRoot));
            _emailsBanList = new HashSet <string>(configurationRoot.Value.EmailsBanList, StringComparer.OrdinalIgnoreCase);

            if (!_emailsBanList.Any())
            {
                throw new InvalidOperationException("Please fill the emails ban list in the appsettings.json file.");
            }
        }
Example #19
0
        public FileUploadHelper(
            IWebHostEnvironment webHost,
            IOptionsSnapshot <BehlogSetting> setting
            )
        {
            webHost.CheckArgumentIsNull();
            _webHost = webHost;

            setting.CheckArgumentIsNull();
            _setting = setting;
        }
        public ContactUsManagementController(IContactUsService contactUsService, IOptionsSnapshot <SiteSettings> siteOptions, IEmailSender emailSender)
        {
            _contactUsService = contactUsService;
            _contactUsService.CheckArgumentIsNull(nameof(_contactUsService));

            _siteOptions = siteOptions;
            _siteOptions.CheckArgumentIsNull(nameof(_siteOptions));

            _emailSender = emailSender;
            _emailSender.CheckArgumentIsNull(nameof(_emailSender));
        }
        public AppPasswordvalidator(
            IOptionsSnapshot <IdentitySettings> configurationRoot)
        {
            configurationRoot.CheckArgumentIsNull(nameof(configurationRoot));
            _passwordsBanList = new HashSet <string>(configurationRoot.Value.PasswordsBanList, StringComparer.OrdinalIgnoreCase);

            if (!_passwordsBanList.Any())
            {
                throw new InvalidOperationException("Please fill the passwords ban list in the appsettings.json file.");
            }
        }
Example #22
0
        public DbInitializer(IServiceScopeFactory scopeFactory, IOptionsSnapshot <SiteSettings> adminUserSeedOptions, ISecurityService securityService)
        {
            _scopeFactory = scopeFactory;
            _scopeFactory.CheckArgumentIsNull(nameof(_scopeFactory));

            _adminUserSeedOptions = adminUserSeedOptions;
            _adminUserSeedOptions.CheckArgumentIsNull(nameof(_adminUserSeedOptions));

            _securityService = securityService;
            _securityService.CheckArgumentIsNull(nameof(_securityService));
        }
        public TokenStoreService(
            IUserTokenRepository userTokenRepository,
            IOptionsSnapshot <BearerTokensOptions> configuration,
            ITokenFactoryService tokenFactoryService)
        {
            _userTokenRepository = userTokenRepository;

            _configuration = configuration;
            _configuration.CheckArgumentIsNull(nameof(configuration));

            _tokenFactoryService = tokenFactoryService;
            _tokenFactoryService.CheckArgumentIsNull(nameof(tokenFactoryService));
        }
Example #24
0
        public TokenFactoryService(
            IRoleService rolesService,
            IOptionsSnapshot <BearerTokensOptions> configuration,
            ILogger <TokenFactoryService> logger)
        {
            _rolesService = rolesService;
            _rolesService.CheckArgumentIsNull(nameof(rolesService));

            _configuration = configuration;
            _configuration.CheckArgumentIsNull(nameof(configuration));

            _logger = logger;
            _logger.CheckArgumentIsNull(nameof(logger));
        }
Example #25
0
        public UsersPhotoService(
            IHttpContextAccessor contextAccessor,
            IHostingEnvironment hostingEnvironment,
            IOptionsSnapshot <SiteSettings> siteSettings)
        {
            _contextAccessor = contextAccessor;
            _contextAccessor.CheckArgumentIsNull(nameof(_contextAccessor));

            _hostingEnvironment = hostingEnvironment;
            _hostingEnvironment.CheckArgumentIsNull(nameof(_hostingEnvironment));

            _siteSettings = siteSettings;
            _siteSettings.CheckArgumentIsNull(nameof(_siteSettings));
        }
        public TokenFactoryService(ISecurityService securityService, IRolesService rolesService, IOptionsSnapshot <SiteSettings> siteSettings, ILogger <TokenFactoryService> logger)
        {
            _securityService = securityService;
            _securityService.CheckArgumentIsNull(nameof(_securityService));

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

            _siteSettings = siteSettings;
            _siteSettings.CheckArgumentIsNull(nameof(_siteSettings));

            _logger = logger;
            _logger.CheckArgumentIsNull(nameof(_logger));
        }
Example #27
0
        public TokenStoreService(IUnitOfWork uow, ISecurityService securityService, IOptionsSnapshot <BearerTokensOptions> configuration, ITokenFactoryService tokenFactoryService)
        {
            _uow = uow;
            _uow.CheckArgumentIsNull(nameof(_uow));

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

            _tokens = _uow.Set <UserToken>();

            _configuration = configuration;
            _configuration.CheckArgumentIsNull(nameof(configuration));

            _tokenFactoryService = tokenFactoryService;
            _tokenFactoryService.CheckArgumentIsNull(nameof(tokenFactoryService));
        }
Example #28
0
        public CustomPasswordValidator(
            IdentityErrorDescriber errors,// How to use CustomIdentityErrorDescriber
            IOptionsSnapshot <SiteSettings> configurationRoot,
            IUsedPasswordsService usedPasswordsService) : base(errors)
        {
            _usedPasswordsService = usedPasswordsService;
            _usedPasswordsService.CheckArgumentIsNull(nameof(_usedPasswordsService));

            configurationRoot.CheckArgumentIsNull(nameof(configurationRoot));
            _passwordsBanList = new HashSet <string>(configurationRoot.Value.PasswordsBanList, StringComparer.OrdinalIgnoreCase);

            if (!_passwordsBanList.Any())
            {
                throw new InvalidOperationException("Please fill the passwords ban list in the appsettings.json file.");
            }
        }
Example #29
0
        public ShowPageController(IOptionsSnapshot <ShowingSettingSite> settings, IPageService pageService, ICategoryService categoryService, IApplicationUserManager applicationUserManager, IContactUsService contactUsService)
        {
            _settings = settings;
            _settings.CheckArgumentIsNull(nameof(_settings));

            _pageService = pageService;
            _pageService.CheckArgumentIsNull(nameof(_pageService));

            _categoryService = categoryService;
            _categoryService.CheckArgumentIsNull(nameof(_categoryService));

            _applicationUserManager = applicationUserManager;
            _applicationUserManager.CheckArgumentIsNull(nameof(_applicationUserManager));

            _contactUsService = contactUsService;
            _contactUsService.CheckArgumentIsNull(nameof(_contactUsService));
        }
Example #30
0
        protected ApplicationDbContextBase(
            IOptionsSnapshot <SiteSettings> siteSettings,
            IHttpContextAccessor httpContextAccessor,
            IHostingEnvironment hostingEnvironment,
            ILogger <ApplicationDbContextBase> logger)
        {
            SiteSettings = siteSettings;
            SiteSettings.CheckArgumentIsNull(nameof(SiteSettings));

            HttpContextAccessor = httpContextAccessor;
            HttpContextAccessor.CheckArgumentIsNull(nameof(HttpContextAccessor));

            HostingEnvironment = hostingEnvironment;
            HostingEnvironment.CheckArgumentIsNull(nameof(HostingEnvironment));

            Logger = logger;
            Logger.CheckArgumentIsNull(nameof(Logger));
        }