Skip to content

Commit

Permalink
Merge pull request #2 from rappen/patch-1
Browse files Browse the repository at this point in the history
Fixing #1 GetAll + GetFirst problem
  • Loading branch information
MscrmTools authored Dec 5, 2022
2 parents 0da7ffd + 66058c6 commit cba7502
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions MscrmTools.Shared/Query.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Microsoft.Xrm.Sdk;
using Microsoft.Xrm.Sdk;
using Microsoft.Xrm.Sdk.Query;
using MscrmTools.FluentQueryExpressions.Helpers;
using System;
Expand Down Expand Up @@ -4346,6 +4346,8 @@ public List<T> GetAll(IOrganizationService service)
.ToList();
}

var tmpPagingNumber = QueryExpression.PageInfo.PageNumber;
var tmpPagingCookie = QueryExpression.PageInfo.PagingCookie;
EntityCollection ec;
var list = new List<T>();
do
Expand All @@ -4357,6 +4359,8 @@ public List<T> GetAll(IOrganizationService service)
NextPage(ec.PagingCookie);
} while (ec.MoreRecords);

QueryExpression.PageInfo.PageNumber = tmpPagingNumber;
QueryExpression.PageInfo.PagingCookie = tmpPagingCookie;
return list;
}

Expand Down Expand Up @@ -4576,4 +4580,4 @@ public T GetById(Guid id, IOrganizationService service, bool isActivityEntity =

#endregion Service calls
}
}
}

0 comments on commit cba7502

Please sign in to comment.