Esempio n. 1
0
        public static string GetValue(this SearchType searchType)
        {
            FieldInfo fi = searchType.GetType().GetField(searchType.ToString());

            DescriptionAttribute[] attributes = fi.GetCustomAttributes(typeof(DescriptionAttribute), false) as DescriptionAttribute[];

            if (attributes != null && attributes.Any())
            {
                return(attributes.First().Description);
            }

            return(searchType.ToString());
        }