<?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 : When is InverseProperty required</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2012 : When is InverseProperty required</description>
  <pubDate>Sat, 11 Apr 2026 08:09:12 -700</pubDate>
  <lastBuildDate>Mon, 11 Feb 2013 05:42:53 -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=3987</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>When is InverseProperty required : Thanks Marcel, this is now working.Edited...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3987&amp;PID=15861#15861</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=579" rel="nofollow">gregweb</a><br /><strong>Subject:</strong> 3987<br /><strong>Posted:</strong> 11-Feb-2013 at 5:42am<br /><br />Thanks Marcel, this is now working.<span style="font-size:10px"><br /><br />Edited by gregweb - 13-Feb-2013 at 5:37am</span>]]>
   </description>
   <pubDate>Mon, 11 Feb 2013 05:42:53 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3987&amp;PID=15861#15861</guid>
  </item> 
  <item>
   <title>When is InverseProperty required : The attributes are required if...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3987&amp;PID=15860#15860</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1005" rel="nofollow">mgood</a><br /><strong>Subject:</strong> 3987<br /><strong>Posted:</strong> 09-Feb-2013 at 2:11pm<br /><br />The attributes are required if you don't name things according to EF Code First Conventions and/or don't describe the foreign key&nbsp;relationships&nbsp;using the fluent API. TempHire names everything according to convention, that's why you don't see the ForeignKeyAttribute and InversePropertyAttribute.<div><br></div><div>You can find more on the EF CF conventions at the following link. One thing to watch out for, DevForce requires foreign key properties in addition to the navigation properties, otherwise you gonna get problems. In EF, foreign key properties are optional, but recommended.&nbsp;</div><div><br></div><div>http://msdn.microsoft.com/en-US/data/jj679962&nbsp;</div>]]>
   </description>
   <pubDate>Sat, 09 Feb 2013 14:11:51 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3987&amp;PID=15860#15860</guid>
  </item> 
  <item>
   <title>When is InverseProperty required : I have a code first project with...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3987&amp;PID=15859#15859</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=579" rel="nofollow">gregweb</a><br /><strong>Subject:</strong> 3987<br /><strong>Posted:</strong> 09-Feb-2013 at 12:09pm<br /><br />I have a code first project with a DbInitializer to seed the database.<br /><br />It has three Entities, a Contact, a Rate, and a RateType table.<br /><br />There is one FK relationship between the Rate and the Contact.<br /><br />If I run the project without seeding the data, the tables are created and the FK is created properly.<br /><br />However, if I try to seed the database, when a contact is added an error is thrown which says "Could not set the property/field Rates"  There is an inner exception of Object Ref not set to Instance of Object.<br /><br />Looking in the debug window at the contact when it is being created shows that the Rates property is null.<br /><br />However, if I add the InverseProperty on Rates, then it all works fine.<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#091;DataMember&#093;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#091;InverseProperty("ContactEntity")&#093;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public RelatedEntityList&lt;Rate&gt; Rates { get; internal set; }<br /><br />So I don't get it.  When is InverseProperty required? TempHire doesn't use the property, and I can get it to generate a SQL Server db just fine.<br /><br />Greg]]>
   </description>
   <pubDate>Sat, 09 Feb 2013 12:09:58 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3987&amp;PID=15859#15859</guid>
  </item> 
 </channel>
</rss>