Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

LoadByUniqueConstraint now also accepts UnaryExpression as keySelector parameter #495

Merged
merged 1 commit into from Jan 7, 2013

Conversation

Projects
None yet
3 participants
Contributor

sebastian-claesson commented Nov 30, 2012

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

LoadByUniqueConstraint now also accepts UnaryExpression as keySelecto…
…r parameter

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

var existingUser = session.LoadByUniqueConstraint<User>(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
Owner

ayende commented Nov 30, 2012

Hi,
Can you send us a CLA?

ravendb.net/contributing

On Fri, Nov 30, 2012 at 10:46 AM, sebastian-claesson <
notifications@github.com> wrote:

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

You can merge this Pull Request by running:

git pull https://github.com/sebastian-claesson/ravendb master

Or view, comment on, or merge it at:

#495
Commit Summary

  • LoadByUniqueConstraint now also accepts UnaryExpression as
    keySelecto…

File Changes

  • _M_Bundles/Raven.Client.UniqueConstraints/UniqueConstraintExtensions.cs (65)

Patch Links

Contributor

sebastian-claesson commented Dec 11, 2012

Ok, i have sent it in now, sorry it took so long.

@fitzchak fitzchak merged commit bf5e707 into ravendb:master Jan 7, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment