I have an entity class say MyEntity.cs that has around 108 properties. In my ASP .net application UI, I am displaying a string value from the database(say for instance) which contains some fieldnames or datapoints delimited in the format <%fieldname%>. The fieldname is nothing but a column name in the table MyTable. I also read MyTable(which has around 108 columns) record(just one single record) and populate the entity MyEntity.
What I need to do is to merge MyEntity property.cs values with the string that contains the <%fieldname%>. I thought of using reflection but the property names in MyEntity.cs might not exactly match the column names in MyTable. So I am not sure how I should proceed.
If there is a way that I can specify a name other than the propertyname for MyEntity properties, so that I can use the MyTable column names in the entity for each property and access them through reflection in my code and replace the string's <%fieldname%> with the MyEntity.cs property values. Any help would be appreciated?