Can CodeDom create optional arguments when generating a c# method and provide a default value?
For example:
public void ExampleMethod(int required
, string optionalstr = "default string"
, int optionalint = 10)
Solution I've found a simple workaround for this, you can just put the default value in as part of the argument name:
CodeParameterDeclarationExpression(typeof(int), "optionalint = 5");
This works for me b/c I'm only using the CodeDom to produce C# code. It won't work if you need to support multiple languages.