views:

40

answers:

1

Is there a way to generate a dictionary initializer using the C# CodeDom? Are those supported at all?

I would like to have:

private IDictionary<string, string> map = new Dictionary<string, string>
{
    { "Name", "Value" },
    ...
};
+3  A: 

This is not possible using the CodeDom constructs. They were not updated for collection initializers.

LukeH has an excellent blog post on the subject of 3.5 features and the CodeDom

JaredPar
Was afraid that's the case... Thanks anyway!
hmemcpy