在DocumentDb中使用ThenBy显示错误

时间:2016-04-04 05:23:16

标签: linq azure azure-cosmosdb

DocumentDb是否支持multipe OrderBy和ThenBy? 我一直在使用这个查询,包括两个OrderBy和一个orderBy和一个ThenBy但每次都说不支持ThenBy。 有没有办法使用多个字段的订单?

var Rests=from f in _client.CreateDocumentQuery<Restraunt>(_collectionUri)  orderby  f.RestName,f.RestId select  f;

var Rests=from f in _client.CreateDocumentQuery<Restraunt>(_collectionUri)
        .OrderBy(f.RestName).ThenBy(f.RestId);

1 个答案:

答案 0 :(得分:4)

  

有多种方法可以使用多个字段的订单吗?

目前不是,不。它是一个documented limitation,虽然听起来像是在做它的工作:

  

您无法执行以下操作:

     
      
  • [...]按多个属性订购(即将推出)。
  •