Bydefault类返回一些东西为什么 [英] Bydefault class returning some thing why

查看:79
本文介绍了Bydefault类返回一些东西为什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我写了一个没有任何东西的类,

当我创建对象并使用它时给出.GetDataTableSchema()



例如。公共类ClassName

{}
现在当我写ClassName时
。它给出了类似

ClassName.Equals

ClassName.GetDataTableSchema

ClassName.ReferenceEquals

ClassName.SetCommandTimeout



为什么这四个来了。

解决方案

空类上可用的默认方法是,



ClassName.Equals()

ClassName.GetHashCode()

ClassName.GetType()

ClassName .ToString()



需要关于你的类和命名空间的更多细节。


在这种情况下......粗体的不是默认..但它们即将到来,因为......你的代码中有扩展方法,它们扩展了对象 ........点击goto定义...你会发现这个...





< pre lang =vb> ClassName.Equals
ClassName.GetDataTableSchema
ClassName.ReferenceEquals
ClassName.SetCommandTimeout


if i write one class without any thing inside it,
when i create object and use it gives .GetDataTableSchema()

eg. public class ClassName
{ }
now when i write ClassName. it gives like
ClassName.Equals
ClassName.GetDataTableSchema
ClassName.ReferenceEquals
ClassName.SetCommandTimeout

why this four coming.

解决方案

The default methods available on empty class are,

ClassName.Equals()
ClassName.GetHashCode()
ClassName.GetType()
ClassName.ToString()

Need more details regarding your class and Namespace.


In this case ... The bold one not default .. but they are coming because ... You have extension methods in your code ..... which are extending either object or a class........ click on goto definition ... and you will find this...


ClassName.Equals
ClassName.GetDataTableSchema
ClassName.ReferenceEquals
ClassName.SetCommandTimeout


这篇关于Bydefault类返回一些东西为什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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