Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
C# version of VFP PEMSTATUS()
Message
From
20/01/2010 12:08:48
John Baird
Coatesville, Pennsylvania, United States
 
 
To
20/01/2010 11:39:26
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
C# 2.0
Miscellaneous
Thread ID:
01444636
Message ID:
01445005
Views:
46
>>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[]{});
>>}
>>

>
>I'm with Viv on this one ... that's just Reflection, same as I used. There is no LINQ in your example at all.
>
>~~Bonnie

Sorry, I was typing between waiting for my current work to build. I meant to say LinQ/Reflection. You can use linq or you can use reflection to get the same results.

Charlei Calverts book shows both forms.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform