added option to mark gas record as not filled to full so that MPG calculations are deferred

This commit is contained in:
DESKTOP-GENO133\IvanPlex
2024-01-05 22:53:27 -07:00
parent 208eb22b8c
commit 1c2368f5a1
6 changed files with 65 additions and 25 deletions

View File

@@ -8,7 +8,7 @@
<div class="d-flex justify-content-between">
<div class="d-flex align-items-center flex-wrap">
<span class="ms-2 badge bg-success">@($"# of Gas Records: {Model.Count()}")</span>
@if (Model.Count() > 1)
@if (Model.Where(x=>x.MilesPerGallon > 0).Any())
{
<span class="ms-2 badge bg-primary">@($"Average Fuel Economy: {Model.Where(y => y.MilesPerGallon > 0)?.Average(x => x.MilesPerGallon).ToString("F") ?? "0"}")</span>
<span class="ms-2 badge bg-primary">@($"Min Fuel Economy: {Model.Where(y => y.MilesPerGallon > 0)?.Min(x => x.MilesPerGallon).ToString("F") ?? "0"}")</span>