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

Null-propagating operator ?. in Expression Trees #503

Closed
NetMage opened this issue Apr 25, 2017 · 4 comments
Closed

Null-propagating operator ?. in Expression Trees #503

NetMage opened this issue Apr 25, 2017 · 4 comments

Comments

@NetMage
Copy link

NetMage commented Apr 25, 2017

Expression Trees should be extended to support the C# 6.0 null propagating operator so that it can be used with Linq, with a translation to allow providers such as Linq to SQL to work.

The discussion on CodePlex doesn't seemed to have moved over to here, and has been sitting around for 3 years - I think it is worth revisiting, and ideally implementing. An ideal use case is an Outer Join in Linq to Objects.

https://roslyn.codeplex.com/discussions/571077

@jnm2
Copy link
Contributor

jnm2 commented Apr 25, 2017

Yes. It has been far, far too long.
This may be covered by #158.

@NetMage
Copy link
Author

NetMage commented Apr 25, 2017

Good point. Searching for Linq and null didn't help me find it :)

@NetMage
Copy link
Author

NetMage commented Apr 25, 2017

I copied to other issue and will close this issue.

@NetMage NetMage closed this as completed Apr 25, 2017
@leandromoh
Copy link
Contributor

leandromoh commented Aug 8, 2020

While expression tree does not support the C# 6.0 null propagating, what we can do is create a visitor that modify expression tree for safe null propagation, just like the operator does!

Check this gist NullPropagationVisitor.cs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants