The next generation of the Teknik Services. Written in ASP.NET. https://www.teknik.io/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

PostViewModel.cs 1.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. using System;
  2. using System.Collections.Generic;
  3. using Teknik.Areas.Blog.Models;
  4. using System.Security.Principal;
  5. using System.Linq;
  6. using System.Web;
  7. using Teknik.ViewModels;
  8. namespace Teknik.Areas.Blog.ViewModels
  9. {
  10. public class PostViewModel : ViewModelBase
  11. {
  12. public int PostId { get; set; }
  13. public int BlogId { get; set; }
  14. public Models.Blog Blog { get; set; }
  15. public bool System { get; set; }
  16. public DateTime DatePosted { get; set; }
  17. public DateTime DatePublished { get; set; }
  18. public DateTime DateEdited { get; set; }
  19. public bool Published { get; set; }
  20. public string Title { get; set; }
  21. public string Article { get; set; }
  22. public List<string> Tags { get; set; }
  23. public List<BlogPostComment> Comments { get; set; }
  24. public PostViewModel()
  25. {
  26. }
  27. public PostViewModel(BlogPost post)
  28. {
  29. BlogId = post.BlogId;
  30. PostId = post.BlogPostId;
  31. Blog = post.Blog;
  32. System = post.System;
  33. DatePosted = post.DatePosted;
  34. Published = post.Published;
  35. DatePublished = post.DatePublished;
  36. DateEdited = post.DateEdited;
  37. Title = post.Title;
  38. Tags = post.Tags;
  39. Article = post.Article;
  40. Comments = post.Comments.ToList();
  41. }
  42. }
  43. }