.ToListAsync is used to get a collection of items from DB in EF Core. That's clear. But what is the right way to get single item? In async way if possible.
public async static Task<Source> LoadEntityAsync(int sourceID)
{
using (var db = new RPDBContext())
{
var sources =
await
db.Source
.Where(x => x.SourceID == sourceID)
.ToListAsync();
// TODO that's like a hack:
return sources.First();
}
}