ravendb/ravendb — pull request #495 by sebastian-claesson (2012-11-30 10:46:32+00:00)
Title: LoadByUniqueConstraint now also accepts UnaryExpression as keySelector parameter

If you use the LoadByUniqueConstraint ExtensionMethod as described in
the documentation:

var existingUser = session.LoadByUniqueConstraint(x => x.Email, "john@gmail.com");

The keySelector.Body will evaluate to a UnaryExpression resulting in an exception.

This change introduces a check for this so that either a MemberExpression or UnaryExpression will work