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

IObjectScope best practice usage

1 Answer 88 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.
Andrea
Top achievements
Rank 2
Iron
Andrea asked on 20 Feb 2009, 02:59 PM
Hi,

I would understand the best practice usage of the IObjectScope instance from .GetNewObjectScope

If, in a windows form, I need to call the DB in many places (to load a list, to load an object through its ID, to delete it, etc... ) what approach I must follow:
  1. one IObjectScope instance at class level
  2. a new IObjectScope instance every time that I need data from DB or I need to put data to the DB

Regards

1 Answer, 1 is accepted

Sort by
0
Zoran
Telerik team
answered on 20 Feb 2009, 04:25 PM
Hello Andrea,

The more preferable way of handling the object scope is the first that you have mentioned in your previous post. An object scope should be created at class level (WindowsForm) and disposed in the Dispose() method of the form. You can use the ObjectView BindingSource as well. It will handle the task automatically.


All the best,
Zoran
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
General Discussions
Asked by
Andrea
Top achievements
Rank 2
Iron
Answers by
Zoran
Telerik team
Share this question
or