> On Fri, 18 Apr 2008 18:04:38 +0200, Frans Bouma <[EMAIL PROTECTED]> wrote: > >> 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? > > This is why I thought it wierd that the inheritance mapping doesn't expose > the subtypes as 'virtual' tables, then you would bind to them directly, > the mapping would work to map this to the database and everyones > happy....the client gets an OO model the database an RDb one....to me this > is the point of the O/R mapping....as I say I think this implementation is > half baked.
I think this is a limitation inside their o/r system. I'm currently writing a set of templates for our code generator engine to use our meta-data to spit out linq to sql files (as our designer has model management for database changes, their designer doesn't, so why not ;)) and I indeed saw that there aren't any Table<subtype> typed properties for my subtypes on the datacontext. I haven't tested yet what happens if I do add them manually to the datacontext class, if things go bezerk during fetching or not. They also store all discriminator values/types combinations at the hierarchy root, so I think bending their framework to use the subtypes as normal types would probably not work... FB > > > FB > > > >=================================== > >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 DevelopMentorR 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