예제 #1
0
 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();
 }
예제 #2
0
 public ActionResult CreatePhoto(Photo photo, int id)
 {
     if (ModelState.IsValid)
     {
         photo.AlbumId = id;
         _photoService.CreatePhoto(photo);
         return RedirectToAction("Index");
     }
     return View();
 }
예제 #3
0
 public void CreatePhoto(Photo photo)
 {
     _repo.Add<Photo>(photo);
     _repo.SaveChanges();
 }
예제 #4
0
 public ActionResult EditPhoto(Photo photo)
 {
     if (ModelState.IsValid)
     {
         _photoService.EditPhoto(photo);
         return RedirectToAction("Index");
     }
     return View();
 }