using System.Collections.Generic;
public static void Main()
Console.WriteLine(string.Join(", ", Utils.AsOptions<MyEnum>()));
public static class Utils
public static IEnumerable<T> AsOptions<T>() where T : struct, IConvertible
if (!typeof(T).IsEnum) throw new ArgumentException("T must be an enumerated type");
return Enum.GetValues(typeof(T)).Cast<T>();