I have a custom entity in a relational database that I have mapped to the CLR via a domain model. So by using the following statement, I can pull in an entity from my database i
GetProperties
indeed is the correct method.
To get rid of the compiler error, change your code to this:
var value = reportField.GetValue(inspection, null);
You need to pass the instance from which you want to obtain the value, as a PropertyInfo
object is not bound to any specific class instance.
Please consider following the standard .NET naming rules.
This would lead to the following:
NewSystemAlarm
instead of New_systemAlarm
newSystemAlarm
or _newSystemAlarm
instead of _new_systemAlarm
NewTestInspectionExtensionBases
instead of New_testinspectionExtensionBases
NewTestInspectionId
instead of New_testinspectionId