Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Primary Constructor is not being compiled in C# 6.0 [duplicate]

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?

like image 686
ehh Avatar asked Jan 06 '23 21:01

ehh


1 Answers

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.

like image 147
Eric Lippert Avatar answered Jan 22 '23 17:01

Eric Lippert