public async Task <IActionResult> Edit(long id, [Bind("LaboratoryTestCategoryId,LabTestCategoryName,Description")] LaboratoryTestCategory laboratoryTestCategory) { if (id != laboratoryTestCategory.LaboratoryTestCategoryId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(laboratoryTestCategory); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!LaboratoryTestCategoryExists(laboratoryTestCategory.LaboratoryTestCategoryId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(laboratoryTestCategory)); }
public async Task <IActionResult> Create([Bind("LaboratoryTestCategoryId,LabTestCategoryName,Description")] LaboratoryTestCategory laboratoryTestCategory) { if (ModelState.IsValid) { _context.Add(laboratoryTestCategory); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(laboratoryTestCategory)); }