below is the Enum from which i need to populate object list
public enum Scope
{
[Description("Organization")]
Organization = 100,
[Description("Organization@Unit")]
Organization_Unit = 200,
[Description("Organization@Unit@User")]
Organization_Unit_User = 300
}
I have to create object list from this Enum
Object skeleton will be like below
public class ScopeKVP {
public string key {get;set;}
public int value {get;set;}
}
At the end I need below list of object from enum in which description
of each enum should be save in key
property of object and value
of enum should be saved in value
property of object like below
var scopeKvp = new List<ScopeKVP> {
new ScopeKVP {key= 100,value="Organization"},
new ScopeKVP {key= 200,value="Organization@Unit"},
new ScopeKVP {key= 300,value="Organization@Unit@User"}
}