我在 VS2010 上使用 ReSharper 插件,并生成一个接口方法。
ReSharper 在参数名称上添加 @。那是用来做什么的?
int Count(Func<ContratoList, bool> @where);
有什么区别
int Count(Func<ContratoList, bool> where);
Thanks!
The @
符号允许您使用保留字 http://msdn.microsoft.com/en-us/library/x53a06bb.aspx在变量名中。
int @class = 1;
void MyMethod(int @goto);
bool @public { get; set; }
正如 Marc 在他的评论和回答中正确指出的那样,ReSharper 这样做实际上是错误的,因为where
is a 上下文关键字 http://msdn.microsoft.com/en-us/library/the35c6y.aspx并且实际上不是保留字,因此您的方法将在没有@
.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)