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); }
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); } }
public static Notice From(DetailedNoticeViewModel vm) { throw new NotImplementedException(); }