There is nothing built-in, but if you have a well-defined precedent, I can certainly see (I am the author).
Currently, I would suggest using some option:
var found = Serializer.DeserializeItems<A>(source, PrefixStyle.Base128,
Serializer.ListItemTag).FirstOrDefault(obj => obj.Foo = "bar");
if(found != null) {...}
which will close when a match is found and will immediately release objects for collection (hopefully in gen-0). Or for several elements, perhaps:
var list = Serializer.DeserializeItems<A>(source, PrefixStyle.Base128,
Serializer.ListItemTag).Where(obj => obj.Foo = "bar").ToList();
(which quickly releases inappropriate elements)
To do this in the general case (especially for more complex queries), I can't think of a reasonable way to do this without materializing the object, so this is probably as close as you can get if there is no very specific (and simple) scenario , which goes well with the underlying data store (for example, the filter is always on "tag 1").
source
share