public ActionResult Details(DetailsPhotoViewModel photo) { Photo photoFromDB = photoRepository.GetPhotoFromDbById(photo.Id); photo = PhotoMapper.MapDetailsPhotoViewModel(photoFromDB); return(PartialView("_PhotoDetail", photo)); }
public ActionResult Details(DetailsPhotoViewModel photo, FormCollection collection) { var comment = new Comment { Date = DateTime.Now, Content = collection["comment"], UserID = UserHelper.GetLogedInUser(userRepository).Id, PhotoID = photo.Id }; commentRepository.AddComment(comment); Photo photoFromDB = photoRepository.GetPhotoFromDbById(photo.Id); photo = PhotoMapper.MapDetailsPhotoViewModel(photoFromDB); return(View(photo)); }