Sherzy
3/17/2016 - 4:50 PM

Enum

Enum

public enum View {  DAY = 0, WEEK = 1, MONTH = 2  }
// Handy wany to return the Enum (LookupTypeEnum) to UI to use for drop-down list
vm.Types = new List<EnumModel>();
foreach (LookupTypeEnum e in Enum.GetValues(typeof(LookupTypeEnum)))
{
    EnumModel m = new EnumModel();
    m.Value = (int)e;
    m.Name = e.GetDescription();
    vm.Types.Add(m);
}