Custom Read-Only Derrived Properties

Posts   
 
    
jader201
User
Posts: 33
Joined: 20-Mar-2007
# Posted on: 24-Apr-2007 23:51:47   

I have an entity (table) that has the following two properties (fields):

  • FirstName
  • LastName

I want to add the following read-only derrived properties (mainly for databinding purposes):

  • FirstLastName: returns FirstName + " " + LastName
  • LastFirstName: returns LastName + ", " + FirstName

How do I go about accomplishing this?

If this is specified in the documentation, just point me to it and I'll check it out. I checked both the forums and the documentation, and didn't have any luck, but may not be searching for the right terms.

Thanks in advance.

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 25-Apr-2007 09:40:31   

Please check the docs: "Using the generated code -> Adding your own code to the generated classes"

jader201
User
Posts: 33
Joined: 20-Mar-2007
# Posted on: 25-Apr-2007 17:15:06   

Thanks. I was aware of adding custom code and thought about just adding it as a property, but for some reason, was thinking it wasn't that straight forward.

That answered my question, thanks again.