Beispiel #1
0
        public async Task <IPagedResult <FunctionOutputPageList> > GetFunctionPageAsync(FunctionPageRequestDto request)
        {
            OrderCondition <Function>[] orderConditions = new OrderCondition <Function>[] { new OrderCondition <Function>(o => o.CreatedTime, SortDirection.Descending) };
            request.OrderConditions = orderConditions;
            Expression <Func <Function, bool> > expression = o => true;

            if (request.MenuIds?.Any() == true)
            {
                var functionIds = _menuFunctionRepository.Entities.Where(o => request.MenuIds.Contains(o.MenuId)).Select(o => o.FunctionId);
                expression = o => !functionIds.Contains(o.Id);
                //if (functionIds.Any())
                //{
                //    request.Filter.Conditions.Add(new FilterCondition() { Field = "Id", Value = functionIds, Operator = FilterOperator.In });
                //}
            }
            return(await _functionRepository.Entities.Where(expression).ToPageAsync <Function, FunctionOutputPageList>(request));
        }
 public async Task <PageList <FunctionOutputPageList> > GetFunctionPageAsync([FromBody] FunctionPageRequestDto request)
 {
     return((await _functionService.GetFunctionPageAsync(request)).ToPageList());
 }