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