主构造函数未在 C# 6.0 中编译
Primary Constructor is not being compiled in C# 6.0
我正在尝试在 C# 6.0 中编写主构造函数新功能的简单示例,但我无法编译它。
我已将语言版本更改为 c# 6.0,但仍然无法正常工作。
public class Person (string fName, string lName)
{
public string FName { get; private set; } = fName;
public string LName { get; private set; } = lName;
}
如何让它编译?
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.
该功能已被删除。
我正在尝试在 C# 6.0 中编写主构造函数新功能的简单示例,但我无法编译它。 我已将语言版本更改为 c# 6.0,但仍然无法正常工作。
public class Person (string fName, string lName)
{
public string FName { get; private set; } = fName;
public string LName { get; private set; } = lName;
}
如何让它编译?
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.
该功能已被删除。