C# - Default value for a Property if Null
Here's the gist, handy to set other values different than null if an object property is null.
Written by Jorge Medina
Related protips
2 Responses
Why is obj passed as a ref parameter? It's never assigned to.
over 1 year ago
·
True, that code in the Gist is quite old, wasn't sure of the use of ref and out, had not updated it since.
Makes no sense there since the method struct is modified, not there reference itself, I just updated the Gist.
Thanks.
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#.net
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#