Email template referencer Which is best practice for creating an enum-like lookup for templates? I enjoy being able to bring up my templates with VS IntelliSense so either works for me.

Option 1 (enum/Dictionary combo):

public enum Template
{
    AccountInformation = 1,
    Registration = 2,
    Signed = 3
}
static readonly IDictionary&lt;Template, String&gt; TemplateData = new Dictionary&lt;Template, String&gt;()
{
    {Template.AccountInformation, "accountinfo.txt"},
    {Template.Registration, "registration.txt"},
    {Template.Signed, "signed.txt"}
};


Option 2 (static class):

public static class Template
{
    public static String AccountInformation = "accountinfo.txt";
    public static String Registration = "registration.txt";
    public static String Signed = "signed.txt";
}
Try this:

public enum Template
{
    [StringValue("accountinfo.txt")]
    AccountInformation = 1,
    [StringValue("registration.txt")]
    Registration = 2,
    [StringValue("signed.txt")]
    Signed = 3
}


For more information: String Enumerations in C#

Otherwise, I prefer your second option.