Optimize view of resolutions by gpu admin page.

This commit is contained in:
2019-05-20 00:24:26 +01:00
parent 3b057339a5
commit 91e9b04b45
4 changed files with 58 additions and 7 deletions

View File

@@ -1,6 +1,7 @@
using System.Linq;
using System.Threading.Tasks;
using Cicm.Database.Models;
using cicm_web.Areas.Admin.Models;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Rendering;
@@ -28,7 +29,13 @@ namespace cicm_web.Areas.Admin.Controllers
return View(await cicmContext.OrderBy(r => r.Gpu.Company.Name).ThenBy(r => r.Gpu.Name)
.ThenBy(r => r.Resolution.Chars).ThenBy(r => r.Resolution.Width)
.ThenBy(r => r.Resolution.Height).ThenBy(r => r.Resolution.Colors)
.ToListAsync());
.Select(r => new ResolutionsByGpuViewModel
{
Gpu = r.Gpu.Name,
GpuCompany = r.Gpu.Company.Name,
Id = r.Id,
Resolution = r.Resolution
}).ToListAsync());
}
// GET: ResolutionsByGpu/Details/5