protected string GetEnumDescription(HealthcheckRiskModelCategory value) { // Get the Description attribute value for the enum value FieldInfo fi = value.GetType().GetField(value.ToString()); DescriptionAttribute[] attributes = (DescriptionAttribute[])fi.GetCustomAttributes( typeof(DescriptionAttribute), false); if (attributes.Length > 0) { return(attributes[0].Description); } else { return(value.ToString()); } }
public HeatlcheckRuleModelAttribute(string Id, HealthcheckRiskRuleCategory Category, HealthcheckRiskModelCategory Model) { this.Id = Id; this.Category = Category; this.Model = Model; }