<p>Has anyone actually shipped an Entity Framework project that does O/R mapping into conceptual classes that are quite different from the tables in the datastore?</p>

<p>I mean collapse junction (M:M) tables into other entities to form <strong>Conceptual</strong> classes that exist in the business domain but are organized as <strong>multiple tables</strong> in the datastore. All the examples that I see on the MSDN have little use of inheritance, collapsing junction tables into other entities, or collapsing lookup tables into entities.</p>

<p>I'd love to hear of or see examples of the below which support all the CRUD operations you would typically expect to do on a business object.:</p>

<ol>
<li><p>Vehicle table and a Color table. A Color can appear in many Vehicles (1:M). They form  the conceptual class UsedCar which has the property Color.  </p></li>
<li><p>Doctor, DoctorPatients, and Patients tables (form a many to many). Doctors have many Patients, Patients can have many Doctors (M:M). Map out the two conceptual classes Doctor (which has a Patients collection) and Patients (which has a Doctors collection).</p></li>
</ol>

<p><strong>Anyone seen/done this with CSDL AND SSDL in the Entity Framework? The CSDL is no good if it doesn't actaully map to anything!</strong></p>

[{'answer_id': 58137, 'author': 'Ant', 'author_id': 3709, 'author_profile': 'https://Stackoverflow.com/users/3709', 'pm_score': 4, 'selected': True, 'text': '<p>I attempted to use the Entity Framework on an existing project (~60 tables, 3 with inheritance) just to see what it was all about. My experience boiled down to:</p>\n\n<p>The designer surface is kludgy. The mapping isn’t intuitive and someone must have thought that having several tool windows open at the same time is acceptable. It took a long time to manually create an object and map the right fields – then it was still odd talking to it from the code. While having something handling the database communication is essential, <em>I feel that handing the control over to EF was far more of a fight than doing it manually</em>.</p>\n\n<p>Sometimes the designer just doesn’t load until you restart Visual Studio. I’m sure it’s just a bug but restarting VS is annoying.</p>\n\n<p>All your work ends up in a single file, I’d hate to merge multiple developer editions.</p>\n\n<p>The resultant SQL (watched via the Profiler) wasn’t very good. I didn’t really delve into looking why, but you’d be pressed to write something worse on a first attempt.</p>\n'}, {'answer_id': 58181, 'author': 'Mark Cidade', 'author_id': 1659, 'author_profile': 'https://Stackoverflow.com/users/1659', 'pm_score': 2, 'selected': False, 'text': '<p>You mean like this?</p>\n\n<pre><code>&lt;edmx:ConceptualModels&gt;\n  &lt;Schema xmlns="http://schemas.microsoft.com/ado/2006/04/edm" Namespace="Model1" Alias="Self"&gt;\n    &lt;EntityContainer Name="Model1Container" &gt;\n      &lt;EntitySet Name="ColorSet" EntityType="Model1.Color" /&gt;\n      &lt;EntitySet Name="DoctorSet" EntityType="Model1.Doctor" /&gt;\n      &lt;EntitySet Name="PatientSet" EntityType="Model1.Patient" /&gt;\n      &lt;EntitySet Name="UsedCarSet" EntityType="Model1.UsedCar" /&gt;\n      &lt;AssociationSet Name="Vehicle_Color" Association="Model1.Vehicle_Color"&gt;\n        &lt;End Role="Colors" EntitySet="ColorSet" /&gt;\n        &lt;End Role="Vehicles" EntitySet="UsedCarSet" /&gt;&lt;/AssociationSet&gt;\n      &lt;AssociationSet Name="DoctorPatient" Association="Model1.DoctorPatient"&gt;\n        &lt;End Role="Doctor" EntitySet="DoctorSet" /&gt;\n        &lt;End Role="Patient" EntitySet="PatientSet" /&gt;&lt;/AssociationSet&gt;\n      &lt;/EntityContainer&gt;\n    &lt;EntityType Name="Color"&gt;\n      &lt;Key&gt;\n        &lt;PropertyRef Name="ColorID" /&gt;&lt;/Key&gt;\n      &lt;Property Name="ColorID" Type="Int32" Nullable="false" /&gt;\n      &lt;NavigationProperty Name="Vehicles" Relationship="Model1.Vehicle_Color" FromRole="Colors" ToRole="Vehicles" /&gt;&lt;/EntityType&gt;\n    &lt;EntityType Name="Doctor"&gt;\n      &lt;Key&gt;\n        &lt;PropertyRef Name="DoctorID" /&gt;&lt;/Key&gt;\n      &lt;Property Name="DoctorID" Type="Int32" Nullable="false" /&gt;\n      &lt;NavigationProperty Name="Patients" Relationship="Model1.DoctorPatient" FromRole="Doctor" ToRole="Patient" /&gt;&lt;/EntityType&gt;\n    &lt;EntityType Name="Patient"&gt;\n      &lt;Key&gt;\n        &lt;PropertyRef Name="PatientID" /&gt;&lt;/Key&gt;\n      &lt;Property Name="PatientID" Type="Int32" Nullable="false" /&gt;\n      &lt;NavigationProperty Name="Doctors" Relationship="Model1.DoctorPatient" FromRole="Patient" ToRole="Doctor" /&gt;\n      &lt;/EntityType&gt;\n    &lt;EntityType Name="UsedCar"&gt;\n      &lt;Key&gt;\n        &lt;PropertyRef Name="VehicleID" /&gt;&lt;/Key&gt;\n      &lt;Property Name="VehicleID" Type="Int32" Nullable="false" /&gt;\n      &lt;NavigationProperty Name="Color" Relationship="Model1.Vehicle_Color" FromRole="Vehicles" ToRole="Colors" /&gt;&lt;/EntityType&gt;\n    &lt;Association Name="Vehicle_Color"&gt;\n      &lt;End Type="Model1.Color" Role="Colors" Multiplicity="1" /&gt;\n      &lt;End Type="Model1.UsedCar" Role="Vehicles" Multiplicity="*" /&gt;&lt;/Association&gt;\n    &lt;Association Name="DoctorPatient"&gt;\n      &lt;End Type="Model1.Doctor" Role="Doctor" Multiplicity="*" /&gt;\n      &lt;End Type="Model1.Patient" Role="Patient" Multiplicity="*" /&gt;&lt;/Association&gt;\n    &lt;/Schema&gt;\n&lt;/edmx:ConceptualModels&gt;\n</code></pre>\n'}, {'answer_id': 89147, 'author': 'Vyrotek', 'author_id': 10941, 'author_profile': 'https://Stackoverflow.com/users/10941', 'pm_score': 2, 'selected': False, 'text': '<p><a href="http://efvote.wufoo.com/forms/ado-net-entity-framework-vote-of-no-confidence/" rel="nofollow noreferrer">Entity Framework - Vote of no confidence</a></p>\n\n<p>That\'s all I have to say...</p>\n'}]
['https://Stackoverflow.com/questions/57718', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5642/']