Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public ActionResult Edit(int id, User source)
- {
- User existing = db.Users.Single(x => x.Id == id);
- if (existing != null)
- {
- existing.Username = source.Username;
- existing.EmailAddress = source.EmailAddress;
- existing.Password = source.Password;
- db.Entry(existing).State = System.Data.Entity.EntityState.Modified;
- db.SaveChanges();
- return View("Index");
- }
- else
- {
- // report user not found
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement