Hi once try this code
i created enum and class which is having two properties
public enum projectstates
{
projectstate1 = 1,
projectstate2 = 2,
projectstate3 = 3,
projectstate4 = 4
}
public class projectcounterentities
{
public string ProjectState { get; set; }
public string count { get; set; }
}
List<dictionary><projectstates,>> list = new List<dictionary><projectstates,>>()
{
new Dictionary<projectstates,>() { { projectstates.projectstate1, "3" }, { projectstates.projectstate3, "75" } },
new Dictionary<projectstates,>() { { projectstates.projectstate4, "3" }, { projectstates.projectstate2, "15" } }
};
List<projectcounterentities> projectcounterentities = new List<projectcounterentities>();
foreach (var item in list)
{
projectcounterentities.AddRange(item.Select(h => new projectcounterentities() { count = h.Value, ProjectState = h.Key.ToString() }));
}