<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" media="screen" href="/styles/xslt/rss.xslt"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:c9="http://channel9.msdn.com">
<channel>
	<title>Channel 9 Forums - Tech Off - Entity Framework Association wants to use child tables primary key as foreign key</title>
	<atom:link rel="self" type="application/rss+xml" href="http://channel9.msdn.com/Forums/rss"></atom:link>
	<image>
		<url>http://mschnlnine.vo.llnwd.net/d1/Dev/App_Themes/C9/images/feedimage.png</url>
		<title>Channel 9 Forums - Tech Off - Entity Framework Association wants to use child tables primary key as foreign key</title>
		<link>http://channel9.msdn.com/Forums</link>
	</image>
	<description>Channel 9 keeps you up to date with the latest news and behind the scenes info from Microsoft that developers love to keep up with. From LINQ to SilverLight – Watch videos and hear about all the cool technologies coming and the people behind them.</description>
	<link>http://channel9.msdn.com/Forums</link>
	<language>en</language>
	<pubDate>Fri, 24 May 2013 22:10:48 GMT</pubDate>
	<lastBuildDate>Fri, 24 May 2013 22:10:48 GMT</lastBuildDate>
	<generator>Rev9</generator>
	<c9:totalResults>4</c9:totalResults>
	<c9:pageCount>-4</c9:pageCount>
	<c9:pageSize>-1</c9:pageSize>
	<item>
		<title>Tech Off - Entity Framework Association wants to use child tables primary key as foreign key</title>
		<description><![CDATA[<p>I have two tables, family_fishing (the parent table) with a key of PROGRAMNUMBER and family_fishing_reg with a key of randomnumber (seriously, I did not design these tables) and a column of programnumber which should be the foreign key.</p><p>ProgramNumber in both tables is NOT NULL. The type in both tables is the same.</p><p>When I bring them into Entity Framework and create an assocation, the association wantd the dependant key to be the randomnumber column, the entity key on the child table. (RandomNumber is a guid.)</p><p>When I double click on the association I can ONLY select randomnumber for the dependant key but this will never relate to family_fishing.PROGRAMNUMBER which is an nvarchar(6). (Yes, a key column as an nvarchar is not my choice either.)</p><p>I have to work with the tables that I have. I'm trying to plug into a database that is not managed by me. I have binged and googled all over and can't seem to understand why this is. The association is looking for a mapping, which also wants to use the randomnumber column. But this should be a typical 1 to many foreign key association.</p><p>What can I try? What can I read? Who can I ask to find an answer to this?</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/Entity-Framework-Association-wants-to-use-child-tables-primary-key-as-foreign-key/5f10f6c973a44b14ae82a02b01040c1d#5f10f6c973a44b14ae82a02b01040c1d</link>
		<pubDate>Fri, 06 Apr 2012 15:46:48 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/Entity-Framework-Association-wants-to-use-child-tables-primary-key-as-foreign-key/5f10f6c973a44b14ae82a02b01040c1d#5f10f6c973a44b14ae82a02b01040c1d</guid>
		<dc:creator>qwert231</dc:creator>
		<slash:comments>4</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/qwert231/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Entity Framework Association wants to use child tables primary key as foreign key</title>
		<description><![CDATA[<p>I take it you've read this <a href="http://msdn.microsoft.com/en-us/library/ee382822.aspx">http&#58;&#47;&#47;msdn.microsoft.com&#47;en-us&#47;library&#47;ee382822.aspx</a> and this <a href="http://msdn.microsoft.com/en-us/library/ee382820.aspx">http&#58;&#47;&#47;msdn.microsoft.com&#47;en-us&#47;library&#47;ee382820.aspx</a>.</p><p>I'd be inclined to scrap that database and do it properly. Having columns called &quot;SomethingNumber&quot; one of which is a Guid and the other nvarchar(6) is so seriously screwed up as to be virtually unworkable. It is certainly a huge barrier to understanding and so to the maintainability of code.</p><p>If it says its a &quot;number&quot; it should be a number, not a code or a GUID and leave you to guess which one.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/Entity-Framework-Association-wants-to-use-child-tables-primary-key-as-foreign-key/8ca8e082274d4deb9714a02d00c733b1#8ca8e082274d4deb9714a02d00c733b1</link>
		<pubDate>Sun, 08 Apr 2012 12:05:16 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/Entity-Framework-Association-wants-to-use-child-tables-primary-key-as-foreign-key/8ca8e082274d4deb9714a02d00c733b1#8ca8e082274d4deb9714a02d00c733b1</guid>
		<dc:creator>Simon Jones</dc:creator>
		<slash:comments>4</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/SimonJ/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Entity Framework Association wants to use child tables primary key as foreign key</title>
		<description><![CDATA[<p><img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-1.gif?v=c9' alt='Smiley' /> Yes...</p><p>However, that would mean, not only writing the system that reads this data, which is the job I'm working on, it would mean re-writing the system that collects the data which is handled by someone else. So, I either fix their mess for double the time, or I try to work with what I've got.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/Entity-Framework-Association-wants-to-use-child-tables-primary-key-as-foreign-key/6aa7f1da7e0743439d98a031013ad40b#6aa7f1da7e0743439d98a031013ad40b</link>
		<pubDate>Thu, 12 Apr 2012 19:06:15 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/Entity-Framework-Association-wants-to-use-child-tables-primary-key-as-foreign-key/6aa7f1da7e0743439d98a031013ad40b#6aa7f1da7e0743439d98a031013ad40b</guid>
		<dc:creator>qwert231</dc:creator>
		<slash:comments>4</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/qwert231/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Entity Framework Association wants to use child tables primary key as foreign key</title>
		<description><![CDATA[<p>Or you write an intermediate system (such as a SSIS package) which translates their mess into something that's actually useable.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/Entity-Framework-Association-wants-to-use-child-tables-primary-key-as-foreign-key/849144a3e85f431da871a034009a6872#849144a3e85f431da871a034009a6872</link>
		<pubDate>Sun, 15 Apr 2012 09:22:10 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/Entity-Framework-Association-wants-to-use-child-tables-primary-key-as-foreign-key/849144a3e85f431da871a034009a6872#849144a3e85f431da871a034009a6872</guid>
		<dc:creator>Simon Jones</dc:creator>
		<slash:comments>4</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/SimonJ/Discussions/RSS</wfw:commentRss>
	</item>
</channel>
</rss>