草庐IT

HttpPostedFileWrapper

全部标签

c# - HttpPostedFileBase 与 HttpPostedFileWrapper 的关系

我了解HttpPostedFileBase和HttpPostedFileWrapper之间的关系,就两者的需求而言(即在单元测试/模拟中)。但是,为什么当我在HttpPostedFileBase的返回值上设置断点时,它是否显示为HttpPostedFileWrapper?此外,HttpPostedFileBase没有实现ContentType属性。那么,当我的代码仅引用HttpPostedFileBase而不是HttpPostedFileWrapper时,为什么它会返回一个值?这是什么诡计?编辑#1:感谢@lawliet29的精彩回复。我已经按照建议写出了结构。publicsealed