how to make a enum list in csharp

Code Example - how to make a enum list in csharp

                
                        List<Days> days = Enum.GetValues(typeof(Days))
                            .Cast<Days>()
                            .ToList();
                    
                
 

csharp convert enum to list

                        
                                Enum.GetValues(typeof(SomeEnum)).Cast<SomeEnum>();
                            
                        
 

Related code examples