Possible Duplicate:
Most efficient way to test equality of lambda expressions
I was wondering how LINQ expression instances compare for equality. It seems that the expression classes do not implement IEquatable
or IComparable
or anything alike.
Let me give you some background information: I've implemented a caching mechanism that stores compiled labmda expressions. Currently I'm using the output of Expression.ToString()
as the cache key but I would like to find a better and more efficient way of distinguishing expressions.