What is the best practice to convert an enum to an list of Id/Name-objects?
Enum:
public enum Type
{
    Type1= 1,
    Type2= 2,
    Type3= 3,
    Type4= 4
}
Object:
public class TypeViewModel
{
    public int Id { get; set; }
    public string Name { get; set; }
}
Something like:
var typeList = new List<TypeViewModel>();
foreach (Type type in Enum.GetValues(typeof(Type)))
{
    typeList.Add(new TypeViewModel(type.Id, type.Name));
}
 
     
    
