Hi everybody,
I have a model class which is modeled after a view using Reverse POCO Generator. I am returning that view back. My question is - how can I get back to the properties of each column (e.g. for example, public String Salespoint {get;set;} - I need to get 'Salespoint' back)?
In other words, I started this code
foreach (var col in searchViewModel.Result.List) // List is IEnumerable of SalesPointsLicensesList class
{
}
I need to know the name of the column (class property) and its value. How can I get the name of the property here?
Thanks in advance.
UPDATE. Looks like I would need to use reflection and PropertyInfo class.
If it's not broken, fix it until it is.
My Blog