avatar
W*n
1
DataAnnotation - ValidationAttribute有一个可以使用named parameter的ctor,附
件图片那个样子的,这个不是C# 4中的那种named parameter?用ilspy看了一下也没看
出什么名堂。谁能讲解一下?
avatar
v*n
2
attribute的named argument和普通method不一样
http://msdn.microsoft.com/en-us/library/aa664614(v=vs.71).aspx
Attribute classes can have positional parameters and named parameters. Each
public instance constructor for an attribute class defines a valid sequence
of
positional parameters for that attribute class. Each non-static public
read-write field and property for an attribute class defines a named
parameter
for the attribute class.

【在 W********n 的大作中提到】
: DataAnnotation - ValidationAttribute有一个可以使用named parameter的ctor,附
: 件图片那个样子的,这个不是C# 4中的那种named parameter?用ilspy看了一下也没看
: 出什么名堂。谁能讲解一下?

avatar
W*n
3
原来如此,而且第一版.net就有,学习了

Each
sequence

【在 v******n 的大作中提到】
: attribute的named argument和普通method不一样
: http://msdn.microsoft.com/en-us/library/aa664614(v=vs.71).aspx
: Attribute classes can have positional parameters and named parameters. Each
: public instance constructor for an attribute class defines a valid sequence
: of
: positional parameters for that attribute class. Each non-static public
: read-write field and property for an attribute class defines a named
: parameter
: for the attribute class.

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。