static void Main(string[] args) { db = new MTOContext(); if (args.Length >= 1) { BigDataGenerator generator = new BigDataGenerator(db); foreach (string arg in args) { switch (arg) { case "--generateData": generator.generate(); break; case "--generateUsers": generator.generateUsers(); break; } } return; } Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new FormLogin()); }
public BigDataGenerator(MTOContext db) { this.db = db; startDateDefault = new DateTime(DateTime.Now.Year - 3, 1, 1); finalDateDefault = new DateTime(DateTime.Now.Year + 1, 1, 1); daysRange = (finalDateDefault - startDateDefault).Days; }
public BaseRepository(MTOContext mtoContext = null) { if (mtoContext == null) { mtoContext = new MTOContext(); this._isTemp = true; } this.DbSet = mtoContext.Set <T>(); this.MTOContext = mtoContext; }
public BaseRepository(MTOContext context = null) { if (context == null) { context = new MTOContext(); this._isTemp = true; } this.DbSet = context.Set <T>(); this.DBContext = context; }
public UnitOfWork() { this._mtoContext = new MTOContextFactory().GetMTOContext(); }
public UnitOfWork(MTOContext mtoContext) { this._mtoContext = mtoContext; }
public MTOContextFactory() { this._mtoContext = new MTOContext(); }