Move companies by country to Blazor.

This commit is contained in:
2020-05-21 23:32:21 +01:00
parent 8887ddd185
commit 337dd0b131
8 changed files with 73 additions and 109 deletions

View File

@@ -75,23 +75,6 @@ namespace Marechai.Controllers
}).ToList());
}
public IActionResult ByCountry(short id)
{
ViewBag.Iso3166 = _context.Iso31661Numeric.FirstOrDefault(i => i.Id == id);
if(ViewBag.Iso3166 is null)
RedirectToAction(nameof(Index));
ViewBag.WebRootPath = hostingEnvironment.WebRootPath;
return View(_context.Companies.Include(c => c.Logos).Where(c => c.CountryId == id).OrderBy(c => c.Name).
Select(c => new CompanyViewModel
{
Id = c.Id, LastLogo = c.Logos.OrderByDescending(l => l.Year).FirstOrDefault().Guid,
Name = c.Name
}).ToList());
}
public IActionResult Index()
{
ViewBag.WebRootPath = hostingEnvironment.WebRootPath;