Replies: 3 comments
-
Why not fields and indexers too? |
Beta Was this translation helpful? Give feedback.
0 replies
-
Beta Was this translation helpful? Give feedback.
0 replies
-
Yes, please close so that discussion moves to #1106. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
With C# 6 came the null-propagating operator feature. Such as
randomObject?.DoStuff();
What I always stumble up on is following issue
someObject?.Property = val;
Which leads to "CS0131 The left-hand side of an assignment must be a variable, property or indexer DataAccess"
It would be great to set property values with the null-propagating operator if the object is not null. Under the hood something like:
if(someObject != null) someObject.Property = val;
Beta Was this translation helpful? Give feedback.
All reactions