This question is locked. New answers and comments are not allowed.
Hello, Telerik team!
I have a library DBHandler.dll which is develoed by someone (this man is not working with us now).
this library contains a class DBFacade
This class contains two methods (if I understand right - for handle transactions)
GetInstance()
NewInstance()
If I uderstand right I can get a new transaction (NewInstance()) or get existing (GetInstance())
Explain, please - if it right?
Why he write so??
What I should do if I want to use more than one transaction?
Thanks!
public class DbFacade { private static DbFacade instance; private readonly IObjectScope scope; private readonly ITransaction tx; private DbFacade() { scope = ScopeProvider.ObjectScope(); tx = scope.Transaction; if (!tx.IsActive) { tx.Begin(); } } public static DbFacade NewInstance() { return new DbFacade(); } public static DbFacade GetInstance() { if (instance == null) { instance = new DbFacade(); } return instance; } private IEnumerable<T> RetreiveData<T>(IEnumerable<T> result) { //... } public void Put<T>(T entity) { //... } public void Remove<T>(T entity) { //... } //... //... }