예제 #1
0
 public ConnectionService(ForexMinerHeimdallrDbContext dbContext, IConnectionsSecretService connectionsSecretService, IMapper mapper, IOandaApiConnectionFactory oandaApiConnectionFactory)
 {
     _dbContext = dbContext;
     _connectionsSecretService = connectionsSecretService;
     _mapper = mapper;
     _oandaApiConnectionFactory = oandaApiConnectionFactory;
 }
예제 #2
0
 /// <summary>
 /// Instruments history service constructor
 /// Sets up the required services and objects
 /// </summary>
 /// <param name="configuration">Configuration object</param>
 /// <param name="httpClientFactory">Http client factory</param>
 /// <param name="dbContext">Database context</param>
 /// <param name="instrumentStorageService">Instrument storage service</param>
 /// <param name="mapper">Auto mapper service</param>
 public InstrumentHistoryService(
     IConfiguration configuration,
     IHttpClientFactory httpClientFactory,
     ForexMinerHeimdallrDbContext dbContext,
     IInstrumentStorageService instrumentStorageService,
     IMapper mapper,
     IOandaApiConnectionFactory oandaApiConnectionFactory
     )
 {
     _configuration            = configuration;
     _httpClientFactory        = httpClientFactory;
     _retryPolicy              = Policy.Handle <HttpRequestException>().RetryAsync(int.Parse(_configuration["forex-miner-thor:Max-Retries"]));
     _dbContext                = dbContext;
     _instrumentStorageService = instrumentStorageService;
     _mapper = mapper;
     _oandaApiConnectionFactory = oandaApiConnectionFactory;
 }