Override mapped Properties?

2 posts, 0 answers
  1. Seires
    Seires avatar
    1 posts
    Member since:
    Jun 2012

    Posted 23 Jun 2012 Link to this post

    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.

  2. Serge
    Admin
    Serge avatar
    375 posts

    Posted 27 Jun 2012 Link to this post

    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.
  3. DevCraft banner
Back to Top