示例#1
0
 public FilesController(TolkDbContext dbContext, ISwedishClock clock, IOptions <TolkOptions> options, IAuthorizationService authorizationService)
 {
     _dbContext            = dbContext;
     _clock                = clock;
     _options              = options.Value;
     _authorizationService = authorizationService;
 }
示例#2
0
 public RequestGroupController(
     TolkDbContext dbContext,
     IAuthorizationService authorizationService,
     RequestService requestService,
     ISwedishClock clock,
     ILogger <OrderController> logger,
     IOptions <TolkOptions> options,
     InterpreterService interpreterService,
     PriceCalculationService priceCalculationService,
     OrderService orderService,
     ListToModelService listToModelService,
     CacheService cacheService)
 {
     _dbContext            = dbContext;
     _authorizationService = authorizationService;
     _requestService       = requestService;
     _clock                   = clock;
     _logger                  = logger;
     _options                 = options.Value;
     _interpreterService      = interpreterService;
     _priceCalculationService = priceCalculationService;
     _cacheService            = cacheService;
     _orderService            = orderService;
     _listToModelService      = listToModelService;
 }
        public EntityScheduler(IServiceProvider services, ILogger <EntityScheduler> logger, ISwedishClock clock, IOptions <TolkOptions> options)
        {
            _services = services;
            _logger   = logger;
            _clock    = clock;
            _options  = options?.Value;

            timeToRun = _options.HourToRunDailyJobs;
            if (_clock == null)
            {
                throw new ArgumentNullException(nameof(clock));
            }

            DateTimeOffset now = _clock.SwedenNow;

            now -= now.TimeOfDay;

            nextDailyRunTime = now - now.TimeOfDay;
            nextDailyRunTime = nextDailyRunTime.AddHours(timeToRun);

            if (_clock.SwedenNow.Hour > timeToRun)
            {
                // Next remind is tomorrow
                nextDailyRunTime = nextDailyRunTime.AddDays(1);
            }

            _logger.LogInformation("Created EntityScheduler instance");
        }
示例#4
0
 public WebHookService(
     ILogger <WebHookService> logger,
     IOptions <TolkOptions> options,
     ISwedishClock clock)
 {
     _logger  = logger;
     _options = options?.Value;
     _clock   = clock;
 }
示例#5
0
 public EmailService(
     ILogger <EmailService> logger,
     IOptions <TolkOptions> options,
     ISwedishClock clock)
 {
     _logger                = logger;
     _options               = options?.Value;
     _clock                 = clock;
     _senderPrepend         = !string.IsNullOrWhiteSpace(_options.Env.DisplayName) ? $"{_options.Env.DisplayName} " : string.Empty;
     _secondLineSupportMail = _options.Support?.SecondLineEmail;
 }
示例#6
0
 public UserService(
     TolkDbContext dbContext,
     UserManager <AspNetUser> userManager,
     IOptions <TolkOptions> options,
     ISwedishClock clock,
     INotificationService notificationService,
     ILogger <UserService> logger)
 {
     _dbContext           = dbContext;
     _userManager         = userManager;
     _options             = options?.Value;
     _clock               = clock;
     _notificationService = notificationService;
     _logger              = logger;
 }
示例#7
0
 public RequisitionController(
     TolkDbContext dbContext,
     IAuthorizationService authorizationService,
     ILogger <RequisitionController> logger,
     IOptions <TolkOptions> options,
     RequisitionService requisitionService,
     ListToModelService listToModelService,
     EventLogService eventLogService
     )
 {
     _dbContext            = dbContext;
     _authorizationService = authorizationService;
     _logger             = logger;
     _options            = options?.Value;
     _requisitionService = requisitionService;
     _listToModelService = listToModelService;
     _eventLogService    = eventLogService;
 }
示例#8
0
 public OrderAgreementController(
     TolkDbContext dbContext,
     IAuthorizationService authorizationService,
     OrderService orderService,
     ISwedishClock clock,
     ILogger <OrderAgreementController> logger,
     IOptions <TolkOptions> options,
     OrderAgreementService orderAgreementService,
     CacheService cacheService
     )
 {
     _dbContext            = dbContext;
     _authorizationService = authorizationService;
     _orderService         = orderService;
     _clock   = clock;
     _logger  = logger;
     _options = options?.Value;
     _orderAgreementService = orderAgreementService;
     _cacheService          = cacheService;
 }
示例#9
0
 public AccountController(
     UserManager <AspNetUser> userManager,
     SignInManager <AspNetUser> signInManager,
     ILogger <AccountController> logger,
     TolkDbContext dbContext,
     IUserClaimsPrincipalFactory <AspNetUser> claimsFactory,
     UserService userService,
     IOptions <TolkOptions> options,
     ISwedishClock clock,
     IdentityErrorDescriber identityErrorDescriber,
     INotificationService notificationService)
 {
     _userManager            = userManager;
     _signInManager          = signInManager;
     _logger                 = logger;
     _dbContext              = dbContext;
     _claimsFactory          = claimsFactory;
     _userService            = userService;
     _options                = options.Value;
     _clock                  = clock;
     _identityErrorDescriber = identityErrorDescriber;
     _notificationService    = notificationService;
 }
示例#10
0
 public TolkBaseOptionsService(IOptions <TolkOptions> options)
 {
     _options = options?.Value;
 }
示例#11
0
 public TolkOptionsRequirementHandler(IOptions <TolkOptions> options)
 {
     _options = options?.Value;
 }
示例#12
0
 public abstract bool Evaluate(TolkOptions options);