Beispiel #1
0
        /// <summary>
        /// گرفتن کاربران شرایط خاص
        /// </summary>
        /// <param name="filter"></param>
        /// <returns></returns>
        public IQueryable <Users> GetUsers(FilterUserSSOT filter)
        {
            var model = TableNoTracking
                        .WhereIf(filter == FilterUserSSOT.AllUser, a => true)
                        .WhereIf(filter == FilterUserSSOT.ActiveUser, a => a.IsActive)
                        .WhereIf(filter == FilterUserSSOT.DeActiveUser, a => !a.IsActive);

            return(model);
        }
 public async Task <List <ProductDiscountDTO> > DiscountToAll(Expression <Func <ProductDiscount, bool> > where = null
                                                              , Func <IQueryable <ProductDiscount>, IOrderedQueryable <ProductDiscount> > orderBy = null)
 => await TableNoTracking.WhereIf(where != null, where).OrderByIf(orderBy != null, orderBy)
 .ProjectTo <ProductDiscountDTO>().ToListAsync();