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(); }; }
public App(IPhraseProvider phraseProvider, IInputOutput inputOutputModule, ISettingsProvider settingsProvider, ClientsService clientsService, TradingService tradingService, ShowDbInfoService showDbInfoService) { this.phraseProvider = phraseProvider; this.inputOutputModule = inputOutputModule; this.clientsService = clientsService; this.tradingService = tradingService; this.showDbInfoService = showDbInfoService; try { this.gameSettings = settingsProvider.GetGameSettings(); } catch (ArgumentException ex) { inputOutputModule.WriteOutput(ex.Message); this.gameSettings = null; return; } }
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(); }; }
public TransactionHistoryController(ShowDbInfoService showDbInfoService) { this.showDbInfoService = showDbInfoService; }
public BalanceController(ShowDbInfoService showDbInfoService) { this.showDbInfoService = showDbInfoService; }
public ClientsController(ClientsService clientsService, ShowDbInfoService showDbInfoService) { this.clientsService = clientsService; this.showDbInfoService = showDbInfoService; }
public AutoTrading(TradingService tradingService, ShowDbInfoService showDbInfoService) { this.tradingService = tradingService; this.showDbInfoService = showDbInfoService; }