Extend or encapsulate?

Thread is closed for posting
2 posts, 1 answers
  1. Anton Sharov
    Anton Sharov avatar
    5 posts
    Member since:
    Mar 2010

    Posted 26 Mar 2010 Link to this post

    Hello everybody!

    I'm pretty new to ORM technology, so, please, can anybody expalin following: I have table User which is mapped to class User.cs and User.Telerik.OpenAccess.cs and I need to add logic for User class, for example , AddUser method, Login method etc...
    The question is where  can I do that?
    Should I create new separate class and encapsulate here all my logic with user class or I can extend generated class and if so, which of above  I can exetend or I should add another partial declaration of this class?

    Thanks in advance.
  2. Answer
    Damyan Bogoev
    Damyan Bogoev avatar
    581 posts

    Posted 26 Mar 2010 Link to this post

    Hello Anton Sharov,

    You should add the custom logic within the User.cs file. If you run the Reverse Mapping or the Forward Mapping wizards the changes will affect only inside the User.Telerik.OpenAccess.cs. The User.cs is not being overwritten.
    If you have any other questions please do not hesitate to contact us back.

    Best wishes,
    Damyan Bogoev
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Back to Top