[英]Creating a custom method of a System Type
I am just curious if there is a way of adding a method to the system type ie 我只是好奇是否有办法向系统类型添加方法,即
char.IsNull(value)
i know a similar thing can be achieved by using an extension method but to call that i have to put 'M'.IsNull()
我知道通过使用扩展方法可以实现类似的事情,但要调用我必须放
'M'.IsNull()
No, basically; 不,基本上; there is an ongoing discussion (titled "extension everything") on the topic of whether to add such a feature, but right now (including the current C# 8 previews): no.
有关是否添加此类功能的主题正在进行讨论 (标题为“扩展所有内容”),但现在(包括当前的C#8预览):不。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.