// WorkPosDbContext _dbContext=new WorkPosDbContext(); public Repository(WorkPosDbContext dbContext) { // ObjectContext nesnesi oluşturyoruz. _dbContext = dbContext; _dbSet = dbContext.Set <T>(); }
public ModelObjects(string connstring) { this.Connstring = connstring; _dbproductContext = new WorkPosDbContext(); _uow = new UnitOfWork(_dbproductContext); _repositoryBrand = new Repository <PRODUCT_BRANDS>(_dbproductContext); _repositoryModel = new Repository <PRODUCT_BRANDS_MODEL>(_dbproductContext); _repositoryUnit = new Repository <SETUP_UNIT>(_dbproductContext); _repositoryPCat = new Repository <PRODUCT_CAT>(_dbproductContext); }
public ModelProduct() { var dbContext = new WorkPosDbContext(); _uow = new UnitOfWork(dbContext); _repository = new Repository <PRODUCT>(dbContext); _repositoryStock = new Repository <STOCKS>(dbContext); _repositoryUnit = new Repository <PRODUCT_UNIT>(dbContext); _repositoryProductCat = new Repository <PRODUCT_CAT>(dbContext); _repositoryPs = new Repository <PRICE_STANDART>(dbContext); }
public UnitOfWork(WorkPosDbContext dbContext) { Database.SetInitializer <WorkPosDbContext>(null); if (dbContext == null) { throw new ArgumentNullException("dbContext can not be null."); } _dbContext = dbContext; // Buradan istediğiniz gibi EntityFramework'ü konfigure edebilirsiniz. //_dbContext.Configuration.LazyLoadingEnabled = false; //_dbContext.Configuration.ValidateOnSaveEnabled = false; //_dbContext.Configuration.ProxyCreationEnabled = false; }
public ModelObjects(string connstring) { this.Connstring = connstring; _dbproductContext = new WorkPosDbContext(); }