public async Task <IActionResult> Edit(string id, [Bind("HometypeCode,HometypeDescription")] Hometype hometype) { if (id != hometype.HometypeCode) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(hometype); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!HometypeExists(hometype.HometypeCode)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(hometype)); }
public async Task <IActionResult> Create([Bind("HometypeCode,HometypeDescription")] Hometype hometype) { if (ModelState.IsValid) { _context.Add(hometype); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(hometype)); }