<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="http://syndication.webwiz.co.uk/rss_namespace/">
 <channel>
  <title>DevForce Community Forum : Still need foreign key properties in CodeFirst?</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2010 : Still need foreign key properties in CodeFirst?</description>
  <pubDate>Sun, 12 Apr 2026 22:20:04 -700</pubDate>
  <lastBuildDate>Mon, 17 Oct 2011 13:08:51 -700</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 9.69</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>www.ideablade.com/forum/RSS_post_feed.asp?TID=3014</WebWizForums:feedURL>
  <image>
   <title>DevForce Community Forum</title>
   <url>http://www.ideablade.com/forum/forum_images/IdeaBlade_logo_tm.png</url>
   <link>http://www.ideablade.com/forum/</link>
  </image>
  <item>
   <title>Still need foreign key properties in CodeFirst? : Thank you!   </title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3014&amp;PID=11843#11843</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1093" rel="nofollow">s_tristan</a><br /><strong>Subject:</strong> 3014<br /><strong>Posted:</strong> 17-Oct-2011 at 1:08pm<br /><br />Thank you!<br>]]>
   </description>
   <pubDate>Mon, 17 Oct 2011 13:08:51 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3014&amp;PID=11843#11843</guid>
  </item> 
  <item>
   <title>Still need foreign key properties in CodeFirst? : Yes, you can omit the fk property...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3014&amp;PID=11842#11842</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=912" rel="nofollow">DenisK</a><br /><strong>Subject:</strong> 3014<br /><strong>Posted:</strong> 17-Oct-2011 at 1:06pm<br /><br />Yes, you can omit the fk property if you have specify the fluent mapping. What EF Code First will do behind the scene is generate a Parent_ParentId field on the db table.]]>
   </description>
   <pubDate>Mon, 17 Oct 2011 13:06:38 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3014&amp;PID=11842#11842</guid>
  </item> 
  <item>
   <title>Still need foreign key properties in CodeFirst? : publicclassParent { publicRe...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3014&amp;PID=11841#11841</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1093" rel="nofollow">s_tristan</a><br /><strong>Subject:</strong> 3014<br /><strong>Posted:</strong> 17-Oct-2011 at 12:31pm<br /><br /><pre style="font-family:C&#111;nsolas;font-size:13;color:black;:white;"><span style="color:blue;">    public</span>&nbsp;<span style="color:blue;">class</span>&nbsp;<span style="color:#2b91af;">Parent</span>&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:blue;">public</span>&nbsp;<span style="color:#2b91af;">RelatedEntityList</span>&lt;<span style="color:#2b91af;">Child</span>&gt;&nbsp;Children&nbsp;{&nbsp;<span style="color:blue;">get</span>;&nbsp;<span style="color:blue;">set</span>;&nbsp;}&nbsp;&nbsp;&nbsp;&nbsp;} &nbsp;&nbsp;&nbsp;&nbsp;<span style="color:blue;">public</span>&nbsp;<span style="color:blue;">class</span>&nbsp;<span style="color:#2b91af;">Child</span>&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:blue;">public</span>&nbsp;<span style="color:#2b91af;">Parent</span>&nbsp;Parent&nbsp;{&nbsp;<span style="color:blue;">get</span>;&nbsp;<span style="color:blue;">set</span>;&nbsp;}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:blue;">public</span>&nbsp;<span style="color:blue;">int</span>&nbsp;ParentId&nbsp;{&nbsp;<span style="color:blue;">get</span>;&nbsp;<span style="color:blue;">set</span>;&nbsp;}&nbsp;<span style="color:green;">//&nbsp;can&nbsp;we&nbsp;omit&nbsp;this&nbsp;"buddy"&nbsp;property&nbsp;according&nbsp;this&nbsp;blog&nbsp;post</span> http://msdn.microsoft.com/en-us/data/hh134698&nbsp;&nbsp;&nbsp; } &nbsp;&nbsp;&nbsp;&nbsp;<span style="color:blue;">public</span>&nbsp;<span style="color:blue;">class</span>&nbsp;<span style="color:#2b91af;">MyDbContext</span>&nbsp;:&nbsp;<span style="color:red;">DbContext</span>&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:blue;">protected</span>&nbsp;<span style="color:blue;">override</span>&nbsp;<span style="color:blue;">void</span>&nbsp;OnModelCreating(<span style="color:red;">DbModelBuilder</span>&nbsp;modelBuilder)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;modelBuilder.<span style="color:red;">Entity</span>&lt;<span style="color:#2b91af;">Parent</span>&gt;().HasMany(parent&nbsp;=&gt;&nbsp;parent.<span style="color:red;">Children</span>).WithRequired(child&nbsp;=&gt;&nbsp;child.<span style="color:red;">Parent</span>);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;&nbsp;&nbsp;}</pre>]]>
   </description>
   <pubDate>Mon, 17 Oct 2011 12:31:48 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3014&amp;PID=11841#11841</guid>
  </item> 
  <item>
   <title>Still need foreign key properties in CodeFirst? : Hi s_tristan;What do you mean...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3014&amp;PID=11840#11840</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=912" rel="nofollow">DenisK</a><br /><strong>Subject:</strong> 3014<br /><strong>Posted:</strong> 17-Oct-2011 at 12:14pm<br /><br />Hi s_tristan;<div><br></div><div>What do you mean by using "fk properties"? Do you mean using the ForeignKeyAttribute?</div>]]>
   </description>
   <pubDate>Mon, 17 Oct 2011 12:14:23 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3014&amp;PID=11840#11840</guid>
  </item> 
  <item>
   <title>Still need foreign key properties in CodeFirst? : In Code First DbContect we can...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3014&amp;PID=11830#11830</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1093" rel="nofollow">s_tristan</a><br /><strong>Subject:</strong> 3014<br /><strong>Posted:</strong> 15-Oct-2011 at 11:35am<br /><br />In Code First DbContect we can simply avoid using fk properties with that fluent mapping:<br><pre style="font-family:C&#111;nsolas;font-size:13;color:black;:white;">modelBuilder.<span style="color:red;">Entity</span>&lt;<span style="color:#2b91af;">Parent</span>&gt;().HasMany(parent=&gt;parent.Children).WithRequired(child=&gt;child.Parent);<br><br>Is this enough or DevForce needs this fk properties for it's internal infrastructure? Are additional benefits of using fk properties present?<br></pre>]]>
   </description>
   <pubDate>Sat, 15 Oct 2011 11:35:35 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3014&amp;PID=11830#11830</guid>
  </item> 
 </channel>
</rss>