GetMode() public abstract method

public abstract GetMode ( ) : PaginationMode
return PaginationMode
Exemplo n.º 1
0
        public static UserQueryEntity ToUserQuery(this QueryRequest request, QueryDescription qd, QueryEntity query, Pagination defaultPagination, bool withoutFilters)
        {
            var tuple = SmartColumns(request.Columns, qd);

            var defaultMode = defaultPagination.GetMode();
            var defaultElementsPerPage = defaultPagination.GetElementsPerPage();

            var mode = request.Pagination.GetMode();
            var elementsPerPage = request.Pagination.GetElementsPerPage();

            bool isDefaultPaginate = defaultMode == mode && defaultElementsPerPage == elementsPerPage;

            return new UserQueryEntity
            {
                Query = query,
                WithoutFilters = withoutFilters,
                Owner = DefaultOwner(),
                Filters = withoutFilters ? new MList<QueryFilterEntity>() : request.Filters.Select(f => new QueryFilterEntity
                {
                    Token = new QueryTokenEntity(f.Token),
                    Operation = f.Operation,
                    ValueString = FilterValueConverter.ToString(f.Value, f.Token.Type)
                }).ToMList(),
                ColumnsMode = tuple.Item1,
                Columns = tuple.Item2,
                Orders = request.Orders.Select(oo => new QueryOrderEntity
                {
                    Token = new QueryTokenEntity(oo.Token),
                    OrderType = oo.OrderType
                }).ToMList(),
                PaginationMode = isDefaultPaginate ? (PaginationMode?)null : mode,
                ElementsPerPage = isDefaultPaginate ? (int?)null : elementsPerPage,
            };
        }
Exemplo n.º 2
0
 public PaginationTS(Pagination pagination)
 {
     this.mode = pagination.GetMode();
     this.elementsPerPage = pagination.GetElementsPerPage();
     this.currentPage = (pagination as Pagination.Paginate)?.CurrentPage;
 }