Exemple #1
0
 public async static Task <DetailedNoticeViewModel> ToDetailedNoticeViewModelAsync(Notice notice)
 {
     using (var rm = new RelationshipManager())
     {
         DetailedNoticeViewModel vm = new DetailedNoticeViewModel
         {
             Id              = notice.NoticeId,
             Title           = notice.Title,
             NoticeBoardId   = notice.NoticeBoardId,
             Description     = notice.Description,
             DateCreated     = notice.DateCreated,
             isHighPriority  = notice.HighPriority,
             NoticeBoardName = notice.NoticeBoard.Title,
             IsOfficial      = notice.NoticeBoard.IsOfficial,
             PostedBy        = (await rm.GetUserAsync(notice)).User.Name.ToString()
         };
         return(vm);
     }
 }