public CompanyController(ILogger <CompanyController> logger, ICompanyDAO companyDAO, ITickerDAO tickerDAO, IExchangeDAO exchangeDAO, ICompanyExchangeDAO companyExchangeDAO) { _logger = logger; this.companyDAO = companyDAO; this.tickerDAO = tickerDAO; this.exchangeDAO = exchangeDAO; this.companyExchangeDAO = companyExchangeDAO; }
public void SetUp() { // Insert seed data into the database using one instance of the context using (var context = new CompanyDBContext(options)) { context.Database.EnsureDeleted(); context.Exchange.Add(new Exchange { Name = "New York Stock Exchange" }); context.Exchange.Add(new Exchange { Name = "Nasdaq" }); context.Exchange.Add(new Exchange { Name = "Japan Exchange Group" }); context.Exchange.Add(new Exchange { Name = "London Stock Exchange" }); context.Exchange.Add(new Exchange { Name = "Shanghai Stock Exchange" }); context.Exchange.Add(new Exchange { Name = "Hong Kong Stock Exchange" }); context.Exchange.Add(new Exchange { Name = "Euronext" }); context.Exchange.Add(new Exchange { Name = "Toronto Stock Exchange" }); context.SaveChanges(); } dao = new ExchangeDAO(new CompanyDBContext(options)); }