示例#1
0
        public static DetailedNoticeViewModel ToDetailedNoticeViewModel(Notice notice)
        {
            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,
            };

            return(vm);
        }
示例#2
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);
     }
 }
示例#3
0
 public static Notice From(DetailedNoticeViewModel vm)
 {
     throw new NotImplementedException();
 }