From cc7fe43821c44ebbb64658f609151a7678dd5830 Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Sun, 17 Nov 2019 20:23:32 +0000 Subject: [PATCH] Sort SSCs. --- .../Areas/Admin/Controllers/SscsController.cs | 4 +++- DiscImageChef.Server/Areas/Admin/Views/Sscs/Index.cshtml | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/DiscImageChef.Server/Areas/Admin/Controllers/SscsController.cs b/DiscImageChef.Server/Areas/Admin/Controllers/SscsController.cs index 38685d94..90c27b26 100644 --- a/DiscImageChef.Server/Areas/Admin/Controllers/SscsController.cs +++ b/DiscImageChef.Server/Areas/Admin/Controllers/SscsController.cs @@ -16,7 +16,9 @@ namespace DiscImageChef.Server.Areas.Admin.Controllers public SscsController(DicServerContext context) => _context = context; // GET: Admin/Sscs - public async Task Index() => View(await _context.Ssc.ToListAsync()); + public async Task Index() => + View(await _context.Ssc.OrderBy(s => s.MinBlockLength).ThenBy(s => s.MaxBlockLength). + ThenBy(s => s.BlockSizeGranularity).ToListAsync()); // GET: Admin/Sscs/Details/5 public async Task Details(int? id) diff --git a/DiscImageChef.Server/Areas/Admin/Views/Sscs/Index.cshtml b/DiscImageChef.Server/Areas/Admin/Views/Sscs/Index.cshtml index 207fb6a3..476cae70 100644 --- a/DiscImageChef.Server/Areas/Admin/Views/Sscs/Index.cshtml +++ b/DiscImageChef.Server/Areas/Admin/Views/Sscs/Index.cshtml @@ -37,13 +37,13 @@ - @Html.DisplayNameFor(model => model.BlockSizeGranularity) + @Html.DisplayNameFor(model => model.MinBlockLength) @Html.DisplayNameFor(model => model.MaxBlockLength) - @Html.DisplayNameFor(model => model.MinBlockLength) + @Html.DisplayNameFor(model => model.BlockSizeGranularity) @@ -53,13 +53,13 @@ { - @Html.DisplayFor(modelItem => item.BlockSizeGranularity) + @Html.DisplayFor(modelItem => item.MinBlockLength) @Html.DisplayFor(modelItem => item.MaxBlockLength) - @Html.DisplayFor(modelItem => item.MinBlockLength) + @Html.DisplayFor(modelItem => item.BlockSizeGranularity) Details