public SPCamlQuery(SPCamlQuery query) : this() { if (query == null) { return; } DatesInUtc = query.DatesInUtc; FolderPath = query.FolderPath; RowLimit = query.RowLimit; Scope = query.Scope; SortBy = query.SortBy; SortOrder = query.SortOrder; GroupBy = query.GroupBy; GroupOrder = query.GroupOrder; if (query.ViewFields != null) { ViewFields = (string[])query.ViewFields.Clone(); } Where = query.Where; }
internal static SP.CamlQuery ToSPCamlRequest(this SPCamlQuery query, string pagingInfo = null) { var camlQuery = new SP.CamlQuery { DatesInUtc = query.DatesInUtc, ViewXml = query.ViewXml }; if (!string.IsNullOrEmpty(query.FolderPath)) { camlQuery.FolderServerRelativeUrl = query.FolderPath; } if (!string.IsNullOrEmpty(pagingInfo)) { camlQuery.ListItemCollectionPosition = new SP.ListItemCollectionPosition { PagingInfo = pagingInfo }; } return(camlQuery); }