<?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 : object custom property</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2009 : object custom property</description>
  <pubDate>Wed, 22 Apr 2026 07:19:26 -700</pubDate>
  <lastBuildDate>Fri, 21 May 2010 17:27:31 -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=1830</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>object custom property : Thanks, good point. Will keep...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1830&amp;PID=6997#6997</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=470" rel="nofollow">bigfish</a><br /><strong>Subject:</strong> 1830<br /><strong>Posted:</strong> 21-May-2010 at 5:27pm<br /><br />Thanks, good point.&nbsp; Will keep that in mind while working with the app as a user does to determine if we hit that issue....&nbsp; much appreciated.]]>
   </description>
   <pubDate>Fri, 21 May 2010 17:27:31 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1830&amp;PID=6997#6997</guid>
  </item> 
  <item>
   <title>object custom property : Sorry not to get back to you quicker,...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1830&amp;PID=6993#6993</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=21" rel="nofollow">IdeaBlade</a><br /><strong>Subject:</strong> 1830<br /><strong>Posted:</strong> 21-May-2010 at 4:32pm<br /><br />Sorry not to get back to you quicker, but do be aware that the solution you've shown above depends absolutely on the required RentReviewIncomes being in cache at the time the TotalIncome property is accessed. In the asynchronous environment of Silverlight, if they're not there (already), the calculation will simply yield 0.<br><br>]]>
   </description>
   <pubDate>Fri, 21 May 2010 16:32:54 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1830&amp;PID=6993#6993</guid>
  </item> 
  <item>
   <title>object custom property : OK I got it;  The partial class...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1830&amp;PID=6989#6989</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=470" rel="nofollow">bigfish</a><br /><strong>Subject:</strong> 1830<br /><strong>Posted:</strong> 21-May-2010 at 4:04pm<br /><br />OK I got it;<DIV>&nbsp;</DIV><DIV>The partial class <FONT color=#0000ff>RentReview </FONT>generated by DevForce allowed me to include a custom propertry (TotalIncome)&nbsp;and business rule as per below;</DIV><DIV><FONT color=#0000ff size=2><FONT color=#0000ff size=2></FONT></FONT>&nbsp;</DIV><DIV><FONT color=#0000ff size=2><FONT color=#0000ff size=2>public</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>decimal</FONT></FONT><FONT size=2> TotalIncome { </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>get</FONT></FONT><FONT size=2> { </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>return</FONT></FONT><FONT size=2> getIncomes(); }}</DIV><DIV><DIV></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2></FONT></FONT>&nbsp;</DIV><DIV><FONT color=#0000ff size=2><FONT color=#0000ff size=2>private</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>decimal</FONT></FONT><FONT size=2> getIncomes() </FONT></DIV><DIV><FONT size=2>{</FONT></DIV><DIV><FONT color=#0000ff size=2><FONT color=#0000ff size=2><FONT color=#000000>&nbsp;&nbsp; </FONT>decimal</FONT></FONT><FONT size=2> totalIncome = 0;</FONT></DIV><DIV><FONT size=2>&nbsp;&nbsp; <FONT color=#0000ff><FONT color=#0000ff>foreach</FONT></FONT>(<FONT color=#2b91af><FONT color=#2b91af>RentReviewIncome</FONT></FONT> income <FONT color=#0000ff><FONT color=#0000ff>in</FONT></FONT> RentReviewIncomes)</FONT></DIV><DIV><FONT size=2>&nbsp;&nbsp; {</FONT></DIV><DIV><FONT size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; totalIncome = totalIncome + (<FONT color=#0000ff><FONT color=#0000ff>decimal</FONT></FONT>)income.incomeValue;</FONT></DIV><DIV><FONT size=2>&nbsp;&nbsp; }</FONT></DIV><DIV><FONT size=2>&nbsp;&nbsp; <FONT color=#0000ff><FONT color=#0000ff>return</FONT></FONT> totalIncome;</FONT></DIV><DIV><FONT size=2>}</FONT></DIV><DIV><FONT size=2></FONT>&nbsp;</DIV><DIV><FONT size=2>As its in the partial class, DevForce won't overwrite the rule on each subsequent regeneration.</FONT></DIV><DIV><FONT size=2>RentReviewIncomes is the collection of associated entities of the main RentReview object.</FONT></DIV><DIV><FONT size=2></FONT>&nbsp;</DIV><DIV><FONT size=2>Very cool for me, maybe very obvious for hardened developers...</FONT></DIV><DIV><FONT size=2></FONT>&nbsp;</DIV><DIV><FONT size=2>Rgds</FONT></DIV><DIV><FONT size=2>BigFish</FONT></DIV><DIV><FONT size=2></FONT>&nbsp;</DIV></DIV>]]>
   </description>
   <pubDate>Fri, 21 May 2010 16:04:15 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1830&amp;PID=6989#6989</guid>
  </item> 
  <item>
   <title>object custom property : Hi guys,  I need to sum related...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=1830&amp;PID=6960#6960</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=470" rel="nofollow">bigfish</a><br /><strong>Subject:</strong> 1830<br /><strong>Posted:</strong> 19-May-2010 at 1:27pm<br /><br />Hi guys,<DIV>&nbsp;</DIV><DIV>I need to sum related objects values to a custom property of parent object to use as a display property in a datagrid source.</DIV><DIV>&nbsp;</DIV><DIV>The equivalent SQL query would look like:</DIV><DIV>&nbsp;</DIV><DIV>SELECT&nbsp;&nbsp;&nbsp;&nbsp; RR.RentReviewID, <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RR.ReviewDate, <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SUM(RRI.IncomeValue) AS TotalIncome<BR>FROM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RentReview RR JOIN<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RentReviewIncome RRI ON RR.RentReviewId = RRI.RentReviewId<BR>GROUP BY&nbsp; RR.RentReviewId,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RR.ReviewDate<BR><FONT size=2></FONT></DIV><DIV><FONT size=2>RentReview object has RentReviewIncome as associated object.</FONT></DIV><DIV><FONT size=2></FONT>&nbsp;</DIV><DIV><FONT size=2>The query I currently execute is:-</FONT></DIV><DIV>&nbsp;</DIV><DIV><FONT color=#0000ff size=2><FONT color=#0000ff size=2>var</FONT></FONT><FONT size=2> query = Manager.RentReviews</FONT></DIV><DIV><FONT size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .Where(a =&gt; a.Tenancy.tenancyID == tenancyID)</FONT></DIV><DIV><FONT size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .OrderByDescending(a =&gt; a.effectiveFromDate)</FONT></DIV><DIV><FONT size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .Include(</FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>"Schedule"</FONT></FONT><FONT size=2>)</FONT></DIV><DIV><FONT size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.Include(</FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>"RentReviewIncomes"</FONT></FONT><FONT size=2>);</FONT></DIV><DIV><FONT size=2></FONT>&nbsp;</DIV><DIV><FONT size=2>Query(query, callback);</DIV></FONT><DIV><FONT size=2></FONT>&nbsp;</DIV><DIV><FONT size=2>This returns associated RentReviewIncome objects, but where to from there?</FONT></DIV><DIV><FONT size=2></FONT>&nbsp;</DIV><DIV><FONT size=2>I was hoping something like this custom property on the RentReview object might do the trick, but no.</FONT></DIV><DIV><FONT size=2><FONT color=#0000ff size=2><FONT color=#0000ff size=2><FONT color=#0000ff size=2><FONT color=#0000ff size=2>public</FONT></FONT><FONT color=#000000 size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>decimal</FONT></FONT><FONT color=#000000 size=2> TotalIncome { </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>get</FONT></FONT><FONT color=#000000 size=2> { </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>return</FONT></FONT><FONT color=#000000 size=2> (</FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>decimal</FONT></FONT><FONT size=2><FONT color=#000000>)RentReviewIncomes.Sum(incomeValue); } }</FONT></FONT></FONT></FONT></FONT></DIV><DIV><FONT size=2><FONT color=#0000ff size=2><FONT color=#0000ff size=2><FONT size=2><FONT color=#000000></FONT>&nbsp;</DIV></FONT></FONT></FONT><FONT size=2></FONT></FONT>]]>
   </description>
   <pubDate>Wed, 19 May 2010 13:27:19 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=1830&amp;PID=6960#6960</guid>
  </item> 
 </channel>
</rss>