I have a enum that's contain Description Attribute(for audit):

public enum ActivityType
{
    [NotExist("Not Assign")]
    [Description("Change Level")]
    LevelChanged,

    [NotExist("Not Assign")]
    [Description("Change Skill Level")]
    SkillLevelChanged
 }

And all had been great until i needed to put Desription in Resource files(attribute didn't support them), so i need Dictionary or something like this.The question is: How implement this feature without big changing in all another logic?Something like this:

private static readonly Dictionary<ActivityType, String> ActivityDescription = new Dictionary<ActivityType, String>()
    {
        {ActivityType.LevelChanged, "Change"},
        {ActivityType.SkillLevelChanged, "SkillChange"}
    }

Related posts

Recent Viewed