Skip to main content
1 de 2

Store procedure assíncrona

Executar procedure assincronamente

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;
    }

Erro

Cannot await 'System.Collections.Generic.List<MAPA.Models.SP_MESES_BUSCA_Result>'