I am using the C# GetPropertymethod using reflection.
obj.GetType().GetProperty(“columnName”)
However I cannot guarantee the exact casing of the column name as it is being based in from an external source. It maybe ColumnName or columnname
I was thinking if I could just force the string column name to uppercase, but how would I then deal with the Property on the object itself? The getProperty method looks like it needs to be the EXACT casing?
You can use
Note that you’ll still need the
InstanceandPublicbit (assuming that this is a public instance property) as otherwise it won’t find anything.