Hello,

I'm just having a mess about with LINQ and inheritance, I've basically
created the canonical example, base class (lets say Animal), and derived
class (lets say Dog) and set up the inheritance relations.

I notice that once I set up the relationship the Derived class is not
present in the data context as a "System.Data.Linq.Table<Dogs> Dogs".

hmmm....seems a little wierd, it would be nice to query and bind to Dogs
directly (if you see what I mean).

So I create a form and grid and bind to the Animals base Table (as it's
the only one I've got and remove all the stuff I'm not interested
in.....add something to the grid and of course it defaults to the base
type.

I can sort of get around this by adding a event handler to the AddNew
event on the binding to force it to create new Dogs.....but it all seems a
bit half baked.....am I missing something, shouldn't the datacontext
object 'know' what these types are all about and they should exist as 1st
class entities in the data context, rather than sort of afterthoughts.

Any help?

===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to