如何伪造多重继承?
我知道多重继承是不可能的,那么我怎样才能获得我需要的所有数据。有没有办法“伪造”多重继承,或者什么是更好的选择?
这就是我在 LoanProperties.aspx 页面中所拥有的内容:
Inherits="System.Web.Mvc.ViewPage<LoanManager.Models.VW_FIELD_VALUE>"
如果我没有提供足够的信息,我还需要
Inherits="System.Web.Mvc.ViewPage<LoanManager.Models.Loan>"
抱歉,我对此还很陌生,如果需要更多信息,我可以提供。
I know that multiple inheritance is impossible then how can I get all the data that I need. Is there a way to "fake" multiple inheritance, or what is a better option?
This is what I have, in my LoanProperties.aspx page:
Inherits="System.Web.Mvc.ViewPage<LoanManager.Models.VW_FIELD_VALUE>"
and I also need
Inherits="System.Web.Mvc.ViewPage<LoanManager.Models.Loan>"
Sorry if I didnt provide enough information I'm fairly new to this, if more is needed I can provide.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
创建新类,其中包含 Loan 属性和 VM_FIELD_VALUE 属性
在您看来,您可以执行 Model.Field 和 Model.Loan
但是,称其为伪造多重继承是错误的。这将是组合。
Create new class that contains a property for Loan and a property for VM_FIELD_VALUE both
In your view you can then do Model.Field and Model.Loan
However its wrong to call it faking multiple inheritance. It would be composition.