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

Extend or encapsulate?

1 Answer 125 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Anton Sharov
Top achievements
Rank 1
Anton Sharov asked on 26 Mar 2010, 11:24 AM
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.

1 Answer, 1 is accepted

Sort by
0
Accepted
Damyan Bogoev
Telerik team
answered on 26 Mar 2010, 05:56 PM
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.
Tags
General Discussions
Asked by
Anton Sharov
Top achievements
Rank 1
Answers by
Damyan Bogoev
Telerik team
Share this question
or