Greg, Sorry I'm no help on this one, we were using EF right out of the box on a greenfields application, so I suspect that modified our DB design a little as we went. We don't have any scenarios like the one you describe and I haven't done it as yet.
Neil. On 30 January 2011 13:25, Greg Keogh <[email protected]> wrote: > Neil and other folks using EF4, > > > > The most vital thing I need to learn in EF4 is how you are supposed to > create a strongly typed custom view of multiple tables and fill the thing. > > > > In classic ADO.NET you would construct an XSD DataSet with the columns you > want, then write a SELECT with JOINs to fill it. In netTiers the process is > nearly the same, you write the View then the classes and methods are > generated, but it's all plain ADO.NET under the covers. > > > > I can't find the equivalent of this in EF4. I created a new Entity in the > designer with the combined columns of different tables I'm joining, > expecting this to represent my view. However, after hours of suffering I > can't create such a thing because of errors like these: > > > > EntitySets 'MainLists' and 'Instance' are both mapped to table 'Instance'. > Their primary keys may collide. > > Must specify mapping for all key properties (MainLists.InstId) of the > EntitySet MainLists. > > > > There are hundreds of reports of people pleading about how to overcome these > sorts of edmx problems, and no clear answers. I have joined the ranks of the > bewildered and I have corrupted dozens of edmx files attempting to manually > edit them as some suggest. So I'm wondering if I'm actually trying to do the > wrong thing, pushing EF4 to do something it doesn't do due to a > misconception on my part. > > > > Does anyone know how to make a strongly typed custom view and fill it in > EF4? > > > > I'm pleased to see that there are other people posting EF4 questions on the > web and asking things like "why is it so hard?" > > > > Greg
