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.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. namespace Teknik.Areas.Blog.ViewModels
  8. {
  9. public class PostViewModel
  10. {
  11. public int PostId { get; set; }
  12. public int BlogId { get; set; }
  13. public Models.Blog Blog { get; set; }
  14. public DateTime DatePosted { get; set; }
  15. public DateTime DatePublished { get; set; }
  16. public bool Published { get; set; }
  17. public string Title { get; set; }
  18. public string Article { get; set; }
  19. public List<string> Tags { get; set; }
  20. public List<Comment> Comments { get; set; }
  21. public PostViewModel(Post post)
  22. {
  23. BlogId = post.BlogId;
  24. PostId = post.PostId;
  25. Blog = post.Blog;
  26. DatePosted = post.DatePosted;
  27. Published = post.Published;
  28. DatePublished = post.DatePublished;
  29. Title = post.Title;
  30. Tags = post.Tags;
  31. Article = post.Article;
  32. Comments = post.Comments;
  33. }
  34. }
  35. }