1
When trying to run Process asynchronously
public async Task<ActionResult> Index()
{
Stopwatch watch = new Stopwatch();
watch.Start();
ContentManagement service = new ContentManagement();
var contentTask = service.MesesAsync();
var content = await contentTask;
watch.Stop();
ViewBag.WatchMilliseconds = watch.ElapsedMilliseconds;
return View("Index");
}
public async Task<List<SP_MESES_BUSCA_Result>> MesesAsync()
{
var ListarMes = await db.SP_MESES_BUSCA().ToList();
return ListarMes;
}
Returns the error:
Cannot await 'System.Collections.Generic.List'
This error appears now "does not contain a Definition for 'Tolistasync' and the best Extension method Overload 'Queryableextensions.Tolistasync(Iqueryable)'" if you enter ". Asqueryable() the most error when executing appears Only sources that implement Idbasyncenumerable can be used for Entity Framework asynchronous Operations. For more Details see "
– Edgar Araujo
Add this reference to your project:
using System.Data.Entity;
– Randrade
I’m already using, if I do a table works, now with the past of these errors.
– Edgar Araujo
Behold this tutorial
– Randrade