Currently, I have created a class with ~ 30 properties to set. This is done to create the URL request later (i.e. http://www.domain.com/test.htm?var1=a&var2=b...&var30=dd ").
The problem I am facing is property names that do not necessarily match the names of the request variables (this should be different). For example, I might have a variable called "BillAddress", while the query variable should be "as_billaddress".
I have no control over the naming scheme of query variables, as they are installed in an external source.
One of the possible solutions that I used is to create a custom attribute and design the properties using its corresponding mappings:
[CustomQueryAttribute("as_billaddress")]
string BillAddress{get;set;}
To get the attribute, although it needs a little reflection, and because of more properties, I was curious if there is an easier way to perform this function. Not as much as setting / getting custom attributes without reflection, but the ability to bind a variable with a string variable to any property.
I also thought about how to configure each variable as a kind of KeyValuePair, each of them being a copy of the request, but I didn’t get into that idea too much.
To summarize / clarify my background above, what would you do to associate a string with a property (rather than a property value)?
As always, any comments are welcome.