Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
C# version of VFP PEMSTATUS()
Message
From
20/01/2010 13:00:56
John Baird
Coatesville, Pennsylvania, United States
 
 
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
C# 2.0
Miscellaneous
Thread ID:
01444636
Message ID:
01445035
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.
>
>You can't do it using Linq alone. The Liinq example you referred to relies on the GetMembers() extension method which, in turn, relies on reflection......


Okay... nitpick all you want. Argue with Charlie Calvert then....
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform