Example #1
0
 public TradingPersistenceServiceMiddleware(
     TradingPersistenceService tradingPersistenceService,
     ILogger logger, RequestDelegate next)
 {
     _tradingPersistenceService = tradingPersistenceService;
     _logger = logger;
     _next   = next;
 }
Example #2
0
        private static void Main(string[] args)
        {
            TradingPersistenceService tradingPersistenceService = null;

            try
            {
                Console.WriteLine(@"
                                     █████╗ ██╗       ██████╗ ██████╗ ████████╗██╗ ██████╗ ███╗   ██╗
                                    ██╔══██╗██║      ██╔═══██╗██╔══██╗╚══██╔══╝██║██╔═══██╗████╗  ██║
                                    ███████║██║█████╗██║   ██║██████╔╝   ██║   ██║██║   ██║██╔██╗ ██║
                                    ██╔══██║██║╚════╝██║   ██║██╔═══╝    ██║   ██║██║   ██║██║╚██╗██║
                                    ██║  ██║██║      ╚██████╔╝██║        ██║   ██║╚██████╔╝██║ ╚████║
                                    ╚═╝  ╚═╝╚═╝       ╚═════╝ ╚═╝        ╚═╝   ╚═╝ ╚═════╝ ╚═╝  ╚═══╝");
                var services = new ServiceCollection();
                var startup  = new Startup();
                var provider = startup.ConfigureServices(services);


                //migrate
                Task.Run(() =>
                {
                    var sql = provider.GetService <IMsSqlDatabaseMigrator>();
                    EventFlowEventStoresMsSql.MigrateDatabase(sql);
                    EventFlowSnapshotStoresMsSql.MigrateDatabase(sql);
                });


                tradingPersistenceService = provider.GetService <TradingPersistenceService>();
                tradingPersistenceService.InitializeTradingsServiceAsync().Wait();


                while (true)
                {
                    var input = Console.ReadLine();
                    switch (input)
                    {
                    case "-l": {
                        tradingPersistenceService.GetListOfSubscribe();
                        break;
                    }
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                Console.ReadLine();
            }
        }
Example #3
0
        private static void Main(string[] args)
        {
            TradingPersistenceService tradingPersistenceService = null;

            try {
                Console.WriteLine("iqoption-follower-starting");

                var services = new ServiceCollection();

                //    // Startup.cs finally :)
                var startup         = new Startup();
                var serviceProvider = startup.ConfigureServices(services);


                tradingPersistenceService = serviceProvider.GetService <TradingPersistenceService>();
                tradingPersistenceService.InitializeTradingsServiceAsync().Wait();
            }
            catch (Exception ex) {
                Console.WriteLine(ex.Message);
            }
            finally {
                Console.ReadLine();
            }
        }