当我这样做:
currentPage = metadataResponse.ApplicationType.Pages.Find(
page => page.SortOrder == ++currentPage.SortOrder);
Run Code Online (Sandbox Code Playgroud)
值为currentPagenull.
但是同样的逻辑,当我将增量值赋给一个整数变量,然后尝试得到 currentPage
int sortOrder = ++currentPage.SortOrder;
currentPage = metadataResponse.ApplicationType.Pages.Find(
page => page.SortOrder == sortOrder);
Run Code Online (Sandbox Code Playgroud)
currentPage 得到人口.
对于为什么一个有效而另一个无效,有没有人有一个很好的答案?