/// <summary>
        /// Get All the entities
        /// </summary>
        /// <returns></returns>
        public IQueryable <T> GetAll()
        {
            IList <int>    tenants = GetTenantIds();
            IQueryable <T> query   = dbContext.Set <T>().Where(a => tenants.Contains(a.TenantId));

            //var tenants = _db..Assets.Include(a => a.Tenant).Include(a => a.AssetMake).Include(a => a.Category).Include(a => a.WarrantyPeriod).Where(t => userTenants.Contains(t.TenantId));
            return(query);
        }
Example #2
0
 public GenericRepository(CustomApplicationDbContext context)
 {
     _context = context;
     _dbSet   = context.Set <T>();
 }
        /// <summary>
        /// Get All the entities
        /// </summary>
        /// <returns></returns>
        public IQueryable <T> GetAll()
        {
            IQueryable <T> query = _db.Set <T>();

            return(query);
        }