public ArticleViewModel(Article article)
 {
     ID               = article.ID;
     Title            = article.Title;
     Image            = new FileViewModel(article.Image);
     ShortText        = article.ShortText;
     Text             = Encoding.UTF8.GetString(article.Text);
     Author           = new SpecialistViewModel(article.Author);
     Date             = article.Date;
     ModerationStatus = article.ModerationStatus;
     Likes            = new List <ArticleLikeViewModel>();
     Comments         = new List <ArticleCommentViewModel>();
     IsLiked          = false;
 }
 public ArticleViewModel(Article article, IEnumerable <ArticleLike> likes, IEnumerable <ArticleCommentViewModel> comments, bool isLiked)
 {
     if (article != null)
     {
         ID               = article.ID;
         Title            = article.Title;
         Image            = new FileViewModel(article.Image);
         ShortText        = article.ShortText;
         Text             = Encoding.UTF8.GetString(article.Text);
         Author           = new SpecialistViewModel(article.Author);
         Date             = article.Date;
         ModerationStatus = article.ModerationStatus;
         Likes            = likes.Select(x => new ArticleLikeViewModel(x)).ToList();
         Comments         = comments.ToList();
         IsLiked          = isLiked;
     }
 }
 public SessionViewModel(Session session, SpecialistViewModel specialist, int reviewScore)
 {
     if (session != null)
     {
         ID                  = session.ID;
         Problem             = new ProblemViewModel(session.Problem);
         Specialist          = specialist;
         Status              = session.Status;
         Reward              = session.Reward;
         Date                = session.Date;
         IsSpecialistClose   = session.IsSpecialistClose;
         IsClientClose       = session.IsClientClose;
         SpecialistCloseDate = session.SpecialistCloseDate;
         ClientCloseDate     = session.ClientCloseDate;
         ReviewScore         = reviewScore;
     }
 }