<?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 : NavigationEntityProperty and foreign key relationships</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2010 : NavigationEntityProperty and foreign key relationships</description>
  <pubDate>Wed, 15 Apr 2026 14:00:21 -700</pubDate>
  <lastBuildDate>Wed, 28 Sep 2011 19:43:16 -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=2737</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>NavigationEntityProperty and foreign key relationships : That works nicely - Thanks! </title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2737&amp;PID=11735#11735</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=705" rel="nofollow">chuckc</a><br /><strong>Subject:</strong> 2737<br /><strong>Posted:</strong> 28-Sep-2011 at 7:43pm<br /><br />That works nicely - Thanks!]]>
   </description>
   <pubDate>Wed, 28 Sep 2011 19:43:16 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2737&amp;PID=11735#11735</guid>
  </item> 
  <item>
   <title>NavigationEntityProperty and foreign key relationships : Hi Chuck,Now you don&amp;#039;t need...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2737&amp;PID=11733#11733</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=892" rel="nofollow">sbelini</a><br /><strong>Subject:</strong> 2737<br /><strong>Posted:</strong> 28-Sep-2011 at 6:23pm<br /><br />Hi Chuck,&nbsp;<div><br></div><div>Now you don't need to use reflection to get RelatedNavigationPropertyName.</div><div><br></div><div>So, in the GetFkProp method, instead of using:</div><div><br></div><div><span ="Apple-style-span" style=": rgb251, 251, 253; "><div><font size="2" face="C&#111;nsolas"><font color="#0000ff"><font color="#0000ff"><font color="#0000ff">&nbsp; &nbsp; &nbsp;var</font></font></font>&nbsp;result = fkProps.FirstOrDefault(fkProp =&gt;</font></div><div><font size="2" face="C&#111;nsolas"><font color="#2b91af"><font color="#2b91af"><font color="#2b91af">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ReflectionFns</font></font></font>.GetAttribute&lt;<font color="#2b91af"><font color="#2b91af"><font color="#2b91af">ForeignKeyAttribute</font></font></font>&gt;(fkProp.PropertyInfo)</font><font size="2" face="C&#111;nsolas">.RelatedNavigationPropertyName == np.Name);</font></div></span></div><div><br></div><div>you'd use:</div><div><br></div><div><span ="Apple-style-span" style="font-family: C&#111;nsolas; line-height: 18px; : rgb251, 251, 253; font-size: small; "><font color="#0000ff"><font color="#0000ff"><font color="#0000ff">var</font></font></font>&nbsp;result = fkProps.FirstOrDefault(fkProp =&gt;&nbsp;</span><span ="Apple-style-span" style=": rgb251, 251, 253; "><font size="2" face="C&#111;nsolas">fkProp</font><font size="2" face="C&#111;nsolas">.RelatedNavigationPropertyName == np.Name);</font></span></div><div><br></div><div>Regards,</div><div>&nbsp; &nbsp;Silvio.</div><div><br></div>]]>
   </description>
   <pubDate>Wed, 28 Sep 2011 18:23:09 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2737&amp;PID=11733#11733</guid>
  </item> 
  <item>
   <title>NavigationEntityProperty and foreign key relationships : I see that the ForeignKeyAttribute...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2737&amp;PID=11703#11703</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=705" rel="nofollow">chuckc</a><br /><strong>Subject:</strong> 2737<br /><strong>Posted:</strong> 25-Sep-2011 at 7:29pm<br /><br />I see that the ForeignKeyAttribute has been removed in release 6.1.2 which breaks the solution you had provided above. &nbsp;I am using that technique quite extensively in my live application. &nbsp;<div><br></div><div>What is the recommended technique for getting a foreign key property value now?<div><br></div><div>Thanks.</div></div>]]>
   </description>
   <pubDate>Sun, 25 Sep 2011 19:29:08 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2737&amp;PID=11703#11703</guid>
  </item> 
  <item>
   <title>NavigationEntityProperty and foreign key relationships : Thanks, that was just what I needed....</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2737&amp;PID=10887#10887</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=705" rel="nofollow">chuckc</a><br /><strong>Subject:</strong> 2737<br /><strong>Posted:</strong> 02-Jun-2011 at 11:03pm<br /><br />Thanks, that was just what I needed. &nbsp;I would have spent a long time trying to figure out how to duplicate your GetFkProp() method!<div><br></div><div>As for a use case, I'm using this to build a general purpose display for changes recorded in "ghost" audit tables. &nbsp;The ghost tables are the same structure as their corresponding "live" table with a few extra tracking fields. &nbsp;Displaying changes to data properties from one ghost record to the next is no problem, but for changes of child object properties linked to other table/classes I want to show something other than the foreign key linking Guid. &nbsp;I am now looking up the corresponding record from the child table/object and displaying that instead of the Guid.</div><div><br></div><div>If you'd like more info, feel free to contact me via email.</div><div><br></div><div>Thanks again.</div>]]>
   </description>
   <pubDate>Thu, 02 Jun 2011 23:03:31 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2737&amp;PID=10887#10887</guid>
  </item> 
  <item>
   <title>NavigationEntityProperty and foreign key relationships :    Hi chuckc, Getting the type...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2737&amp;PID=10886#10886</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=892" rel="nofollow">sbelini</a><br /><strong>Subject:</strong> 2737<br /><strong>Posted:</strong> 02-Jun-2011 at 4:22pm<br /><br />Hi chuckc,<div> </div><div>Getting the type of the child entity is fairly simple:</div><div>&nbsp;</div><div> </div><div><font color="#0000ff" size="2" face="C&#111;nsolas"><font color="#0000ff" size="2" face="C&#111;nsolas"><font color="#0000ff" size="2" face="C&#111;nsolas"> &nbsp;&nbsp; var</font></font></font><font size="2" face="C&#111;nsolas"><font size="2" face="C&#111;nsolas"> np = aPerson.EntityAspect.GetNavigationProperty(</font></font><font color="#a31515" size="2" face="C&#111;nsolas"><font color="#a31515" size="2" face="C&#111;nsolas"><font color="#a31515" size="2" face="C&#111;nsolas">"Gender"</font></font></font><font size="2" face="C&#111;nsolas"><font size="2" face="C&#111;nsolas">).RelationLink.ToNavigationEntityProperty;</font></font></div><div><font size="2" face="C&#111;nsolas"></font> </div><div><font color="#2b91af" size="2" face="C&#111;nsolas"><font color="#2b91af" size="2" face="C&#111;nsolas"><font color="#2b91af" size="2" face="C&#111;nsolas"> &nbsp;&nbsp; Type</font></font></font><font size="2" face="C&#111;nsolas"><font size="2" face="C&#111;nsolas"> navPropertyEntityType = np.RelationLink.ToRole.EntityType; <font color="#008000" size="2" face="C&#111;nsolas"><font color="#008000" size="2" face="C&#111;nsolas"><font color="#008000" size="2" face="C&#111;nsolas">// type is Gender</font></font></font></font></font></div><div><font color="#008000" size="2" face="C&#111;nsolas"></font> </div><div> </div><div>&nbsp;</div><div>As for getting the FK value, you will need to first get the DataEntityProperty that corresponds to the FK and then get its value:</div><div>&nbsp;</div><div> </div><div><font color="#0000ff" size="2" face="C&#111;nsolas"><font color="#0000ff" size="2" face="C&#111;nsolas"><font color="#0000ff" size="2" face="C&#111;nsolas"><font color="#2b91af" size="2" face="C&#111;nsolas"><font color="#2b91af" size="2" face="C&#111;nsolas"><font color="#2b91af" size="2" face="C&#111;nsolas"> &nbsp;&nbsp; Guid </font></font></font><font size="2" face="C&#111;nsolas"><font size="2" face="C&#111;nsolas">fkId = (</font></font><font color="#2b91af" size="2" face="C&#111;nsolas"><font color="#2b91af" size="2" face="C&#111;nsolas"><font color="#2b91af" size="2" face="C&#111;nsolas">Guid</font></font></font><font size="2" face="C&#111;nsolas"><font size="2" face="C&#111;nsolas">)<font color="#000000">aPerson</font>.EntityAspect.GetValue(GetFkProp(np).Name);</font></font></font></font></font></div><div><font size="2" face="C&#111;nsolas"><font size="2" face="C&#111;nsolas"><font size="2" face="C&#111;nsolas"> &nbsp;&nbsp; .</font></font></font></div><div><font size="2" face="C&#111;nsolas"> &nbsp;&nbsp; .</font></div><div><font size="2" face="C&#111;nsolas"> &nbsp;&nbsp; .</font></div><div><font color="#0000ff" size="2" face="C&#111;nsolas"><font color="#0000ff" size="2" face="C&#111;nsolas"><font color="#0000ff" size="2" face="C&#111;nsolas"> &nbsp;&nbsp; public</font></font></font><font size="2" face="C&#111;nsolas"><font size="2" face="C&#111;nsolas"> </font></font><font color="#2b91af" size="2" face="C&#111;nsolas"><font color="#2b91af" size="2" face="C&#111;nsolas"><font color="#2b91af" size="2" face="C&#111;nsolas">DataEntityProperty</font></font></font><font size="2" face="C&#111;nsolas"><font size="2" face="C&#111;nsolas"> GetFkProp(</font></font><font color="#2b91af" size="2" face="C&#111;nsolas"><font color="#2b91af" size="2" face="C&#111;nsolas"><font color="#2b91af" size="2" face="C&#111;nsolas">NavigationEntityProperty</font></font></font><font size="2" face="C&#111;nsolas"><font size="2" face="C&#111;nsolas"> np) {</font></font></div><div><font size="2" face="C&#111;nsolas">   </font><font color="#0000ff" size="2" face="C&#111;nsolas"><font color="#0000ff" size="2" face="C&#111;nsolas"><font color="#0000ff" size="2" face="C&#111;nsolas">&nbsp;&nbsp;&nbsp;&nbsp; var</font></font></font><font size="2" face="C&#111;nsolas"><font size="2" face="C&#111;nsolas"> fkProps = </font></font><font color="#2b91af" size="2" face="C&#111;nsolas"><font color="#2b91af" size="2" face="C&#111;nsolas"><font color="#2b91af" size="2" face="C&#111;nsolas">EntityMetadataStore</font></font></font><font size="2" face="C&#111;nsolas"><font size="2" face="C&#111;nsolas">.Instance.GetEntityMetadata(np.EntityType).ForeignKeyProperties;</font></font></div><div><font size="2" face="C&#111;nsolas">   <font color="#0000ff"><font color="#0000ff"><font color="#0000ff">&nbsp;&nbsp;&nbsp;&nbsp; var</font></font></font> result = fkProps.FirstOrDefault(fkProp =&gt;</font></div><div><font size="2" face="C&#111;nsolas">     <font color="#2b91af"><font color="#2b91af"><font color="#2b91af">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ReflectionFns</font></font></font>.GetAttribute&lt;<font color="#2b91af"><font color="#2b91af"><font color="#2b91af">ForeignKeyAttribute</font></font></font>&gt;(fkProp.PropertyInfo)</font><font size="2" face="C&#111;nsolas">.RelatedNavigationPropertyName == np.Name);</font></div><div><font size="2" face="C&#111;nsolas">   &nbsp;&nbsp;&nbsp;&nbsp; <font color="#0000ff"><font color="#0000ff"><font color="#0000ff">return</font></font></font> result;</font></div><div><font size="2" face="C&#111;nsolas"> &nbsp;&nbsp; }</font></div><div><div> </div><div>&nbsp;</div><div>I hope this helps.</div><div> </div><div>&nbsp;</div><div>Could you share with us what your use case is? It's worth knowing it and this might be a good candidate for a feature in the product.</div><div> </div><div>&nbsp;</div><div>Regards, </div><div>  &nbsp;&nbsp;&nbsp; Silvio.</div></div><div> </div><div> </div><div> </div><span style="font-size:10px"><br /><br />Edited by sbelini - 02-Jun-2011 at 4:23pm</span>]]>
   </description>
   <pubDate>Thu, 02 Jun 2011 16:22:42 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2737&amp;PID=10886#10886</guid>
  </item> 
  <item>
   <title>NavigationEntityProperty and foreign key relationships : Hi Silvio,Thanks for the reply,...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2737&amp;PID=10885#10885</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=705" rel="nofollow">chuckc</a><br /><strong>Subject:</strong> 2737<br /><strong>Posted:</strong> 02-Jun-2011 at 11:15am<br /><br />Hi Silvio,<div><br></div><div>Thanks for the reply, but I could use a bit more information. &nbsp;To re-state my question:</div><div><div><br></div><div>Example:</div><div>Given a Person class/table and a Gender class/table.</div><div>The Person class has a GenderId Guid field and a corresponding Gender object property.</div><div>The Gender class/table has a Guid primary key of GenderId</div><div><br></div><div>Starting from a DataEntityProperty (or maybe a NavigationEntityProperty) from the Person metadata for the Gender object property,&nbsp;how can I find:</div><div><br></div><div>1) The Type/table name of the child property ("Gender" in this example)</div><div>2) The property of the gender key on the Person object ("GenderId" in this example)</div><div><br></div><div>Here is the start of the code I am attempting to get working, with the areas I'm looking for some help with indicated.</div></div><div><br></div><div><pre style="font-family: C&#111;nsolas; font-size: 13px; -: initial; -attachment: initial; -origin: initial; -clip: initial; : white; -: initial initial; -repeat: initial initial; "><span ="Apple-style-span" style="color: black; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:blue;">private</span>&nbsp;<span style="color:blue;">static</span>&nbsp;<span style="color:#2b91af;">Entity</span>&nbsp;Example_GetScalarNavigationEntity(<span style="color:#2b91af;">Entity</span>&nbsp;sourceEntity,&nbsp;</span><span style="color:#2b91af;">Entity</span>&nbsp;journalEntity,&nbsp;<span ="Apple-style-span" style="color: rgb43, 145, 175; ">NavigationEntityProperty</span>&nbsp;np)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{</pre><pre style="font-family: C&#111;nsolas; font-size: 13px; -: initial; -attachment: initial; -origin: initial; -clip: initial; : white; -: initial initial; -repeat: initial initial; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: rgb43, 145, 175; ">Entity</span>&nbsp;navEntity&nbsp;=&nbsp;<span style="color: blue; ">null</span>;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: rgb43, 145, 175; ">iCatalystEntityManager</span>&nbsp;mgr&nbsp;=&nbsp;<span style="color: rgb43, 145, 175; ">iCatalystEntityManager</span>.DefaultManager;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font ="Apple-style-span" color="#ff0000"><b>&nbsp;Type&nbsp;navPropertyType;&nbsp;//&nbsp;=&nbsp; np.RelationLink.EntityRelation...??&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Guid&nbsp;parentPropertyKey;&nbsp;//&nbsp;=&nbsp;<span ="Apple-style-span" style="line-height: 16px; font-weight: normal; "><b>np.RelationLink.EntityRelation.ToRole2Link...??</b></span></b></font> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: rgb43, 145, 175; ">QueryParameter</span>&nbsp;param&nbsp;=&nbsp;<span style="color: blue; ">new</span>&nbsp;<span style="color: rgb43, 145, 175; ">QueryParameter</span>(<span style="color: rgb163, 21, 21; ">"pkey"</span>,&nbsp;parentPropertyKey);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue; ">string</span>&nbsp;querySQL&nbsp;=&nbsp;<span style="color: blue; ">string</span>.Format(<span style="color: rgb163, 21, 21; ">"SELECT&nbsp;VALUE&nbsp;jnl&nbsp;FROM&nbsp;{0}&nbsp;as&nbsp;jnl&nbsp;Where&nbsp;jnl.{1}&nbsp;=&nbsp;@pkey"</span>,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;navPropertyType.Name,&nbsp;np.Name); &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: rgb43, 145, 175; ">ParameterizedEsql</span>&nbsp;paramEsql&nbsp;=&nbsp;<span style="color: blue; ">new</span>&nbsp;<span style="color: rgb43, 145, 175; ">ParameterizedEsql</span>(querySQL,&nbsp;param); &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: rgb43, 145, 175; ">PassthruEsqlQuery</span>&nbsp;q&nbsp;=&nbsp;<span style="color: blue; ">new</span>&nbsp;<span style="color: rgb43, 145, 175; ">PassthruEsqlQuery</span>(navPropertyType); </pre><pre style="font-family: C&#111;nsolas; font-size: 13px; -: initial; -attachment: initial; -origin: initial; -clip: initial; : white; -: initial initial; -repeat: initial initial; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: rgb43, 145, 175; ">IEnumerator</span>&nbsp;e&nbsp;=&nbsp;mgr.ExecuteQuery(q).GetEnumerator();&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;e.MoveNext();&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;navEntity&nbsp;=&nbsp;e.Current&nbsp;<span style="color: blue; ">as</span>&nbsp;<span style="color: rgb43, 145, 175; ">Entity</span>; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue; ">return</span>&nbsp;navEntity;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;</pre><pre style="font-family: C&#111;nsolas; font-size: 13px; -: initial; -attachment: initial; -origin: initial; -clip: initial; : white; -: initial initial; -repeat: initial initial; "><span ="Apple-style-span" style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; line-height: 16px; white-space: normal; "></span></pre><pre style="font-family: C&#111;nsolas; font-size: 13px; -: initial; -attachment: initial; -origin: initial; -clip: initial; : white; -: initial initial; -repeat: initial initial; "><span ="Apple-style-span" style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; line-height: 16px; white-space: normal; ">The wealth of properties available on EntityRelation are a bit confusing and complex.</span></pre><pre style="font-family: C&#111;nsolas; font-size: 13px; -: initial; -attachment: initial; -origin: initial; -clip: initial; : white; -: initial initial; -repeat: initial initial; "><span ="Apple-style-span" style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; line-height: 16px; white-space: normal; ">Thanks for your help!</span></pre><pre style="-: initial; -attachment: initial; -origin: initial; -clip: initial; : white; -: initial initial; -repeat: initial initial; "><font ="Apple-style-span" face="Verdana, Arial, Helvetica, sans-serif"><span ="Apple-style-span" style="white-space: normal;"><br></span></font></pre></div>]]>
   </description>
   <pubDate>Thu, 02 Jun 2011 11:15:46 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2737&amp;PID=10885#10885</guid>
  </item> 
  <item>
   <title>NavigationEntityProperty and foreign key relationships :   Hi chuckc,I believe you are...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2737&amp;PID=10878#10878</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=892" rel="nofollow">sbelini</a><br /><strong>Subject:</strong> 2737<br /><strong>Posted:</strong> 01-Jun-2011 at 10:04pm<br /><br />Hi chuckc,<div>&nbsp;</div><div>I believe you are looking for the :</div><div>&nbsp;</div><div><font color="#0000ff" size="2" face="C&#111;nsolas"><font color="#0000ff" size="2" face="C&#111;nsolas"><font color="#0000ff" size="2" face="C&#111;nsolas">var </font></font></font><font size="2" face="C&#111;nsolas"><font size="2" face="C&#111;nsolas">entityRelation = myPerson.EntityAspect.GetNavigationProperty(</font></font><font color="#a31515" size="2" face="C&#111;nsolas"><font color="#a31515" size="2" face="C&#111;nsolas"><font color="#a31515" size="2" face="C&#111;nsolas">"Gender"</font></font></font><font size="2" face="C&#111;nsolas"><font size="2" face="C&#111;nsolas">).RelationLink.EntityRelation;</font></font></div><div>&nbsp;</div><div>Let me know if that's what you are looking for.</div><div>&nbsp;</div><div>Silvio.</div>]]>
   </description>
   <pubDate>Wed, 01 Jun 2011 22:04:13 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2737&amp;PID=10878#10878</guid>
  </item> 
  <item>
   <title>NavigationEntityProperty and foreign key relationships : Given a NavigationEntityProperty...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2737&amp;PID=10873#10873</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=705" rel="nofollow">chuckc</a><br /><strong>Subject:</strong> 2737<br /><strong>Posted:</strong> 01-Jun-2011 at 12:23pm<br /><br /><div>Given a NavigationEntityProperty how can one determine the foreign key relationship between the parent Entity and a child Entity?</div><div><br></div><div>For example, assume a Person table/entity with a GenderId field/property that maps to a GenderId field in a Gender table. &nbsp;How can one extract that information from a NavigationEntityProperty? &nbsp;It appears to be there, but the syntax for getting to it eludes me.</div><div><br></div><div>The reason I'm looking for this information is to support an audit system that uses "ghost" tables to store audit history.</div><div><br></div><div>Thanks</div>]]>
   </description>
   <pubDate>Wed, 01 Jun 2011 12:23:57 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2737&amp;PID=10873#10873</guid>
  </item> 
 </channel>
</rss>