在构造函数上使用Expression Body [英] Using Expression Body on constructor

查看:476
本文介绍了在构造函数上使用Expression Body的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我确实有一个关于在构造函数中使用表达式主体的问题。我已经将目标框架设置为4.7.2并使用C#7.1但仍显示这些波浪线。构建时没有错误。

I do have a question about using an expression body inside of the constructor. I already set the target Framework to 4.7.2 and use C# 7.1 but still showing these squiggly lines. There's no error when building though.

说到将C#版本设置为7.1,当我将代码推送到源代码控制时,我的一个队友总是需要从C#7.0转换项目使用C#7.1即使在我将代码推送到存储库之前它使用C#7.1版本。 

Speaking of setting the C# version to 7.1, when I push the code to the source control, one of my teammates always needs to convert the project from C# 7.0 to use the C# 7.1 even if before I push the code to the repository it uses the C# 7.1 version. 

参考图像

问候

推荐答案

如果将鼠标悬停在红色项目上,它会是什么说?如果使用4.7.2,则显示的代码中没有明显的问题,这在4.6.x中也是有效的。

If you hover over the red items what does it say? There are no visible issues in the shown code if using 4.7.2, this is valid in 4.6.x too.

关于源代码管理,开始使用什么?我的猜测是项目最初是如何创建的,如果你的团队伙伴使用当前框架创建一个类似的类然后你从源代码打开类会怎么样?

In regards to source control, what is begin used? My guess is how the project was originally created, what happens if you have your team mate create a similar class using the current framework and then you open the class from source code?


这篇关于在构造函数上使用Expression Body的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆