ExpressionEqualityComparer NullReferenceException
Some low-hanging fruit here, nameless parameters throw a NullReferenceException on ParameterExpression.Name.GetHashCode(); inside ExpressionEqualityComparer line 101 when dynamically building expression trees (ie. using 'Expression.Parameter(typeof(something))' without a parameter name).
@EricABC is this manifesting in some way when you are using EF? Or just a theoretical thing that could be hit based on looking at the code?
Yup, it did in fact occur for me. I have a sparse-matrix model with dynamic stored schema where I build a set of property filters on a query dynamically. On one of my properties didn't have a name and that was the culprit. As soon as I named it the problem was solved for me and everything worked like a charm. Admittedly I have a few customizations in place, including an implementation for https://github.com/aspnet/EntityFramework/issues/242 that inherits off of a few internal namespaced items (just serializes stuff in shadow properties), but none of it would have effected the call path to caching the query, which is what ultimately gets the hashcode. If you prefer I can get you an unadulterated repro.
Repro at https://github.com/EricABC/EFBugReproIssue4549
fixed in da1a1a839f869564482d37b519c52e3b2b95b1c6