mirror of
https://github.com/claunia/marechai.git
synced 2025-12-16 19:14:25 +00:00
Migrate to .NET Core 3.1.
This commit is contained in:
@@ -39,9 +39,9 @@ namespace Marechai.Controllers
|
||||
public class ConsoleController : Controller
|
||||
{
|
||||
readonly MarechaiContext _context;
|
||||
readonly IHostingEnvironment hostingEnvironment;
|
||||
readonly IWebHostEnvironment hostingEnvironment;
|
||||
|
||||
public ConsoleController(IHostingEnvironment env, MarechaiContext context)
|
||||
public ConsoleController(IWebHostEnvironment env, MarechaiContext context)
|
||||
{
|
||||
hostingEnvironment = env;
|
||||
_context = context;
|
||||
@@ -52,13 +52,11 @@ namespace Marechai.Controllers
|
||||
ViewBag.ItemCount = _context.Machines.Count(m => m.Type == MachineType.Console);
|
||||
|
||||
ViewBag.MinYear = _context.
|
||||
Machines.Where(t => t.Type == MachineType.Console &&
|
||||
t.Introduced.HasValue &&
|
||||
Machines.Where(t => t.Type == MachineType.Console && t.Introduced.HasValue &&
|
||||
t.Introduced.Value.Year > 1000).Min(t => t.Introduced.Value.Year);
|
||||
|
||||
ViewBag.MaxYear = _context.
|
||||
Machines.Where(t => t.Type == MachineType.Console &&
|
||||
t.Introduced.HasValue &&
|
||||
Machines.Where(t => t.Type == MachineType.Console && t.Introduced.HasValue &&
|
||||
t.Introduced.Value.Year > 1000).Max(t => t.Introduced.Value.Year);
|
||||
|
||||
return View();
|
||||
@@ -95,8 +93,7 @@ namespace Marechai.Controllers
|
||||
{
|
||||
ViewBag.Year = id;
|
||||
|
||||
return View(_context.Machines.Where(t => t.Type == MachineType.Console &&
|
||||
t.Introduced.HasValue &&
|
||||
return View(_context.Machines.Where(t => t.Type == MachineType.Console && t.Introduced.HasValue &&
|
||||
t.Introduced.Value.Year == id).ToArray());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user