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