public IEnumerable<IPersistentRepresentation> Read(string pid, long fromSeqNr, long toSeqNr, long max)
{
LinkedList<IPersistentRepresentation> persistents;
if (Messages.TryGetValue(pid, out persistents))
{
return persistents
.Where(x => x.SequenceNr >= fromSeqNr && x.SequenceNr <= toSeqNr)
.Take(max > int.MaxValue ? int.MaxValue : (int)max);
}
return Enumerable.Empty<IPersistentRepresentation>();
}