Normally, I would agree Frans, however in this case it's a requirement. To explain further, I have a base "application" (which is a designer of sorts) and database. The database itself contains the bare essentials for this project. Now, I don't want to "mess up" the database as it is because it works along with the "application."
What I need is the ability to have a "base" set of code and a "base" data model that then can be extended for other applicable projects. This base set of code works well, but it tailored to be generic and non-specific. Now I need to create a non-generic solution tailored to fit a similar but slightly different scenario where some columns need to be added to a particular table, some different sp's written and those columns added as fields in the corresponding "business" object. Of course this will be in a different database. This is the reason for which I need the inheritance across multiple assemblies. I need some shared code as well as specific code and yet I need my "application" to be able to work with the objects regardless of from what "assembly" they came and what database to which they are connected. Thanks, Mike On Thu, Sep 18, 2008 at 1:42 AM, Frans Bouma <[EMAIL PROTECTED]> wrote: > > Does the ADO.NET Entity Framework support inheritance across assemblies? > > In other words, can I declare some "base" objects in one assembly, then > in > > another assembly, inherit and extend those objects? > > Not sure, but I really don't think it's wise to do so anyway. > Having > two schemas which have fields in common in perhaps a subset of the entities > isn't a reason to share code among the two projects: if one schema needs a > change in a table which is apparently 'the same' you are in trouble. > > FB > > > > > Thanks, > > Mike > > > > On Wed, Sep 17, 2008 at 3:21 PM, Shawn Wildermuth < > > [EMAIL PROTECTED]> wrote: > > > > > 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. > > > > > > -----Original Message----- > > > From: Discussion of advanced .NET topics. > > > [mailto:[EMAIL PROTECTED] On Behalf Of Mike Andrews > > > Sent: Wednesday, September 17, 2008 10:13 AM > > > To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM > > > Subject: Re: [ADVANCED-DOTNET] Inheritance in LINQ-SQL Framework and/or > > > ADO.NET Entity Framework > > > > > > Hi Lain, > > > > > > Thanks for the quick response. I finally found the answer (through > several > > > online posts). > > > 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 > > > try. > > > > > > Thanks, > > > Mike > > > > > > > > > On Wed, Sep 17, 2008 at 3:45 AM, Iain Smallwood <[EMAIL PROTECTED] > > > >wrote: > > > > > > > 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 > > > > of > > > > the attribute decorations for the extra columns or something of that > > > > nature. > > > > 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. > > > > > > > > cheers, > > > > Iain > > > > > > > > On Tue, Sep 16, 2008 at 9:26 PM, Mike Andrews > > > > <[EMAIL PROTECTED]>wrote: > > > > > > > > > I have a problem for which I cannot seem to discern a reasonable > > > > solution. > > > > > I would like to use the LINQ-SQL classes and objects for doing my > > > > database > > > > > 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 > > > > just > > > > > 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 > > > > library > > > > > 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 > > > > Employee > > > > > table now has an added column that was not previously present in > the > > > > other > > > > > 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 > > > > "allow" > > > > > this sort of behavior, however, an exception occurs when I try to > > > execute > > > > > 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. > > > > Any > > > > > 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 > > > > > > > > > > =================================== > > > This list is hosted by DevelopMentorR 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 > > > > > > > =================================== > > This list is hosted by DevelopMentorR 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 > =================================== This list is hosted by DevelopMentorĀ® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com