I would like to enable XPath navigation over my POCOs (ie "plain old CLR objects"). From a brief search, I have found several options:
The second option appears to be what I want. However, I don't have the time to write my own -- especially since I expect that someone else has already implemented it and made it open source. I just have a difficult time finding this elusive PocoXPathNavigator implementation!
Thanks.
The best approach, it seems, is to use ObjectXPathNavigator (option 1) since it's open source. I plan to extend it to support generics and whatever else I need.
You can serialize your objects as xml string into memory and then use the standard XPathNavigator to search in it. There are also some native XML database systems which you may use to serialize your objects into.
The question is, why do you need an XPathNavigator to search in objects? If you have a large objects graph you may consider using some kind of graph db / nosql db .
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.