public async Task <IList <WecharMenu> > YaeherModuleList(YaeherConditionalMenuIn YaeherConditionalMenuInfo)
        {
            var query = await _menurepository.GetAll().Where(YaeherConditionalMenuInfo.Expression).ToListAsync();

            List <WecharMenu>            wecharMenus            = new List <WecharMenu>();
            List <YaeherConditionalMenu> yaeherConditionalMenus = query.Where(a => a.ParentID == 0).ToList();

            foreach (var item in yaeherConditionalMenus)
            {
                WecharMenu wecharMenu = new WecharMenu();
                wecharMenu.Id                  = item.Id;
                wecharMenu.RoleCode            = item.RoleCode;
                wecharMenu.RoleName            = item.RoleName;
                wecharMenu.TagId               = item.TagId;
                wecharMenu.ConditionalName     = item.ConditionalName;
                wecharMenu.ConditionalType     = item.ConditionalType;
                wecharMenu.ConditionalTypeName = item.ConditionalTypeName;
                wecharMenu.ConditionalUrl      = item.ConditionalUrl;
                wecharMenu.AppID               = item.AppID;
                wecharMenu.Pagepath            = item.Pagepath;
                wecharMenu.ParentID            = item.ParentID;
                wecharMenu.MenuID              = item.MenuID;
                wecharMenu.CreatedOn           = item.CreatedOn;
                wecharMenu.children            = GetChild(query.ToList(), item.Id);
                wecharMenus.Add(wecharMenu);
            }
            return(wecharMenus);
        }
 /// <summary>
 /// 输出模型
 /// </summary>
 /// <param name="YaeherConditionalMenuDto"></param>
 /// <param name="YaeherConditionalMenuInfo"></param>
 public YaeherConditionalMenuOut(PagedResultDto <YaeherConditionalMenu> YaeherConditionalMenuDto, YaeherConditionalMenuIn YaeherConditionalMenuInfo)
 {
     Items          = YaeherConditionalMenuDto.Items;
     TotalCount     = YaeherConditionalMenuDto.TotalCount;
     TotalPage      = YaeherConditionalMenuDto.TotalCount / YaeherConditionalMenuInfo.MaxResultCount;
     SkipCount      = YaeherConditionalMenuInfo.SkipCount;
     MaxResultCount = YaeherConditionalMenuInfo.MaxResultCount;
 }
        public async Task <IList <YaeherConditionalMenu> > YaeherConditionalMenuList(YaeherConditionalMenuIn YaeherConditionalMenuInfo)
        {
            var query = _menurepository.GetAll().OrderByDescending(a => a.CreatedOn).Where(YaeherConditionalMenuInfo.Expression);

            return(await query.ToListAsync());
        }
        public async Task <PagedResultDto <YaeherConditionalMenu> > YaeherConditionalMenuPage(YaeherConditionalMenuIn YaeherConditionalMenuInfo)
        {
            //初步过滤
            var query = _menurepository.GetAll().OrderByDescending(a => a.CreatedOn).Where(YaeherConditionalMenuInfo.Expression);
            //获取总数
            var tasksCount = query.Count();
            //获取总数
            var totalpage = tasksCount / YaeherConditionalMenuInfo.MaxResultCount;
            var YaeherConditionalMenuList = await query.PageBy(YaeherConditionalMenuInfo.SkipTotal, YaeherConditionalMenuInfo.MaxResultCount).ToListAsync();

            return(new PagedResultDto <YaeherConditionalMenu>(tasksCount, YaeherConditionalMenuList.MapTo <List <YaeherConditionalMenu> >()));
        }