示例#1
0
        private void Init()
        {
            _xSerializer           = new XunitSerializer <TImpl>();
            _additionalCriteriaMap = new Dictionary <string, IFilterCriteriaBuilder>();

            _pageCriteria = new DefaultCriteria <int>(CurrentInstance.GetPropertyName(x => x.Page), false);
            _xSerializer.RegisterField(x => x.Page);
            _pageSizeCriteria = new DefaultCriteria <int>(CurrentInstance.GetPropertyName(x => x.PageSize), false);
            _xSerializer.RegisterField(x => x.PageSize);

            SetDefaultPage(1);
            SetDefaultPageSize(10);

            For(x => x.SortBy)
            .UseTransformer(x => x.ToUrlFriendlyValue())
            .UseDefaultValue(DefaultSortBy);

            For(x => x.OrderBy)
            .UseTransformer(x => x.ToUrlFriendlyValue())
            .UseDefaultValue(Order.Asc);

            For(x => x.FreeText)
            .UseDefaultValue(null);

            For(x => x.OwnerId)
            .UseDefaultValue(null);

            OnConfiguring();
        }