4

I am trying to write a simple example of the Primary Constructor new feature in C# 6.0 but I am not able to compile it. I have changed the Language version to c# 6.0 but it still doesn't work.

enter image description here

public class Person (string fName, string lName)
{
    public string FName { get; private set; } = fName;
    public string LName { get; private set; } = lName;
}

How can I make it compile?

ehh
  • 3,412
  • 7
  • 43
  • 91

1 Answers1

9

I am trying to write a simple example of the Primary Constructor new feature in C# 6.0 but I am not able to compile it. I have changed the Language version to c# 6.0 but it still doesn't work.

That feature was cut.

Eric Lippert
  • 647,829
  • 179
  • 1,238
  • 2,067