public AbsPendingRecordProcess(StockDBContext stockdbContext) : base(stockdbContext) { this.pageInfo = new PageInfo() { PageIndex = 1, PageSize = 500 }; this.needLoop = false; }
private static void InitializeDbContext(IConfiguration config, ILog log) { log.Info("Initialzie StockDBContext ...."); DbContextOptions <StockDBContext> dbContextOption = new DbContextOptions <StockDBContext>(); DbContextOptionsBuilder <StockDBContext> dbContextOptionBuilder = new DbContextOptionsBuilder <StockDBContext>(dbContextOption); StockDBContext stockDBContext = new StockDBContext(dbContextOptionBuilder.UseMySql(config.GetConnectionString("StockDBConnection")).Options); DataContextPool.AddDataContext(stockDBContext); log.Info("Initialize StockDBContext successfully and add it to Context Pool"); }
public DownloadPerfProcessTest() { var config = new ConfigurationBuilder().Build(); string connection = config.GetConnectionString("StockDBConnection"); if (String.IsNullOrEmpty(connection)) { connection = "server=localhost;port=3306;database=stock;uid=jeesite;pwd=123456;charset=utf8;TreatTinyAsBoolean=true"; } this.dbContext = new StockDBContext(connection); DataContextPool.AddDataContext(dbContext); }
public void TestContext() { var config = new ConfigurationBuilder().Build(); string connection = config.GetConnectionString("StockDBConnection"); if (String.IsNullOrEmpty(connection)) { connection = "server=localhost;port=3306;database=stock;uid=jeesite;pwd=123456;charset=utf8;TreatTinyAsBoolean=true"; } StockDBContext sdb = new StockDBContext(connection); StockInfo si = sdb.StockInfos.Find("abc"); if (si == null) { si = new StockInfo() { Id = "abc", Name = "abc", BriefName = "abc", Type = StockType.Stock, Symbol = "abc", Market = "test", Status = StockStatus.Closed, }; sdb.StockInfos.Add(si); sdb.SaveChanges(); } si = sdb.StockInfos.Find("abc"); Assert.NotNull(si); Assert.Equal("abc", si.Id); var stockInfo = sdb.StockInfos.Where(t => t.Id == si.Id).FirstOrDefault(); Assert.NotNull(stockInfo); string key = "cn_070013_20190812"; var perf = sdb.StockPerfs.Find(key); if (perf == null) { perf = new StockPerf() { Id = key, Date = new DateTime(2019, 8, 12), StockId = "cn_070013", }; sdb.StockPerfs.Add(perf); } perf.Close = 1.78m; sdb.SaveChanges(); }
public StockPerfsController(StockDBContext context) { _context = context; }
public StatementsController(StockDBContext context) { _context = context; }
public MasterPortfoliosController(StockDBContext context) { _context = context; }
public UserRepository(StockDBContext context) { _context = context; }
public StockCompaniesDataService(StockDBContext stockDBContext) { this.stockDBContext = stockDBContext; }
public StrategySubjectsController(StockDBContext context) { _context = context; }
public AdminRepository(StockDBContext context) { _context = context; }
public AccountRepository(StockDBContext dbcontext) { this.dbcontext = dbcontext; }
public AccountRepository(StockDBContext context) { this.context = context; }
/// <summary> /// Constructor para el controlador de la entidad Product /// </summary> /// <param name="context">DbContext</param> public StockController(StockDBContext context) { this._context = context; this._negocioBLL = new StockBLL(new StockDAL(this._context)); }
public DepotController(StockDBContext context) { _context = context; }
public HomeController(StockDBContext context) { _context = context; }
public StrategiesController(StockDBContext context) { _context = context; }
public PortfolioHoldingsController(StockDBContext context) : base(context) { }
public StockBaseController(StockDBContext context) { _context = context; }
public AbsStockProcess(StockDBContext stockdbContext) { this.stockDBContext = stockdbContext; }
public AbsStockProcess() { this.stockDBContext = DataContextPool.GetDataContext <StockDBContext>(); }
public UserRepository(StockDBContext dbcontext) { this.dbcontext = dbcontext; }
public AdminRepository(StockDBContext dbcontext) { this.dbcontext = dbcontext; }
public StockInfoesController(StockDBContext context) { _context = context; }
/// <summary> /// Constructor para el la comunicacion con base de datos de la tabla Product /// </summary> /// <param name="context">DbContext</param> public StockDAL(StockDBContext context) { _context = context; }