0

I have a repository that has a method that calls the method ToListAsync of EF, however if I use the ToList, I get and warning that says that the async methods will run sync, but the application works fine.

So my doubt is how to use the async methods of EF with Sqlite.

The methods is this:

public async Task<List<MyType>> getRowsAsync(Params param)
{
    return await miDBContext.MyType
        .Include(x => x.MyType2.MyType3)
        .ToListAsync();
}
svick
  • 236,525
  • 50
  • 385
  • 514
Álvaro García
  • 18,114
  • 30
  • 102
  • 193
  • [Nice answer have a look](http://stackoverflow.com/a/25087273/2630817) – Just code Jan 07 '16 at 12:39
  • Ok, so you have some working code and you also have some other working code, that gives a warning which explains what the issue with that code is. What is your question? – svick Mar 07 '16 at 19:54
  • Sqlite isn't thread-safe, so you shouldn't even want it to handle async requests. There is a [library](https://github.com/oysteinkrog/SQLite.Net-PCL) that sort-of makes Sqlite async, but I don't know if it works well. – Gert Arnold Mar 07 '16 at 21:50

0 Answers0