With an enum like say:
public enum Authors
{
KirkPatrick,
JasmineLliki,
NatashaKakuvi
}
Now using this helper method I can easily get the corresponding List<string>
values:
public class EnumHelper<T> where T : Enum
{
public static List<string> ToList() => Enum.GetNames(typeof(T)).ToList();
}
My desired output would be something like:
new List<string>() {"Kirk Patrick", "Jasmine Lliki", "Natasha Kakuvi"};
instead of
new List<string>() {"KirkPatrick", "JasmineLliki", "NatashaKakuvi"};
that the method outputs.