I have a class that contains a bunch of const strings similar to this
public class ReportStrings
{
public const string ReportOne = "REPORTNAME_ONE";
public const string ReportTwo = "REPORTNAME_TWO";
public const string ReportThree = "REPORTNAME_THREE";
}
I have an enum that I'm creating to eventually replace the use of these strings through out my apps code that is similar to this below.
Public enum ReportIDs
{
ReportOne = 10001
ReportTwo = 10002
ReportThree = 10003
}
I'm wondering if there is a way to map the two so that if one of the const strings is used in a method it knows how to map that string to the enum value for use else where. An example use case being if a method currently takes in a List<string>
containing strings that match to whats in ReportStrings
but will eventually move to a List<ReportIDs>
how can I set up the method to support using either one or the other?