Exemplo n.º 1
0
 public LimitsService(
     string instanceName,
     IDatabase database,
     ILimitsRepository limitsRepository,
     IClientDepositsRepository clientDepositsRepository,
     ILimitsReachedRepository limitsReachedRepository,
     ISettingsService settingsService,
     ILogFactory logFactory,
     IReadOnlyList <string> clientIds
     )
 {
     _instanceName             = instanceName;
     _database                 = database;
     _limitsRepository         = limitsRepository;
     _clientDepositsRepository = clientDepositsRepository;
     _limitsReachedRepository  = limitsReachedRepository;
     _settingsService          = settingsService;
     _clientIds                = clientIds;
     _log = logFactory.CreateLog(this);
 }
Exemplo n.º 2
0
        public SelectionModule(IDataServiceHostSettings dshs, ILimitsRepository limitsRepository)
            : base("ext/selection")
        {
            _dshs         = dshs;
            _repository   = limitsRepository;
            _queryBuilder = new SelectionQueryBuilder();

            Get["/{id}", true] = async(args, ct) =>
            {
                long selectionId = args.id;

                return(await Task.Run(() =>
                {
                    var hostUrl = string.Empty;
                    var selection = _repository.Get <Domain.Models.Selection>(selectionId);
                    var query = _queryBuilder.GetQuery(selection);
                    var client = new DataServiceClient(hostUrl, LoginCredentials.FromToken(_dshs.SystemToken));

                    var result = client.QueryAsync(query, selection.SourceSystem).Result;

                    return Response.AsJson(result);
                }));
            };
        }
Exemplo n.º 3
0
 public LimitsService(ILimitsRepository limitsRepository, ICache cache)
 {
     _limitsRepository = limitsRepository;
     _cache            = cache;
 }
Exemplo n.º 4
0
 public LimitsService(ILimitsRepository limitsRepo)
 {
     _limitsRepo = limitsRepo;
 }