Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Adding Properties to an object at run time
Message
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
C# 3.0
Divers
Thread ID:
01498603
Message ID:
01498912
Vues:
30
>>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).
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform