Migrate to .NET Core 3.1.

This commit is contained in:
2020-05-21 05:01:35 +01:00
parent e3ebd41291
commit 880f66df1a
12 changed files with 67 additions and 79 deletions

View File

@@ -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());
}
}