Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
C# version of VFP PEMSTATUS()
Message
From
20/01/2010 03:53:02
 
 
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
C# 2.0
Miscellaneous
Thread ID:
01444636
Message ID:
01444892
Views:
44
>>You can also use linQ to see if the property exists and to return the properties value.
>>
>>if( MyClass.GetType().GetProperty (propName) != null)
>>{
>>     object propValue = MyClass.GetType().GetProperty(propName).GetValue(MyClass, new object[]{});
>>}
>>
>
>Where does Linq come into that?
>Oh - and before Gregory beats me to it - assigning a value to GetProperty() in the if clause would avoid having to re-evaluate if it's not null.....

You're way too fast
Gregory
Previous
Reply
Map
View

Click here to load this message in the networking platform