开发者

Inheritance within generated LINQ classes?

I have a data warehouse system that relies on LINQ to SQL for its database abstraction.

To cut a long story short, I have a 2011 database which contains many records for this year, I 开发者_开发技巧also have a database for each of 2009 and 2010.

These are all located on different servers, but it does not seem to be a problem to have classes within my dbml from different servers.

The problem I have, is that there is table overlap between the two, for example, there is for example a list of customers in both databases. I don't want to have two customer classes in my LINQ to SQL generated code, but would much rather have some sort of inheritance.

I'm struggling to explain the problem maybe, can someone offer any help with how I can have a single class representing multiple tables? I would like to stick to DRY principles.

AK


I think if both database have same table structure, you don't need two classes for both, only the connection string will decide which database the class belongs to.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜