diff --git a/cicm_web/Areas/Admin/Controllers/InstructionSetsController.cs b/cicm_web/Areas/Admin/Controllers/InstructionSetsController.cs index 09a45413..d061d4d2 100644 --- a/cicm_web/Areas/Admin/Controllers/InstructionSetsController.cs +++ b/cicm_web/Areas/Admin/Controllers/InstructionSetsController.cs @@ -49,7 +49,8 @@ namespace cicm_web.Areas.Admin.Controllers } // GET: Admin/InstructionSets - public async Task Index() => View(await _context.InstructionSets.ToListAsync()); + public async Task Index() => + View(await _context.InstructionSets.OrderBy(s => s.Name).ToListAsync()); // GET: Admin/InstructionSets/Details/5 public async Task Details(int? id) @@ -72,14 +73,11 @@ namespace cicm_web.Areas.Admin.Controllers [ValidateAntiForgeryToken] public async Task Create([Bind("Id,Name")] InstructionSet instructionSet) { - if(ModelState.IsValid) - { - _context.Add(instructionSet); - await _context.SaveChangesAsync(); - return RedirectToAction(nameof(Index)); - } + if(!ModelState.IsValid) return View(instructionSet); - return View(instructionSet); + _context.Add(instructionSet); + await _context.SaveChangesAsync(); + return RedirectToAction(nameof(Index)); } // GET: Admin/InstructionSets/Edit/5 diff --git a/cicm_web/cicm_web.csproj b/cicm_web/cicm_web.csproj index fa5ccfd5..06f1fa26 100644 --- a/cicm_web/cicm_web.csproj +++ b/cicm_web/cicm_web.csproj @@ -2,7 +2,7 @@ netcoreapp2.2 - 3.0.99.432 + 3.0.99.433 Canary Islands Computer Museum Copyright © 2003-2018 Natalia Portillo Canary Islands Computer Museum Website