Any option to get Enterprise Architect to recognize optional parameters in C#?
I have attempted to import existing code and get the following error:
There was an error parsing C:\MyProject\FooBar.cs on line 30. Unexpected symbol: =
Code:
public void Foo(int bar = 1) //Line 30
{
}
I have also attempted to start from scratch and generate code from Enterprise Architect. I created a class, then added an operation to that class and defined the parameters. The form for editing parameters allows me to supply the "Name", "Type", and "Default" (as well as other information). I added Name: bar, Type: int, Default: 1. Then when I generated the code this is what I get (no optional parameter generated!)
namespace System {
public class FooBar {
///
/// <param name="bar"></param>
public void Foo(int bar){
}
}//end FooBar
}//end namespace System
What am I doing incorrectly?