使用stringcomparison
查询cosmosdb时出现以下错误{
"errorCode": "DocumentQueryException",
"errorMessage": "Query expression is invalid, expression return type System.Int32 is unsupported. Query must evaluate to IEnumerable."
}
我的代码如下所示:
await repo.WhereAsync(something => something.Name.Equals("something", StringComparison.OrdinalIgnoreCase));
和whileync实现如下所示:
public async Task<IQueryable<T>> WhereAsync(Expression<Func<T, bool>> predicate, FeedOptions feedOptions = null)
{
return _client.CreateDocumentQuery<T>((await _collection).DocumentsLink, feedOptions)
.Where(predicate);
}