-
Get property value from C# object dynamically
In Generic Class, it is quite common to get the value for a specific property dynamically. C# refection provides ways to get the Property value dynamically. If the IDynamicMetaObjectProvider can provide the dynamic member names, you can get them. See GetMemberNames implementation in the apache licensed ImpromptuInterface (which can be found in nuget), it works…
-
Generic Type Conversion Mechanism in C#
Microsoft .Net already has a bunch of great string conversion routines you can use! A TypeConverter can do most of the heavy lifting for you. Then you don’t have to worry providing your own parsing implementations for built-in types. Note that there are locale-aware versions of the APIs on TypeConverter that could be used if…