Is there any way besides renaming the field to assign it a value if its name matches its name?
As I wrote this, I thought it was possible that reflection could be used.
Reflection works, but is there a better way to do this?
FieldInfo fi = typeof (TheClass) .GetField ("TheClash");
fi.SetValue (TheClassObj, TheFieldValue);
source
share