R
Ron M. Newman
Dear C# Sages,
For my own persistence purposes I need to be able to load an object from
some source and re-fit it with its value that's represented as a string.
Many objects support "Parse" which takes a string input and sets the value
for the object. However, I can't find a way to "pre-identify" those objects
with the same ease I can do the opposite: ask an object if it's IFormattable
so that I can invoke its "ToString" method. Am I doomed to use reflection to
actually ask each object i come across if it has a "Parse" method that has a
string as paramter? Isn't there some "uber-Interface" this adheres to?
am I missing something?
Thanks
- Ron
For my own persistence purposes I need to be able to load an object from
some source and re-fit it with its value that's represented as a string.
Many objects support "Parse" which takes a string input and sets the value
for the object. However, I can't find a way to "pre-identify" those objects
with the same ease I can do the opposite: ask an object if it's IFormattable
so that I can invoke its "ToString" method. Am I doomed to use reflection to
actually ask each object i come across if it has a "Parse" method that has a
string as paramter? Isn't there some "uber-Interface" this adheres to?
am I missing something?
Thanks
- Ron