private IObservable <IList <MessageModel> > LoadInitMessages( Chat chat) { return(_chatLoader.LoadChat(chat.ChatData.Id) .SelectSeq(c => GetInitMessages(c) .Select(_messageModelFactory.CreateMessage) .ToList()) .Select(list => list.Reverse().ToList())); }
public IObservable <IList <MessageModel> > LoadNextMessages( Chat chat, Message fromMessage) { return(_chatLoader.LoadChat(chat.ChatData.Id) .SelectSeq(c => GetNextMessages(c, fromMessage) .Select(_messageModelFactory.CreateMessage) .ToList()) .Select(list => list.Reverse().Skip(1).ToList())); }