Entity Framework or NHibernate both support the notion you looking for
though separating your data access without inheritance (e.g. composition
versus inheritance) might be a better solution overall.
From: Discussion of advanced .NET topics.
[mailto:ADVANCED-DOTNET@DISC...] On Behalf Of Mike Andrews
Sent: Wednesday, September 17, 2008 10:13 AM
To: ADVANCED-DOTNET@DISC... Subject: Re: [ADVANCED-DOTNET] Inheritance in LINQ-SQL Framework and/or
ADO.NET Entity Framework
Thanks for the quick response. I finally found the answer (through several
The current design of the LINQ-SQL system does not allow cross-assembly
inheritance nor conventional inheritance, per se.
Hopefully MS will rectify this situation with the next release or perhaps
the ADO.NET entity framework will work on this account.
What I did find out is that I can mimic the behavior I need by using
interfaces. I'm not exceptionally fond of this, but I'm going to give it a
> Hi Mike,
> I do not use the dbml designer, as it seems to get a bit too complicated
> once you get many tables etc involved or want to change the schenma - I
> prefer SQLMetal, though it should amount to the same thing.
> I am not sure what is causing your problem but I am able to a) extend the
> class in another assembly b) add extra gubbins to the class through an
> additional partial class in the same assembly, using this approach.
> From the look of your error I would suspect a critical difference in some
> the attribute decorations for the extra columns or something of that
> Sorry if I am not much help - just trying to get going on this side of
> things myself and answered as no-one else did.
> On Tue, Sep 16, 2008 at 9:26 PM, Mike Andrews
> > I have a problem for which I cannot seem to discern a reasonable
> > I would like to use the LINQ-SQL classes and objects for doing my
> > manipulations but both seem to be lacking in the area that I need and I
> > would like to know if any of you have a reasonable solution/answer (or
> > to tell me it can't be done would be fine).
> > I currently have a base set of classes setup in a dbml file and the
> > corresponding code (built using the built-in designer) contained in
> > assembly.
> > I now want to re-use that work that was done and extend those classes in
> > another assembly.
> > For example, lets say have I have table Employee in the main database
> > schema
> > from which I'm deriving this project.
> > I now have a new database with the exact same schema save that the
> > table now has an added column that was not previously present in the
> > schema.
> > I want to be able to "inherit" the "Employee" class from the primary
> > assembly and extend it with an added column.
> > I have been able to accomplish this feat, and the designer seems to
> > this sort of behavior, however, an exception occurs when I try to
> > the code.
> > The exception reads:
> > Data member 'System.Guid SetID' of type 'Lib1.Set' is not part of the
> > mapping for type 'E2Set'. Is the member above the root of an inheritance
> > hierarchy?
> > I'm really at a loss here on what to do next or how to overcome this.
> > help would be most appreciated.
> > Thanks,
> > Mike
> > ===================================
> > This list is hosted by DevelopMentor(R) http://www.develop.com > >
> > View archives and manage your subscription(s) at
> > http://discuss.develop.com > >
> This list is hosted by DevelopMentor(R) http://www.develop.com >
> View archives and manage your subscription(s) at
> http://discuss.develop.com >