I want to avoid blocking the executing thread by slow database read , and I like BLToolkit DataAccessor very much
public abstract class PersonAccessor : DataAccessor
{
[SqlText(@"SELECT * FROM Person WHERE FirstName = @firstName")]
public abstract List<Person> GetPersonListByFirstName(string @firstName);
[SprocName("sp_GetPersonListByLastName")]
public abstract List<Person> GetPersonListByLastName(string @lastName);
}
Is it possible to use async operation for BLToolkit DataAccessor?
Hope it is able to return Task<T>
and I can use await
from C# 5.0
Br.
You may combine the Async attribute which provides the Begin End pattern and turn it into Task like this (not tested) :