Entity framework designer too clever for it's own good...

Mark Nicholls <[email protected]>
Newsgroups gmane.comp.windows.devel.dotnet.advanced
Message-ID <LISTSERV%[email protected]>
Hello,

not sure this is a sensible place to post this, but I'll give it a do.

I've got a problem implementing something similar to the  composite
pattern in the entity framework using single class = single table
inheritance.
The composite can only have 1 child.

We've got a table

Component
ComponentID int (primary key, auto increment) (identity)

Composite
ComponentID int (PK and FK into ComponentID) (identity)
PartID int (FK into ComponentID)


Now put it through the import 'wizard' and it's too clever by half...i.e.
it doesn't do what I want it to...

It basically creates a single entity called Component, and then makes the
partID a self reference, there is no Composite Entity...

While this makes logical sense, Composites are just Components with a
reference and Non Composites are ones with none...it's not what I want.

Any ideas?

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

View archives and manage your subscription(s) at http://discuss.develop.com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.