public IActionResult Update(Gun gun) { GunOrganizator gunOrganizator = new GunOrganizator(gun); gunHistory.History.Push(gunOrganizator.SaveState()); return(RedirectToAction("Index")); }
public IActionResult Updat2(Gun gun) { GunOrganizator gunOrganizator = new GunOrganizator(gun); gunOrganizator.RestoreState(gunHistory.History.Pop()); gun = gunOrganizator.SaveState(); gunRepo.Update(gun); return(RedirectToAction("Index")); }