Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add NullSubstitution support to QueryExtentions #538

Conversation

TylerCarlson1
Copy link
Member

Solution for Issue #506

Changed ResolvedExpression to go through a list of classes that could possibly resolve it.
Took normal 2 conditions and made own class and added one for null substitution.

If no issues happen throws exception saying can't convert query mapper.

…n converters.

Changed the default to be executed only on member resolvers.
Added null substitution which will convert Nullable<T> dto.Value to use "dto.Value.HasValue ? dto.Value.Value : NullSubstitution" expression.
-Had to expose the null substitution value in order to access it.

Provided unit test to prove it works
@jbogard
Copy link
Member

jbogard commented Jun 23, 2014

So...I just did a big refactoring in this area as well, I won't be able to take the PR as-is but should get it most of the way there. I like your refactoring better - it matches how the runtime versions are.

@jbogard
Copy link
Member

jbogard commented Jun 23, 2014

Nevermind, I get what you're doing. So now we can combine expression result converters - if you have NullSubsitute AND MapFrom, they stack on top of each other. Nice!

@TylerCarlson1
Copy link
Member Author

Yea I'm not aware of any other custom type mappers that might fall under here, but I think it is set up in such a way that we can account for all scenarios to map Expression to Expression and can use it in other places at a later time.

For example #528 for resolving the property maps and null substitutions.
But not right now I think. I can't imagine someone would have a need to do a comparison between a DTO and EF or NHibernate object, by their primary keys, where they would need null substitution.

@jbogard
Copy link
Member

jbogard commented Jun 23, 2014

Basically there's two levels - value resolvers and mappers. You've got now the equivalent of a value resolver (which includes redirection and null replacement). Those are the big ones right now.

@jbogard jbogard closed this in fdb3b07 Jun 23, 2014
@TylerCarlson1 TylerCarlson1 deleted the NullSubstitutionProjectIssue branch November 7, 2015 03:01
@lock
Copy link

lock bot commented May 6, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators May 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants