阅读背景:

如何将类层次(基类和继承类)映射到数据库

来源:互联网 

I want to create a hierarchical object model in ASP.NET MVC, but I'm not sure what would be the best way to design database for this. I have a Product base class with certain properties like Title, Price, OnHandQty etc. I have several inherited classes like Book, which has extra properties like ISBN number, Author etc. Many of my products will fall under generic (base) Product class, but some products will fall under these derived classes (e.g. Book). I am not sure what is the best methodology to map this to database. Should I create separate tables for each product type (including one for generic product)? Or is there any better way?I want to create a hierarchical object model in




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: