I am working on building some pseudo-intelligent caching into a LINQ query provider. What I’d like to do (ideally) is use the expression tree of a given query as the cache key in some scenarios. However, I don’t want to store the entire object graph itself, so what’s a quick way to get a hashsum-like value from an expression tree? Or if I’m going in the wrong direction, is there a better option?
I am working on building some pseudo-intelligent caching into a LINQ query provider .
Share
Um, actually I think this might be quite simple.
The ToString() method of an Expression object will give you a textual representation of the Expression, you could hash that if all you want is to evaluate equivalency of a key.