When I do this:
currentPage = metadataResponse.ApplicationType.Pages.Find(
page => page.SortOrder == ++currentPage.SortOrder);
The value of currentPage
is null.
But the same logic, when I assign the increment value to an integer variable, and then try to get the currentPage
int sortOrder = ++currentPage.SortOrder;
currentPage = metadataResponse.ApplicationType.Pages.Find(
page => page.SortOrder == sortOrder);
currentPage
gets populated.
Does anyone have a good answer as to why one works and the other doesn't?