public void EditPhoto(Photo photo) { var original = this.FindPhoto(photo.Id); original.Title = photo.Title; original.Description = photo.Description; original.Rating = photo.Rating; original.PhotoUrl = photo.PhotoUrl; _repo.SaveChanges(); }
public ActionResult CreatePhoto(Photo photo, int id) { if (ModelState.IsValid) { photo.AlbumId = id; _photoService.CreatePhoto(photo); return RedirectToAction("Index"); } return View(); }
public void CreatePhoto(Photo photo) { _repo.Add<Photo>(photo); _repo.SaveChanges(); }
public ActionResult EditPhoto(Photo photo) { if (ModelState.IsValid) { _photoService.EditPhoto(photo); return RedirectToAction("Index"); } return View(); }