public List <string> BuildComments(List <CommentPostViewModel> comments)
 {
     return(comments
            .OrderByDescending(x => x.ID)
            .Take(20)
            .Select(x => $"<strong>{BaseService.GetEntity<UserPostViewModel>(x.CreatedByID).Name}</strong>: {x.Details} <br/> <strong><span class=\"text-muted\" style=\"font-size: x-small;\">{x.CreatedDate.ToString("dd'/'MM'/'yyyy HH:mm:ss")}</span></strong>")
            .ToList());
 }
示例#2
0
 public List <string> BuildMessagesForChat(List <MessageDisplayViewModel> messages)
 {
     return(messages
            .OrderByDescending(x => x.ID)
            .Take(10)
            .Select(x => $"{BaseService.GetEntity<UserPostViewModel>(x.CreatedByID).Name}: {x.Details}")
            .ToList());
 }