public IQueryable <T> FindAll(params Expression <Func <T, object> >[] includeProperties) { IQueryable <T> items = _context.Set <T>(); if (includeProperties != null) { foreach (var includeProperty in includeProperties) { items = items.Include(includeProperty); } } return(items.AsQueryable()); }
public async Task <IEnumerable <TEntity> > GetAllByAsync() { return(await _dbContext.Set <TEntity>().AsNoTracking().ToListAsync()); }
public Repository(CMSContext dbContext) { _dbContext = dbContext; DbSet = _dbContext.Set <TEntity>(); }
public void Add(T Entity) { cmsContext.Set <T>().Add(Entity); cmsContext.SaveChanges(); }
public Repository(CMSContext db) { this.db = db; this.dbSet = db.Set <TEntity>(); }
public T GetByKey(Guid key) { var dbset = _context.Set <T>(); return(dbset.Find(key)); }