/// <summary> /// Establishes the startup values. /// </summary> /// <param name="config">The configuration.</param> private static void EstablishStartupValues(IConfigurationRoot config) { DbContextOptions <StockReporterContext> options; var builder = new DbContextOptionsBuilder <StockReporterContext>(); builder.UseSqlServer((config.GetConnectionString("StockReporterConnection"))); options = builder.Options; _context = new StockReporterContext(options); _repository = new CompanyDetailsDAL(_context); }
public void Initialize() { DbContextOptions <StockReporterContext> options; var builder = new DbContextOptionsBuilder <StockReporterContext>(); builder.UseInMemoryDatabase("StockReporter"); options = builder.Options; _context = new StockReporterContext(options); _repository = new CompanyDetailsDAL(_context); isETF = false; isMutalFund = false; }
public LoadExternalFilesToDb(StockReporterContext context, IGenericRepository <CompanyDetail, string> repository) { _context = context; _repository = repository; delimiter = "|"; isETF = false; isMutualFund = false; string[] columnNames = { }; var fileName = ""; loadFileToDb = new LoadFileToDb(fileName, columnNames); }
public void Initialize() { var config = new ConfigurationBuilder() .AddJsonFile("appsettings.json") .Build(); DbContextOptions <StockReporterContext> options; var builder = new DbContextOptionsBuilder <StockReporterContext>(); builder.UseInMemoryDatabase("StockReporter"); options = builder.Options; _context = new StockReporterContext(options); _repository = new CompanyDetailsDAL(_context); }
public CompanyDetailsDAL(StockReporterContext context) { _context = context; }