예제 #1
0
        static void Main(string[] args)
        {
            try
            {
                Console.Title = "Daily Exchange Rate Processing - Batch";

                var           container     = GetIocContainer();
                IForexService _forexService = container.Resolve <IForexService>();

                Console.WriteLine("Starting batch");
                var data = _forexService.SyncLatestExchangeRatesInDB();
                Console.WriteLine("Processing ended");

                if (data)
                {
                    Console.WriteLine("Sync successed");
                }
                else
                {
                    Console.WriteLine("Nothing Synced");
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("Fatal error: " + ex.Message);
                Console.ReadKey();
            }
        }
예제 #2
0
        public AlphaVantageServiceFactory()
        {
            _httpClient = new HttpClient();
            var service = new AlphaVantageService(_httpClient, AppSettings, CacheService);

            Forex = service;
        }
        public GetGroupTotalQueryHandler(IUserCacheService cacheService,
                                         IGroupRepository groupRepository,
                                         ITransactionRepository transactionRepository,
                                         ICurrencyRepository currencyRepository,
                                         IForexService forexService)
            : base(cacheService)
        {
            _groupRepository       = groupRepository;
            _transactionRepository = transactionRepository;
            _currencyRepository    = currencyRepository;
            _forexService          = forexService;

            cacheService.SetSlidingExpiration(TimeSpan.FromMinutes(10));
        }
        public GetAssetsTotalQueryHandler(IUserCacheService cacheService,
                                          IAssetRepository assetRepository,
                                          ITransactionRepository transactionRepository,
                                          ICurrencyRepository currencyRepository,
                                          IForexService forexService,
                                          IMapper mapper)
            : base(cacheService)
        {
            _assetRepository       = assetRepository;
            _transactionRepository = transactionRepository;
            _currencyRepository    = currencyRepository;
            _forexService          = forexService;
            _mapper = mapper;

            cacheService.SetSlidingExpiration(TimeSpan.FromMinutes(10));
        }
        public GetAssetGroupedTransactionsQueryHandler(IUserCacheService cacheService,
                                                       IAssetRepository assetRepository,
                                                       ITransactionRepository transactionRepository,
                                                       IForexService forexService,
                                                       IUserRepository userRepository,
                                                       ICurrencyRepository currencyRepository,
                                                       IDefaults defaults,
                                                       IMapper mapper)
            : base(cacheService)
        {
            _assetRepository       = assetRepository;
            _transactionRepository = transactionRepository;
            _forexService          = forexService;
            _userRepository        = userRepository;
            _currencyRepository    = currencyRepository;
            _defaults = defaults;
            _mapper   = mapper;

            cacheService.SetSlidingExpiration(TimeSpan.FromMinutes(10));
        }
 public Application(IForexService forexService)
 {
     _forexService = forexService;
 }
예제 #7
0
 public CurrencyController(IForexService forexService)
 {
     _forexService = forexService;
 }
예제 #8
0
 public ForexController(IFixerService fixerService, IForexService forexService)
 {
     _fixerService = fixerService;
     _forexService = forexService;
 }
예제 #9
0
 public ForexServiceClient(ForexServiceClientOptions options)
 {
     this._options      = options ?? throw new ArgumentNullException(nameof(options));
     this._forexService = ServiceProxy.Create <IForexService>(options.ForexServiceUrl);
 }
예제 #10
0
        public CurrencyManager(IForexService forexService)
        {
            _forexService = forexService;

            Initialize();
        }
예제 #11
0
 public CryptoController(ICryptoService cryptoService, IForexService forexService)
 {
     this.cryptoService = cryptoService;
     this.forexService  = forexService;
 }
예제 #12
0
 public ForexController(IForexService forexService)
 {
     _forexService = forexService;
 }
예제 #13
0
 public CryptoController(IHttpContextAccessor httpContextAccessor, ICryptoService cryptoService, IForexService forexService, ICryptoTickerRepository cryptoTickerRepository) : base(httpContextAccessor)
 {
     this.cryptoService          = cryptoService;
     this.forexService           = forexService;
     this.cryptoTickerRepository = cryptoTickerRepository;
 }
예제 #14
0
 public Application(IForexService forexService)
 {
     _forexService = forexService;
 }
예제 #15
0
 public ComodityController(IHttpContextAccessor httpContextAccessor, IComodityService comodityService, IForexService forexService) : base(httpContextAccessor)
 {
     this.comodityService = comodityService;
     this.forexService    = forexService;
 }