I'm trying to make a pendulum counter to my system, but it's giving error, at the time of calculating, could anyone help me?
You are giving error in .Count as you can see in the picture below.
MyController
publicasyncTask<ActionResult>Index(){if(!Cookies.Exists("hid"))
return RedirectToAction("Index", "Login", new { area = "Entrar" });
var hospitalId = int.Parse(Cookies.GetCookie("hid"));
var listaDia1 = await Dia1Service.GetPendenciasByUser(hospitalId);
var listaDia2 = await Dia2Service.GetPendenciasByUser(hospitalId);
var listaDia3 = await Dia3Service.GetPendenciasByUser(hospitalId);
var listaDia7 = await Dia7Service.GetPendenciasByUser(hospitalId);
var lista90Dias = await Dados90DiasService.GetPendenciasByUser(hospitalId);
var listaAlta = await AltaUTIService.GetPendenciasByUser(hospitalId);
var listaDemografia = await DemografiaContatosService.GetPendenciasByUser(hospitalId);
var listaDadosBasais = await DadosBasaisService.GetPendenciasByUser(hospitalId);
ViewBag.listaD1 = listaDia1;
ViewBag.listaD2 = listaDia2;
ViewBag.listaD3 = listaDia3;
ViewBag.listaD7 = listaDia7;
ViewBag.lista90d = lista90Dias;
ViewBag.listaAlta = listaAlta;
ViewBag.listaDeC = listaDemografia;
ViewBag.listaDb = listaDadosBasais;
return View();
}
My Contactor in PendenciaFilter.cs
void IActionFilter.OnActionExecuted(ActionExecutedContext filterContext)
{
AtualizarNotificacoes(filterContext);
}
private void AtualizarNotificacoes(ActionExecutedContext filterContext)
{
if (string.IsNullOrEmpty(Cookies.GetCookie("uid"))) return;
var hospitalId = int.Parse(Cookies.GetCookie("hid"));
// Pegar todas as notificações deste usuario
var altaUtiPendencias = new AltaUtiService().GetPendenciasByUser(hospitalId).Count();
var dia1Pendencias = new Dia1Service().GetPendenciasByUser(hospitalId).ToString();
filterContext.Controller.ViewBag.QtdPendencias = altaUtiPendencias + dia1Pendencias;
}