tag:blogger.com,1999:blog-8980734269859237005.post1671381246067729341..comments2024-01-30T01:03:21.768-08:00Comments on DevCurry: Convert Enum to List using C# or VB.NETSuprotim Agarwalhttp://www.blogger.com/profile/08349831623922214390noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-8980734269859237005.post-25093715069815495032009-12-19T09:51:01.029-08:002009-12-19T09:51:01.029-08:00Exactly. Can't the whole main routine could be...Exactly. Can't the whole main routine could be reduced to:<br /><br />var lstDays = Enum.GetNames(typeof(Days));<br /><br />with the same result?Harley Pebleyhttps://www.blogger.com/profile/06610309768015904662noreply@blogger.comtag:blogger.com,1999:blog-8980734269859237005.post-65399402194386924822009-12-07T19:30:01.650-08:002009-12-07T19:30:01.650-08:00If I am not wrong, Enum.GetNames() accepts an enum...If I am not wrong, Enum.GetNames() accepts an enumeration type as a parameterSuprotim Agarwalhttps://www.blogger.com/profile/08349831623922214390noreply@blogger.comtag:blogger.com,1999:blog-8980734269859237005.post-76742696102718323892009-12-07T11:56:08.112-08:002009-12-07T11:56:08.112-08:00Just curious: any reason not to use Enum.GetNames?...Just curious: any reason not to use Enum.GetNames?<br /><br />(It returns a string array. I suppose if you need a list, you can use Linq's ToList() method.)<br /><br />Cheers.Harley Pebleyhttp://www.skylark-software.comnoreply@blogger.com