Click here to Skip to main content
Click here to Skip to main content
Alternative Tip

Tagged as

Go to top

Walk 'object tree' with easy null handling

, 19 Dec 2010
Rate this:
Please Sign up or sign in to vote.
Looks good!I would suggest using Func instead of GetDelegate, simply because it's the same thing.Also, the compiler will deduce the type for you, so there's no need to write:Level3 level3 = NullHelper.Get(() => level1.Level2.Level3);when:var level3 = NullHelper.Get(()...
Looks good!
 
I would suggest using Func<T> instead of GetDelegate<T>, simply because it's the same thing.
 
Also, the compiler will deduce the type for you, so there's no need to write:
Level3 level3 = NullHelper.Get<Level3>(() => level1.Level2.Level3);
when:
var level3 = NullHelper.Get(() => level1.Level2.Level3);
may be easier to read.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

IGood
Software Developer 5TH Cell
United States United States
Tools & gameplay programmer at 5TH Cell Media.
DigiPen student class of '09.

Comments and Discussions

 
-- There are no messages in this forum --
| Advertise | Privacy | Mobile
Web01 | 2.8.140905.1 | Last Updated 19 Dec 2010
Article Copyright 2010 by IGood
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid