public async Task<IActionResult> Edit(int id, [Bind("ConnectionTypeId,ConnectionTypeName")] LookUpConnectionType lookUpConnectionType) { if (id != lookUpConnectionType.ConnectionTypeId) { return NotFound(); } if (ModelState.IsValid) { try { _context.Update(lookUpConnectionType); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!LookUpConnectionTypeExists(lookUpConnectionType.ConnectionTypeId)) { return NotFound(); } else { throw; } } return RedirectToAction(nameof(Index)); } return View(lookUpConnectionType); }
public async Task<IActionResult> Create([Bind("ConnectionTypeId,ConnectionTypeName")] LookUpConnectionType lookUpConnectionType) { if (ModelState.IsValid) { _context.Add(lookUpConnectionType); await _context.SaveChangesAsync(); return RedirectToAction(nameof(Index)); } return View(lookUpConnectionType); }