public async Task <IEnumerable <MessageViewModel> > GetGroupMessages(string g) { CoreEngine core = new CoreEngine(); var result = await core.GetGroupMessagesAsync(_repo, g); IEnumerable <MessageViewModel> messages = from res in result select new MessageViewModel { SenderName = res.SenderName, GroupName = res.GroupName, Content = res.Content, MessageDT = res.MessageDT }; return(messages); }