public IActionResult Create(Person person, string returnUrl, IFormFile file = null) { if (ModelState.IsValid) { if (file == null) { person.ImgLink = "http://all4desktop.com/data_images/original/4242435-face.jpg"; } _context.People.Add(person); _context.SaveChanges(); if (file != null) { person = this.savePhoto(person, file); _context.Update(person); _context.SaveChanges(); } if (Url.IsLocalUrl(returnUrl)) { return(Redirect(returnUrl)); } else { return(RedirectToAction("Index")); } } return(View(person)); }
public IActionResult Edit(Location location) { if (ModelState.IsValid) { _context.Update(location); _context.SaveChanges(); return(RedirectToAction("Index")); } return(View(location)); }
public IActionResult Edit(Experience experience) { if (ModelState.IsValid) { _context.Update(experience); _context.SaveChanges(); return(RedirectToAction("Index")); } return(checkLogin(View(experience))); }