mirror of
https://github.com/claunia/marechai.git
synced 2025-12-16 19:14:25 +00:00
22 lines
601 B
C#
22 lines
601 B
C#
|
|
using System.Collections.Generic;
|
|||
|
|
using System.Linq;
|
|||
|
|
using Cicm.Database.Schemas;
|
|||
|
|
using Microsoft.AspNetCore.Mvc;
|
|||
|
|
|
|||
|
|
namespace cicm_web.Controllers
|
|||
|
|
{
|
|||
|
|
public class ComputerController : Controller
|
|||
|
|
{
|
|||
|
|
public IActionResult Index()
|
|||
|
|
{
|
|||
|
|
Program.Database.Operations.GetComputers(out List<Computer> computers);
|
|||
|
|
|
|||
|
|
ViewBag.ItemCount = computers.Count;
|
|||
|
|
|
|||
|
|
ViewBag.MinYear = computers.Where(t => t.Year > 1000).Min(t => t.Year);
|
|||
|
|
ViewBag.MaxYear = computers.Where(t => t.Year > 1000).Max(t => t.Year);
|
|||
|
|
|
|||
|
|
return View();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|