示例#1
0
        public ActionResult Details(DetailsPhotoViewModel photo)
        {
            Photo photoFromDB = photoRepository.GetPhotoFromDbById(photo.Id);

            photo = PhotoMapper.MapDetailsPhotoViewModel(photoFromDB);

            return(PartialView("_PhotoDetail", photo));
        }
示例#2
0
        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));
        }