Use different way of showing MMC FEATURES.

This commit is contained in:
2019-11-13 00:29:48 +00:00
parent 30a8776016
commit 69cc41c3c7
4 changed files with 49 additions and 5 deletions

View File

@@ -16,7 +16,18 @@ namespace DiscImageChef.Server.Areas.Admin.Controllers
public MmcController(DicServerContext context) => _context = context;
// GET: Admin/Mmc
public async Task<IActionResult> Index() => View(await _context.Mmc.ToListAsync());
public IActionResult Index() => View(_context.Mmc.Where(m => m.ModeSense2AData != null).
Select(m => new MmcModelForView
{
Id = m.Id, FeaturesId = m.FeaturesId,
DataLength = m.ModeSense2AData.Length
}).ToList().
Concat(_context.Mmc.Where(m => m.ModeSense2AData == null).
Select(m => new MmcModelForView
{
Id = m.Id, FeaturesId = m.FeaturesId,
DataLength = 0
}).ToList()).OrderBy(m => m.Id));
// GET: Admin/Mmc/Details/5
public async Task<IActionResult> Details(int? id)