<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Mapping two Tables to one Entity in the Entity Framework </title><link>http://blogs.msdn.com/ukadc/archive/2009/07/07/mapping-two-tables-to-one-entity-in-the-entity-framework.aspx</link><description>Whilst at Q-Con a few weeks ago someone asked me about how to map two database tables to one entity in the Entity Framework... something a lot of people want to do at some point or another. At this point I must thank Chris Barker for pinging me some links</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: Mapping two Tables to one Entity in the Entity Framework </title><link>http://blogs.msdn.com/ukadc/archive/2009/07/07/mapping-two-tables-to-one-entity-in-the-entity-framework.aspx#9823348</link><pubDate>Wed, 08 Jul 2009 04:31:27 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9823348</guid><dc:creator>Orsa</dc:creator><description>&lt;p&gt;Simon,&lt;/p&gt;
&lt;p&gt;can the same thing be done without cutting the properties and deleting CutomerAddress?&lt;/p&gt;
&lt;p&gt;Or by creating a new Entity (CustomerWithAddress) that will have the following properties&lt;/p&gt;
&lt;p&gt;ID&lt;/p&gt;
&lt;p&gt;Name&lt;/p&gt;
&lt;p&gt;Line1&lt;/p&gt;
&lt;p&gt;Line2&lt;/p&gt;
&lt;p&gt;PostCode&lt;/p&gt;
&lt;p&gt;I am trying to fnd an example for that with no luck&lt;/p&gt;</description></item><item><title>re: Mapping two Tables to one Entity in the Entity Framework </title><link>http://blogs.msdn.com/ukadc/archive/2009/07/07/mapping-two-tables-to-one-entity-in-the-entity-framework.aspx#9833985</link><pubDate>Wed, 15 Jul 2009 11:23:54 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9833985</guid><dc:creator>ukadc</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I’m not certain I understand what you’re trying to achieve, but basically all this is doing is;&lt;/p&gt;
&lt;p&gt;a)	Making sure the storage definitions of the two tables is in the EDMX file, &lt;/p&gt;
&lt;p&gt;b)	Editing the conceptual definitions so that there is a single entity, and finally&lt;/p&gt;
&lt;p&gt;c)	Editing the mapping to connect the new conceptual definition to the existing tables in the storage space&lt;/p&gt;
&lt;p&gt;So if you went through this walkthrough and looked at the XML in the EDMX file this should give you a starting point. Chances are you can do a lot of this by hand if you don’t like the GUI approach.&lt;/p&gt;
&lt;p&gt;Does that help?&lt;/p&gt;
&lt;p&gt;Simon &lt;/p&gt;
</description></item></channel></rss>