//*************1.1 define*************** //private ProductRepository _prodectRepo; //private ProjectRepository _projectRepo; //*************1.1*************** public UnitOfWork(JooleEntities entity) { this._je = entity; Products = new ProductRepository(_je); Projects = new ProjectRepository(_je); //need modify the projectRepository, when we add any Repository, we just add here }
public GenericRepository(JooleEntities context) { this.context = context; this.dbSet = context.Set <TEntity>(); }
public GenericRepository(JooleEntities dbcontext) { this._dbcontext = dbcontext; this.dbset = _dbcontext.Set <TEntity>(); }
public ProductRepository(JooleEntities context) : base(context) { }
//***private DbSet<TEnity> _dbset; //private JooleEntities<TEnity> dbSet = new JooleEntities<TEnity>(); public Repository(JooleEntities entity) { this._je = entity; //***_dbset = entity.Set<TEnity>(); }
//private JooleEntities _je; public ProductRepository(JooleEntities entity) : base(entity) { //this._je = entity; }
public ProductRepository(JooleEntities dbcontext) : base(dbcontext) { this._dbcontext = dbcontext; this.dbset = _dbcontext.Set <Product>(); }
//optional constructor, itself will create the Entity**********<top and bottom> public UnitOfWork() { this._je = new JooleEntities(); Products = new ProductRepository(_je); Projects = new ProjectRepository(_je); }
public UserRepository(JooleEntities dbcontext) : base(dbcontext) { this._dbcontext = dbcontext; this.dbset = _dbcontext.Set <User>(); }
public ProjectRepository(JooleEntities entity) : base(entity) { }
public UnitofWork(JooleEntities dbcontext) { this.dbcontext = dbcontext; }