예제 #1
0
        public static GraphQueryBase <TDto> ExtractParams <TDto>(this GraphQueryBase <TDto> request,
                                                                 IResolverContext context)
        {
            var page       = context.Argument <int>("page") <= 0 ? 1 : context.Argument <int>("page");
            var pageSize   = context.Argument <int>("pageSize") <= 0 ? 20 : context.Argument <int>("pageSize");
            var filterExpr = context.GetQueryableFilterExpr <TDto>();
            var sortExpr   = context.GetQueryableSortExpr <TDto>();

            request.Page           = page;
            request.PageSize       = pageSize;
            request.FilterExpr     = filterExpr;
            request.SortingVisitor = sortExpr;

            return(request);
        }