示例#1
0
        public ViewResult Article(Guid id)
        {
            var post = categoriesRepository.Category(id);

            if (post == null)
            {
                throw new HttpException(404, "Post not found");
            }



            return(View(post));
        }
示例#2
0
 public PhotoViewModel(Guid Id, IPhoto photoRepository, ICategories categoryRepository)
 {
     Categories = categoryRepository.Category(Id);
     if (Categories != null)
     {
         var post = mapping.GetCategoryById(Categories.id);
         if (post.Album != null)
         {
             var album = photoRepository.PhotosForAlbum(post.Album.id);
             if (album != null)
             {
                 Photos = photoRepository.PhotosForAlbum(post.Album.id);
             }
         }
     }
 }