Will Entity Framework 6 function normally in Task.Run () operations?

My question is simple if I read or write to Task.Run to make my method asynchronous, will it work like a regular bit of code, or is there something in EF that prohibits this practice?

For instance:

await Task.Run(() =>
{
    var data = _context.KittenLog.ToList();
}

I had a difficult feeling that this would open a can of worms, but I can not find anything on Google about combining the two.

+4
source share
1 answer

, . Task.Run, async, . https://msdn.microsoft.com/en-us/library/jj819165(v=vs.113).aspx#Making

- :

var data = await _context.KittenLog.ToListAsync(CancellationToken.None);

, . , async .

+5

Source: https://habr.com/ru/post/1670093/


All Articles