This is a migrated thread and some comments may be shown as answers.

Override mapped Properties?

1 Answer 69 Views
Development (API, general questions)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Seires
Top achievements
Rank 1
Seires asked on 23 Jun 2012, 05:09 PM
Hi everybody,

im new and decided to use the Telerik ORM as mapper. Now i stuck in a problem, i have already postet on StackOverflow

StackOverflow Article

Short Version: I want to override my generated Propertys in my second half of partial Class ... how can i do this? Whitout creating new Tables or Columns in my Database.

1 Answer, 1 is accepted

Sort by
0
Serge
Telerik team
answered on 27 Jun 2012, 11:33 AM
Hello Seiers, 

There isn't a way to override properties in a partial class, you need to do it in a derived one. However using a derived class might not help, given that the OpenAccess context will retrieve instances from the base class and there isn't an easy way of converting those to your new types.

 What you can do is add a property with a different name (in the partial class), that does the neccessary calculations. This however will mean that you will have both exposed on the model. In order to fix that you can change the access modifier of the generated property trough the visual designer. Just find the property and change it's access modifier in the properties pane to something different from public. 

I will post this answer on your stack overflow thread as well, so that it is available to the community. I would like to also mention that posting questions there is a nice way to provide solutions to problem to a more broader audience. 
 
All the best,
Serge
the Telerik team
OpenAccess ORM Q2'12 Now Available! Get your hands on all the new stuff.
Tags
Development (API, general questions)
Asked by
Seires
Top achievements
Rank 1
Answers by
Serge
Telerik team
Share this question
or