public EmailController( TolkDbContext dbContext, INotificationService notificationService) { _dbContext = dbContext; _notificationService = notificationService; }
public FilesController(TolkDbContext dbContext, ISwedishClock clock, IOptions <TolkOptions> options, IAuthorizationService authorizationService) { _dbContext = dbContext; _clock = clock; _options = options.Value; _authorizationService = authorizationService; }
public async Task CallWebHooks() { List <int> callIds = null; using (TolkDbContext context = _options.GetContext()) { callIds = await context.OutboundWebHookCalls .Where(e => e.DeliveredAt == null && e.FailedTries < NumberOfTries && !e.IsHandling) .Select(e => e.OutboundWebHookCallId) .ToListAsync(); if (callIds.Any()) { var calls = context.OutboundWebHookCalls .Where(e => callIds.Contains(e.OutboundWebHookCallId) && e.IsHandling == false) .Select(c => c); await calls.ForEachAsync(c => c.IsHandling = true); await context.SaveChangesAsync(); } } _logger.LogInformation("Found {count} outbound web hook calls to send: {callIds}", callIds.Count, string.Join(", ", callIds)); if (callIds.Any()) { var tasks = new List <Task>(); foreach (var callId in callIds) { tasks.Add(Task.Factory.StartNew(() => CallWebhook(callId), CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Current)); } await Task.Factory.ContinueWhenAny(tasks.ToArray(), r => { }); } }
public ComplaintServiceTests() { _tolkDbContext = CreateTolkDbContext(); _logger = Mock.Of <ILogger <ComplaintService> >(); _notificationService = new StubNotificationService(); _clock = new StubSwedishClock("2018-12-12 00:00:00"); }
public SystemMessageController( TolkDbContext dbContext, ISwedishClock clock) { _dbContext = dbContext; _clock = clock; }
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 StatisticsServiceTests() { _tolkDbContext = CreateTolkDbContext(); _clock = new StubSwedishClock(DateTimeOffset.Now.ToString()); var mockLanguages = MockEntities.MockLanguages; var mockRankings = MockEntities.MockRankings; var mockCustomers = MockEntities.MockCustomers; var mockCustomerUsers = MockEntities.MockCustomerUsers(mockCustomers); var mockOrders = MockEntities.MockOrders(mockLanguages, mockRankings, mockCustomerUsers); var mockRequisitions = MockEntities.MockRequisitions(mockOrders); var mockComplaints = MockEntities.MockComplaints(mockOrders); var regions = Region.Regions; //Initialize data if not already initialized if (!_tolkDbContext.CustomerOrganisations.Any()) { _tolkDbContext.AddRange(mockCustomers); _tolkDbContext.AddRange(mockCustomerUsers); _tolkDbContext.AddRange(mockLanguages); _tolkDbContext.AddRange(mockRankings); _tolkDbContext.AddRange(mockOrders); _tolkDbContext.AddRange(mockRequisitions); _tolkDbContext.AddRange(mockComplaints); _tolkDbContext.AddRange(regions); } _tolkDbContext.SaveChanges(); _statService = new StatisticsService(_tolkDbContext, _clock); }
public LanguageController( TolkDbContext dbContext, VerificationService verificationService) { _dbContext = dbContext; _verificationService = verificationService; }
public FaqController( TolkDbContext dbContext, ISwedishClock clock) { _dbContext = dbContext; _clock = clock; }
public WebhookController(TolkDbContext dbContext, INotificationService notificationService, IAuthorizationService authorizationService) { _dbContext = dbContext; _notificationService = notificationService; _authorizationService = authorizationService; }
public StatisticsService( TolkDbContext dbContext, ISwedishClock clock ) { _dbContext = dbContext; _clock = clock; }
public AssignmentController(TolkDbContext dbContext, IAuthorizationService authorizationService, ISwedishClock clock) { _dbContext = dbContext; _authorizationService = authorizationService; _clock = clock; }
public ContractController( TolkDbContext dbContext, ISwedishClock clock, CacheService cacheService) { _dbContext = dbContext; _clock = clock; _cacheService = cacheService; }
public ApiUserService(TolkDbContext dbContext, ILogger <ApiUserService> logger, InterpreterService interpreterService ) { _logger = logger; _dbContext = dbContext; _interpreterService = interpreterService; }
public TolkClaimsPrincipalFactory( UserManager <AspNetUser> userManager, RoleManager <IdentityRole <int> > roleManager, IOptions <IdentityOptions> optionsAccessor, TolkDbContext dbContext) : base(userManager, roleManager, optionsAccessor) { _dbContext = dbContext; }
public SelectListService( IDistributedCache cache, TolkDbContext dbContext, IHttpContextAccessor httpContextAccessor) { _cache = cache; _dbContext = dbContext; _httpContextAccessor = httpContextAccessor; }
public PriceCalculationService(TolkDbContext dbContext, DateCalculationService dateCalculationService, CacheService cacheService ) { _dbContext = dbContext; _dateCalculationService = dateCalculationService; _cacheService = cacheService; }
public ErrorNotificationService( ILogger <ErrorNotificationService> logger, INotificationService notificationService, TolkDbContext tolkDbContext ) { _logger = logger; _notificationService = notificationService; _tolkDbContext = tolkDbContext; }
private CacheService CreateCacheService(TolkDbContext dbContext) { IDistributedCache cache = Mock.Of <IDistributedCache>(); TolkBaseOptionsService optionService = new TolkBaseOptionsService(Options.Create(new TolkOptions() { RoundPriceDecimals = true })); return(new CacheService(cache, dbContext, optionService)); }
public InterpreterController( TolkDbContext dbContext, IAuthorizationService authorizationService, InterpreterService interpreterService, ISwedishClock clock) { _dbContext = dbContext; _authorizationService = authorizationService; _interpreterService = interpreterService; _clock = clock; }
public ComplaintService( TolkDbContext dbContext, ISwedishClock clock, INotificationService notificationService, ILogger <ComplaintService> logger ) { _dbContext = dbContext; _clock = clock; _notificationService = notificationService; _logger = logger; }
public UnitController( TolkDbContext dbContext, ISwedishClock clock, IAuthorizationService authorizationService, UserService userService ) { _dbContext = dbContext; _clock = clock; _authorizationService = authorizationService; _userService = userService; }
private OrderAgreementService CreateOrderAgreementService(TolkDbContext dbContext, StubSwedishClock clock = null) { IDistributedCache cache = Mock.Of <IDistributedCache>(); TolkBaseOptionsService optionService = new TolkBaseOptionsService(Options.Create(new TolkOptions() { RoundPriceDecimals = true })); _cache = new CacheService(cache, dbContext, optionService); var emailService = new EmailService(Mock.Of <ILogger <EmailService> >(), Options.Create(new TolkOptions()), _clock); return(new OrderAgreementService(dbContext, _logger, clock ?? _clock, _cache, new DateCalculationService(_cache), optionService, emailService)); }
public ComplaintController( TolkDbContext tolkDbContext, ComplaintService complaintService, ApiUserService apiUserService, ApiOrderService apiOrderService, ILogger <ComplaintController> logger ) { _dbContext = tolkDbContext; _apiUserService = apiUserService; _complaintService = complaintService; _apiOrderService = apiOrderService; _logger = logger; }
public RequisitionService( TolkDbContext dbContext, ISwedishClock clock, INotificationService notificationService, ILogger <RequisitionService> logger, PriceCalculationService priceCalculationService ) { _dbContext = dbContext; _clock = clock; _notificationService = notificationService; _logger = logger; _priceCalculationService = priceCalculationService; }
public RequisitionController( TolkDbContext tolkDbContext, ILogger <RequisitionController> logger, RequisitionService requisitionService, ApiUserService apiUserService, ApiOrderService apiOrderService ) { _dbContext = tolkDbContext; _logger = logger; _apiUserService = apiUserService; _requisitionService = requisitionService; _apiOrderService = apiOrderService; }
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; }
public RequestGroupController( TolkDbContext tolkDbContext, RequestService requestService, ApiUserService apiUserService, ISwedishClock timeService, ApiOrderService apiOrderService, ILogger <RequestController> logger) { _dbContext = tolkDbContext; _apiUserService = apiUserService; _timeService = timeService; _requestService = requestService; _apiOrderService = apiOrderService; _logger = logger; }
public CustomerController( TolkDbContext dbContext, IAuthorizationService authorizationService, RoleManager <IdentityRole <int> > roleManager, INotificationService notificationService, CacheService cacheService, ISwedishClock clock) { _dbContext = dbContext; _authorizationService = authorizationService; _roleManager = roleManager; _notificationService = notificationService; _cacheService = cacheService; _clock = clock; }
public OrderController( TolkDbContext tolkDbContext, OrderService orderService, ApiOrderService apiOrderService, ApiUserService apiUserService, ITolkBaseOptions tolkBaseOptions, ILogger <OrderController> logger) { _dbContext = tolkDbContext; _orderService = orderService; _apiOrderService = apiOrderService; _tolkBaseOptions = tolkBaseOptions; _logger = logger; _apiUserService = apiUserService; }