I have some code that sets up a dictionary with some defualt values for an enum:
foreach (string status in Enum.GetNames(typeof(TargetStatusType)))
{
dict.Add((TargetStatusType)Enum.Parse(typeof(TargetStatusType), status), 0);
}
Is there an easier way to do this, as it seems a bit messy.
I was hoping I could just do
foreach(TargetStatusType status in ?) ...
Thanks!