为什么不能SqlDataReader类被继承? [英] why cant SqlDataReader class be inherited?

查看:121
本文介绍了为什么不能SqlDataReader类被继承?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

SqlDataReader的 该类没有标记密封那么是什么使得它uninheritable?

SqlDataReader class is not marked sealed then what makes it uninheritable?

推荐答案

SqlDataReader的类的构造函数被标记为内部这意味着它只能通过在 System.Data.dll中组装类型的实例化。这也禁止你从它继承,作为基本类型不能被实例化。

The SqlDataReader type's constructor is marked as internal which means it can only be instantiated through types in the System.Data.dll assembly. This also prohibits you from inheriting from it, as the base type cannot be instantiated.

这篇关于为什么不能SqlDataReader类被继承?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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