> 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".
are they all mapped onto the same table with a
discriminator?
> 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.
you can forget databinding if inheritance is
involved: databinding in
grids works with a single set of properties, and typically
grids pick either
the first entry in the bound set to determine these or ask
the ITypedList
implementation of the set, if available.
if you have 2 subtypes of animal: Dog and JellyFish,
both will have
their own unique properties: what should a grid do: display
these columns or
not? If so, what should be happening when a row represents a
dog and a column
specific for jellyfish is changed?
FB
===================================
This list is hosted by DevelopMentorŪ http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com
|