/// <summary> /// Get sport type as a string. /// </summary> /// <param name="sport">SportType enum to convert</param> /// <returns>SportType as a string</returns> public static string ToString(this SportType sport) { DescriptionAttribute[] attributes = (DescriptionAttribute[])sport.GetType().GetField(sport.ToString()).GetCustomAttributes(typeof(DescriptionAttribute), false); return(attributes.Length > 0 ? attributes[0].Description : string.Empty); }