So would something like the following:
public async Task<IEnumerable<Foo>> Get()
{
return await _asyncSession.Query<Foo>().ToListAsync();
}
Work any better than
public async Task<IEnumerable<Foo>> Get()
{
return _session.Query<Foo>().ToList();
}
What if I want to expose the IQueryable to enable odata filters like
WebApi allows? This works, but is synchronous:
public IQueryable<Foo> Get()
{
return _session.Query<Foo>();
}
Would something like the following have the same effect and be
asynchronous?
public async Task<IQueryable<Foo>> Get()
{
return await
_asyncSession.Query<Foo>().ToListAsync().AsQueryable();
}
I don't think that last one will work. How do I stay async and still
expose IQueryable?
-Matt
On Oct 22, 9:17 am, "Oren Eini (Ayende Rahien)" <
aye...@ayende.com>
wrote: