<?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 : Access custom properties from EntityAspect</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2010 : Access custom properties from EntityAspect</description>
  <pubDate>Tue, 12 May 2026 22:30:09 -700</pubDate>
  <lastBuildDate>Fri, 22 Feb 2013 10:01:00 -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=4001</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>Access custom properties from EntityAspect :    You can &amp;#034;register&amp;#034;...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=4001&amp;PID=15898#15898</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=11" rel="nofollow">kimj</a><br /><strong>Subject:</strong> 4001<br /><strong>Posted:</strong> 22-Feb-2013 at 10:01am<br /><br />You can "register" a custom property with DevForce via the PropertyMetadata class and a new DataEntityProperty field, but it may be more work than you want for a simple calculated property.&nbsp; <div>&nbsp;</div><div>Registering a backing DataEntityProperty for a custom property looks something like this:</div><div>&nbsp;</div><div>public partial class Customer {</div><div>&nbsp; public string FullName {<br>&nbsp;&nbsp;&nbsp; get { return PropertyMetadata.FullName.GetValue(this); }<br>&nbsp; }</div><div>&nbsp;</div><div>&nbsp; public new partial class EntityPropertyNames&nbsp; {<br>&nbsp;&nbsp;&nbsp; public const string FullName = "FullName";<br>&nbsp; }</div><div>&nbsp;</div><div>&nbsp; public partial class PropertyMetadata {<br>&nbsp;&nbsp;&nbsp; public static readonly DataEntityProperty&lt;Customer, string&gt; FullName =<br>&nbsp;&nbsp;&nbsp; new DataEntityProperty&lt;Customer, string&gt;(<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; propertyName: EntityPropertyNames.FullName,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; isNullable: false,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; isPartOfKey: false,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; concurrencyStrategy: ConcurrencyStrategy.None,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; isAutoIncrementing: false,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; relatedNavigationPropertyName: null,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; isNativeProperty: false);<br>&nbsp; }<br>}</div><div>&nbsp;</div><div>The problem is that once you've tied into the PropertyMetadata you won't be able to use a simple property getter like you're probably now using, but will need to do some sort of property interception.&nbsp; Something like this:</div><div>&nbsp;</div><div>&#091;AfterGet(EntityPropertyNames.FullName)&#093;<br>public void FullNameGetInterceptor(PropertyInterceptorArgs&lt;Customer, String&gt; args) {<br>&nbsp; args.Value = FirstName + LastName;<br>}<br></div><div>&nbsp;</div><div>If this all looks like more than you need, then simple reflection will also allow you to get and set your custom property from&nbsp;your entity&nbsp;base class.</div><div><br>&nbsp;</div>]]>
   </description>
   <pubDate>Fri, 22 Feb 2013 10:01:00 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=4001&amp;PID=15898#15898</guid>
  </item> 
  <item>
   <title>Access custom properties from EntityAspect : Hi,I&amp;#039;ve created a custom...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=4001&amp;PID=15895#15895</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1228" rel="nofollow">Vonzkie</a><br /><strong>Subject:</strong> 4001<br /><strong>Posted:</strong> 22-Feb-2013 at 1:48am<br /><br />Hi,<div><br></div><div>I've created a custom string property "strFullName" on my entity which basically just returns a concatenated string of several properties such as "strLastName", "strFirstName", and "strMiddleName". I created a generic method that access my entity base, and from here I can only access the EntityAspect property of my entity (not actual field names..). So when I try to access the fields&nbsp;<span style="line-height: 1.4;">strLastName", "strFirstName", and "strMiddleName", I am able to, but not "strFullName". It throws me an error "DataProperty: 'strFullName' does not exist on type 'EntityAspect'". How can I make it so that I can be able to check the value by using this code?</span></div><div><span style="line-height: 1.4;"><br></span></div><div><span style="line-height: 1.4;">_currentRecord.EntityAspect.GetDataProperty("strFullName")</span></div><div><span style="line-height: 1.4;"><br></span></div><div><span style="line-height: 1.4;"><i>(I'm thinking I might need to add some attributes or something on my custom property to make it accessible within the EntityAspect..?)</i></span></div><div><span style="line-height: 1.4;"><br></span></div><div><span style="line-height: 1.4;">Thanks,</span></div><div>Von</div>]]>
   </description>
   <pubDate>Fri, 22 Feb 2013 01:48:19 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=4001&amp;PID=15895#15895</guid>
  </item> 
 </channel>
</rss>