Esempio n. 1
0
        static void Main(string[] args)
        {
            Logger            logger   = new Logger(log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType));
            TradeSimDbContext database = new TradeSimDbContext();

            //repo
            AccountTableRepository       accountTableRepository       = new AccountTableRepository(database);
            ClientsTableRepository       clientsTableRepository       = new ClientsTableRepository(database);
            StockPriceTableRepository    stockPriceTableRepository    = new StockPriceTableRepository(database);
            HistoryTableRepository       historyTableRepository       = new HistoryTableRepository(database);
            StockOfClientTableRepository stockOfClientTableRepository = new StockOfClientTableRepository(database);

            ClientsService    clientService     = new ClientsService(clientsTableRepository, accountTableRepository, stockPriceTableRepository, stockOfClientTableRepository, logger);
            TradingService    tradingService    = new TradingService(accountTableRepository, stockPriceTableRepository, historyTableRepository, stockOfClientTableRepository, logger);
            ShowDbInfoService showDbInfoService = new ShowDbInfoService(clientsTableRepository, accountTableRepository, stockPriceTableRepository, historyTableRepository, stockOfClientTableRepository);

            IPhraseProvider   phraseProvider    = new JsonPhraseProvider();
            IInputOutput      inputOutputModule = new ConsoleIO();
            ISettingsProvider settingsProvider  = new SettingsProvider();

            App app = new App(phraseProvider, inputOutputModule, settingsProvider, clientService, tradingService, showDbInfoService);

            using (database)
            {
                app.Run();
            };
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            Logger            logger   = new Logger(log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType));
            TradeSimDbContext database = new TradeSimDbContext();

            //repo
            AccountTableRepository       accountTableRepository       = new AccountTableRepository(database);
            ClientsTableRepository       clientsTableRepository       = new ClientsTableRepository(database);
            StockPriceTableRepository    stockPriceTableRepository    = new StockPriceTableRepository(database);
            HistoryTableRepository       historyTableRepository       = new HistoryTableRepository(database);
            StockOfClientTableRepository stockOfClientTableRepository = new StockOfClientTableRepository(database);

            ClientsService    clientService     = new ClientsService(clientsTableRepository, accountTableRepository, stockPriceTableRepository, stockOfClientTableRepository, logger);
            TradingService    tradingService    = new TradingService(accountTableRepository, stockPriceTableRepository, historyTableRepository, stockOfClientTableRepository, logger);
            ShowDbInfoService showDbInfoService = new ShowDbInfoService(clientsTableRepository, accountTableRepository, stockPriceTableRepository, historyTableRepository, stockOfClientTableRepository);

            AutoTrading autoTrading = new AutoTrading(tradingService, showDbInfoService);

            using (database)
            {
                autoTrading.Run();
            };
        }