public async Task <IViewComponentResult> InvokeAsync() { EstatisticasViewModel estatisticas = new EstatisticasViewModel(); estatisticas.MenorDespesa = _context.Despesas.Min(x => x.Valor); estatisticas.MaiorDespesa = _context.Despesas.Max(x => x.Valor); estatisticas.QuantidadeDespesas = _context.Despesas.Count(); return(View(estatisticas)); }
public IViewComponentResult Invoke() { EstatisticasViewModel estatisticas = new EstatisticasViewModel(); estatisticas.MenorDespesa = _contexto.TDespesa.Min(x => x.Valor); estatisticas.MaiorDespesa = _contexto.TDespesa.Max(x => x.Valor); estatisticas.QuantidadeDespesas = _contexto.TDespesa.Count(); return(View(estatisticas)); }