C# Project in Visual Studio 2013
I need to build a X-Walk (cross reference) between a database's field names and a list of 'Standard' names.
Because this list needs to be maintained and occasionally updated, my inclination is to create a Settings class and then call the setting to get the cross reference. e.g.
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("SIZE")]
public string MySize {
get {
return ((string)(this["MySize"]));
}
}
and then it would obviously be called thus:
private string str = MyProject.AttributeXref.Default.MySize;
Here is where the rub comes... at run-time the code I have to respond to will be passing the 'Attributes' by name and I have to perform the lookup. If all I have is 'MySize' and not
MyProject.AttributeXref.Default.MySize;
should I be doing something similar to
MyProject.AttributeXref.{0}
Or... Am I going about this all wrong?
and the answer is...
Output - MySize = SIZE