Create an object in C# from an F# object with optional arguments
- by Mark Pearl
I have a object in F# as follows...
type Person(?name : string) =
let name = defaultArg name ""
member x.Name = name
I want to be able to create an instance of this object in a C# project. I have added as a reference the correct libraries to the project and can see the object via intellisense however I am not sure on the correct syntaxt to create an instance of the object.
Currently I have the following in my C# project - which the compiler doesn't like...
var myObj1 = new Person("mark");