public async Task <IActionResult> Edit(int id, [Bind("TombLocationId,AreaHillBurial,Tomb")] TombLocation tombLocation) { if (id != tombLocation.TombLocationId) { return(NotFound()); } if (ModelState.IsValid) { try { tombLocation.LookupValue = $"{tombLocation.AreaHillBurial} {tombLocation.Tomb}"; _context.Update(tombLocation); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TombLocationExists(tombLocation.TombLocationId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(tombLocation)); }
public async Task <IActionResult> Create([Bind("TombLocationId,AreaHillBurial,Tomb")] TombLocation tombLocation) { if (ModelState.IsValid) { tombLocation.LookupValue = $"{tombLocation.AreaHillBurial} {tombLocation.Tomb}"; _context.Add(tombLocation); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(tombLocation)); }