I'm trying to do a query in cosmos db. I want a async query. The query return me only one element. In the web I have seen how to do it when query return more than one element. This is my method:
public async Task<TenantDetails> ReadBrokerSettings(string tenantId)
{
FeedOptions queryOptions = new FeedOptions { MaxItemCount = -1 };
var tenantDTO = this._client.CreateDocumentQuery<TenantDTO>(
UriFactory.CreateDocumentCollectionUri(_idDatabase, _idCollection), queryOptions)
.Where(f => f.tenantId == tenantId)
.AsEnumerable()
.SingleOrDefault();
return tenantDTO != null ? _iTenantAssembler.DtoToEntity(tenantDTO) : null;
}
Compiler say me than it isn't async. Thanks