/// <summary> /// Converts the name of the specified <paramref name="attribute"/> to an Enum type, removing the specified <paramref name="prefix"/> from the conversion. /// </summary> /// <typeparam name="TEnum">The <see cref="Type"/> of Enum to convert to.</typeparam> /// <param name="attribute">The attribute whose name to convert.</param> /// <param name="prefix"><see cref="String"/> instance to remove when converting the name <paramref name="attribute"/>.</param> /// <returns>An Enum value parsed from the attribute name.</returns> public static TEnum AsEnum <TEnum>(this XAttribute attribute, string prefix) where TEnum : struct { return(attribute.AsEnum <TEnum>(prefix, StringComparison.OrdinalIgnoreCase)); }