Click here to Skip to main content
15,885,546 members
Articles / Web Development / ASP.NET

Get Nested Property value using reflection and Linq.Expression

Rate me:
Please Sign up or sign in to vote.
4.67/5 (3 votes)
8 Apr 2011CPOL 21.2K   2  
Saw this a while back; it's simpler (dirty and wrong but... ):public static T Get(Func getDelegate, bool DefaultTOnNull = false, T defaultVal = null) where T : class{ T result = null; try { result = getDelegate(); } catch...

Alternatives

Members may post updates or alternatives to this current article in order to show different approaches or add new features.

Please Sign up or sign in to vote.
20 Nov 2011Massimiliano Peluso "WeDev Limited" 1 alternative  
Get Nested Property value using reflection and Linq.Expression

License

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


Written By
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions