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