在CosmosDB中查询时,StringComparison不起作用

时间:2018-04-09 09:56:05

标签: linq azure-cosmosdb

使用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);
        }

0 个答案:

没有答案