Ejemplo n.º 1
0
        /// <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);
        }
Ejemplo n.º 2
0
        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;
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 5
0
 public CompanyDetailsDAL(StockReporterContext context)
 {
     _context = context;
 }