Пример #1
0
 public TagViewModel(TagHandler _tag, string tagSlug, PostHandler _post, int page, int pageLimit)
     : base(_post, page, pageLimit)
 {
     Tag = _tag.Tag(tagSlug);
     Posts = _post.PostsForTag(tagSlug, page - 1, pageLimit);
     TotalPosts = _post.TotalPostsForTag(tagSlug);
     TotalPostsForPage = Posts.Count;
 }
Пример #2
0
        static void Main(string[] args)
        {
            logger.Debug("Application start");

            CategoryHandler catHandler = new CategoryHandler();

            IList<Category> categories = catHandler.Categories();
            foreach (var category in categories)
                Console.WriteLine(category.Id + ". " + category.Name);

            CommentHandler comHandler = new CommentHandler();

            IList<Comment> comments = comHandler.UserComments(1);
            foreach (var comment in comments)
                Console.WriteLine(comment.Id + ". " + comment.Text);

            PostHandler postHandler = new PostHandler();

            IList<Post> posts = postHandler.Posts();
            foreach (var post in posts)
                Console.WriteLine(post.Id + ". " + post.Comments.Count + "  " + post.PostedOn.ToShortDateString());

            TagHandler tagHandler = new TagHandler();

            IList<Tag> tags = tagHandler.Tags();
            foreach (var tag in tags)
                Console.WriteLine(tag.Name);

            UserHandler userHandler = new UserHandler();

            IList<User> users = userHandler.AuthorUsers();
            foreach (var user in users)
                Console.WriteLine(user.Id + ". " + user.Login + " " + user.Password);

            logger.Debug("Application loaded succesfully");

            Console.ReadLine();
        }
Пример #3
0
 public TagViewModel(TagHandler _tag)
 {
     Tags = _tag.Tags();
 }
Пример #4
0
 public TagsController()
 {
     _tag = new TagHandler();
     _post = new PostHandler();
 }