示例#1
0
        public static CamlOrderBy ThenBy(this CamlOrderBy orderBy, CamlFieldRef fieldRef)
        {
            if (orderBy == null)
            {
                orderBy = new CamlOrderBy(fieldRef);
            }
            var fields = new List <CamlFieldRef>(orderBy)
            {
                fieldRef
            };

            return(new CamlOrderBy(fields));
        }
示例#2
0
        public static CamlGroupBy BeforeBy(this CamlGroupBy groupBy, CamlFieldRef fieldRef, bool?collapse = null, int?limit = null)
        {
            if (groupBy == null)
            {
                return(new CamlGroupBy(fieldRef, collapse, limit));
            }
            if (groupBy.Collapse != null)
            {
                collapse = collapse == null ? groupBy.Collapse.Value : collapse.Value | groupBy.Collapse.Value;
            }
            if (groupBy.Limit != null)
            {
                limit = limit == null ? groupBy.Limit.Value : Math.Max(limit.Value, groupBy.Limit.Value);
            }
            var fields = new List <CamlFieldRef> {
                fieldRef
            };

            fields.AddRange(groupBy);
            return(new CamlGroupBy(fields, collapse, limit));
        }