Which “C# Experimental language feature” is this?

孤人 提交于 2019-12-01 15:50:37

This was for Primary Constructors, a feature which has now been cut from C#6.

On November 12, 2014 Microsoft announced the release of Visual Studio 2015 on the day of Visual Studio Connect() from New York, USA where they announced many new features as well as enhancements with C# 6.0. So we should understand that a Primary Constructor is not applicable with C# 6.0 but we can do the same thing using Auto Implemented Properties Initializers.

Basically a Primary Constructor is a feature of C# that was announced with Visual Studio 2014. But now it has been removed from Visual Studio 2015 Preview. So in C# 6.0 it's not possible to use a primary constructor.

You can still use this if you click on your project, and go to the Properties pane and select C# Language Level to Experimental.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!