public IActionResult Index() { ViewData["ConsumoMensal"] = medidor.ConsumoMensal(); var ultimaLeitura = db.LeiturasDoRelogio.OrderBy(x => x.Registro.Value.Date).Last(); return(View(ultimaLeitura)); }
public async Task <IActionResult> Index() { ViewData["ConsumoMensal"] = medidor.ConsumoMensal(); var leituras = await db.LeiturasDoRelogio .Where(x => x.Registro.Value.Month == DateTime.Now.Month).OrderBy(x => x.Registro).ToListAsync(); return(View(leituras)); }