I've just realised that this code:
public async Task<List<Review>> GetTitleReviews(int titleID)
{
using (var context = new exampleEntities())
{
return await context.Reviews.Where(x => x.Title_Id == titleID).ToList();
}
}
...will not work as async methods cannot await LINQ expressions. I've did some searches but only managed to find some overcomplicated solutions.
How should functions which return LINQ expressions be converted to async versions?
using System.Data.Entityand useToListAsync()