<?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 : Two entities using the same database table</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2010 : Two entities using the same database table</description>
  <pubDate>Sat, 11 Apr 2026 11:22:16 -700</pubDate>
  <lastBuildDate>Tue, 13 Jul 2010 07:46:09 -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=1894</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>Two entities using the same database table : For anyone who is intressed. De...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1894&amp;PID=7606#7606</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=816" rel="nofollow">Peter</a><br /><strong>Subject:</strong> 1894<br /><strong>Posted:</strong> 13-Jul-2010 at 7:46am<br /><br /><P>For anyone who is intressed.</P><DIV>De EF inheritance type TPH is working in this situation, as I described before.</DIV><DIV>The problem was (still is), that not in all cases&nbsp;the Visual Studio 2010 IDE correctly updated my EDMX file.</DIV><DIV>When I deleted an, automatic generated assiocation, the XML tag&nbsp;was not deleted in&nbsp; the EDMX file.</DIV><DIV>I had to do it by manually.</DIV><DIV>I've read about this&nbsp;on the internet but I'm not sure if this is a bug or a local problem.</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Tue, 13 Jul 2010 07:46:09 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1894&amp;PID=7606#7606</guid>
  </item> 
  <item>
   <title>Two entities using the same database table : Hi Peter,    Yes, I forgot...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1894&amp;PID=7381#7381</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=477" rel="nofollow">ting</a><br /><strong>Subject:</strong> 1894<br /><strong>Posted:</strong> 22-Jun-2010 at 7:58pm<br /><br />Hi Peter,<DIV></DIV><DIV></DIV><DIV>&nbsp;</DIV><DIV>Yes, I forgot about that possibility.&nbsp; That's seems like a reasonable approach.</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Tue, 22 Jun 2010 19:58:06 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1894&amp;PID=7381#7381</guid>
  </item> 
  <item>
   <title>Two entities using the same database table : Hello ting,   Thank for your...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1894&amp;PID=7344#7344</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=816" rel="nofollow">Peter</a><br /><strong>Subject:</strong> 1894<br /><strong>Posted:</strong> 17-Jun-2010 at 2:18am<br /><br /><P style="LINE-HEIGHT: normal; MARGIN: 0cm 1.3pt 0.65pt" =Ms&#111;normal><SPAN style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN; mso-fareast-: NL" lang=EN>Hello ting, <?: prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0.65pt 1.3pt" =Ms&#111;normal><SPAN style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN; mso-fareast-: NL" lang=EN>&nbsp;<o:p></o:p></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0.65pt 1.3pt" =Ms&#111;normal><SPAN style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN; mso-fareast-: NL" lang=EN>Thank for your response.<o:p></o:p></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0.65pt 1.3pt" =Ms&#111;normal><SPAN style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN; mso-fareast-: NL" lang=EN>I also believe it is a EF question.<o:p></o:p></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0.65pt 1.3pt" =Ms&#111;normal><SPAN style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN; mso-fareast-: NL" lang=EN>But, I find it hard to believe that I need to solve this though one entity.<o:p></o:p></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0.65pt 1.3pt" =Ms&#111;normal><SPAN style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN; mso-fareast-: NL" lang=EN>&nbsp;<o:p></o:p></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0.65pt 1.3pt" =Ms&#111;normal><SPAN style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN; mso-fareast-: NL" lang=EN>I've read so far:<o:p></o:p></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0.65pt 1.3pt" =Ms&#111;normal><SPAN style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN; mso-fareast-: NL" lang=EN><o:p>&nbsp;</o:p></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0.65pt 1.3pt" =Ms&#111;normal><SPAN style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN; mso-fareast-: NL" lang=EN>I can define two EF entities and alter the mapping properties.<o:p></o:p></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0.65pt 1.3pt" =Ms&#111;normal><SPAN style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN; mso-fareast-: NL" lang=EN>The mapping properties also can hold conditions to filter the query.<o:p></o:p></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0.65pt 1.3pt" =Ms&#111;normal><SPAN style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN; mso-fareast-: NL" lang=EN>Within my own partial class of Directory and File I can set the 'IsFile' variable.<o:p></o:p></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0.65pt 1.3pt" =Ms&#111;normal><SPAN style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN; mso-fareast-: NL" lang=EN>&nbsp;<o:p></o:p></SPAN></P><P style="LINE-HEIGHT: normal; MARGIN: 0.65pt 1.3pt" =Ms&#111;normal><SPAN style="FONT-FAMILY: 'Arial','sans-serif'; COLOR: black; FONT-SIZE: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-ansi-: EN; mso-fareast-: NL" lang=EN>I'm still testing this approche &nbsp;<o:p></o:p></SPAN></P><P style="MARGIN: 0cm 0cm 10pt" =Ms&#111;normal><SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Arial','sans-serif'; FONT-SIZE: 10pt">I’ll<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>keep you posted.<o:p></o:p></SPAN></P><P style="MARGIN: 0cm 0cm 10pt" =Ms&#111;normal><SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Arial','sans-serif'; FONT-SIZE: 10pt">Peter<o:p></o:p></SPAN></P>]]>
   </description>
   <pubDate>Thu, 17 Jun 2010 02:18:02 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1894&amp;PID=7344#7344</guid>
  </item> 
  <item>
   <title>Two entities using the same database table : Yes, this is more of an Entity...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1894&amp;PID=7329#7329</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=477" rel="nofollow">ting</a><br /><strong>Subject:</strong> 1894<br /><strong>Posted:</strong> 15-Jun-2010 at 8:19pm<br /><br />Yes, this is more of an Entity Framework question, but it is interesting nonetheless.&nbsp; I'm not the modelling expert, but I suspect that you will need to unify the DirectoryEntity and FileEntity into a single entity and return empty collections when IsFile is true.&nbsp; You can make the foreign key fields private/protected (not a bad practice) so that everyone goes through the object-oriented methods.<DIV></DIV>]]>
   </description>
   <pubDate>Tue, 15 Jun 2010 20:19:59 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1894&amp;PID=7329#7329</guid>
  </item> 
  <item>
   <title>Two entities using the same database table : Ok, I just hit the wrong button.....</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1894&amp;PID=7314#7314</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=816" rel="nofollow">Peter</a><br /><strong>Subject:</strong> 1894<br /><strong>Posted:</strong> 14-Jun-2010 at 4:06am<br /><br /><P>Ok, I just hit the wrong button.. lets resume my post.</P><P>Hello, <BR>&nbsp;<BR>I've just started with DevForce and have a question about modelling my entities.<BR>I'm not sure where EF ends and DF begins, so this may be an EF question.<BR>&nbsp;<BR>I have a classic 'directory-file' situation <BR>On one side the directory tree and on the other the containing files<BR>I'm using one table to store these instances. </P><P>DataTable<BR>- ID&nbsp;&nbsp;Int<BR>- Name&nbsp;&nbsp;Varchar<BR>- IsFile&nbsp;Bit<BR>- Parent_ID &nbsp;Int</P><P>DirectoryEntity<BR>- ID&nbsp;&nbsp;Int<BR>- Name&nbsp;&nbsp;String<BR>- Parent &nbsp;DirectoryEntity<BR>- Childs&nbsp;Collection of DirectoryEntiry<BR>- Files&nbsp;&nbsp;Collection of FileEntity</P><P>FileEntity<BR>- ID&nbsp;&nbsp;Int<BR>- Name&nbsp;&nbsp;String<BR>- Parent&nbsp;DirectoryEntity</P><P>Questions:<BR>1. What is the best way to implement this?<BR>2. How do I hide 'IsFile', but, implement it's value in the correct entity class?<BR>3. EF, by default, makes FK fields public, like 'Parent_ID'. Can I freely set it getter and setter to private?</P><P>Thank in advance.<BR>Peter</P>]]>
   </description>
   <pubDate>Mon, 14 Jun 2010 04:06:45 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1894&amp;PID=7314#7314</guid>
  </item> 
 </channel>
</rss>