我有如下代码:
QueryExpression query = new QueryExpression();
query.EntityName = "new_callistyorder";
ColumnSet col = new ColumnSet("new_nomororder","new_customer");
query.ColumnSet = col;
EntityCollection colect = service.RetrieveMultiple(query);
string str = string.Empty;
foreach (Entity e in colect.Entities)
{
if(e.Contains("new_nomororder")){
str = str + e.Attributes["new_nomororder"].ToString();
}
}
throw new InvalidPluginExecutionException(str);
通过这段代码。我能够从微软动态实体获取数据。现在,我想获取具有最大 id 的数据。如果在 SQL 查询中,它看起来像这样:“Select top 1 my_id from Account order by my_id desc”。我如何在 queryexpression 上做到这一点?谢谢