Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Adding Properties to an object at run time
Message
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
C# 3.0
Miscellaneous
Thread ID:
01498603
Message ID:
01498912
Views:
29
>>I think Viv's idea of a dictionary is a good one, but I'd go one step further and use an enum rather than a string.
>>
>
>But if you're going to do that, why not just create a wrapper class that does all of the casting for you in the first place?
>
>Or, if you can upgrade, just use the new Expando object.

Duh. The ExpandoObject class competely slipped my mind - far simpler in this instance than the DynamicObject I suggested.
But I guess we have to assume that .NET 4 isn't an option for Frank anyway.....

>(honestly, I just use this class from Rick Strahl: http://www.west-wind.com/wwAppConfiguration/ which handles all of that automatically).
Previous
Reply
Map
View

Click here to load this message in the networking platform