public async Task <IActionResult> Edit(Guid id, [Bind("Nationalid,Id,Fullname,Telno,Mobileno")] Person person) { if (id != person.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(person); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PersonExists(person.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(person)); }
public async Task <IActionResult> Create([Bind("Id,Cityname")] City city) { if (ModelState.IsValid) { city.Id = Guid.NewGuid(); _context.Add(city); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(city)); }