static public ServiceConfig GetInstance() { if (_instance == null) { lock (SynRoot) { if (_instance == null) { var handler = new ConfigureHandler(Reset); try { var builder = new DomDaoManagerBuilder(); builder.ConfigureAndWatch("dao.config", handler); //IBatisNet.DataAccess.DaoManager.ConfigureAndWatch(handler); // var builder = new DomDaoManagerBuilder(); // builder.ConfigureAndWatch(handler); // builder.Configure(); } catch (Exception e) { Console.WriteLine(e.Message); } _instance = new ServiceConfig { DaoManager = IBatisNet.DataAccess. DaoManager.GetInstance("Ssds") }; //_instance.DaoManager.SessionStore = new HybridWebThreadSessionStore(_instance.DaoManager.Id); } } } return(_instance); }
private ProfileService() { _daoManager = ServiceConfig.GetInstance().DaoManager; _Dao = (IProfileDao)_daoManager.GetDao(typeof(IProfileDao)); }
private WikiService() { _daoManager = ServiceConfig.GetInstance().DaoManager; _Dao = (IWikiDao)_daoManager.GetDao(typeof(IWikiDao)); }
/// <summary> /// Reset the singleton /// </summary> /// <remarks> /// Must verify ConfigureHandler signature. /// </remarks> /// <param name="obj"> /// </param> static public void Reset(object obj) { _instance = null; }
private QuestionService() { _daoManager = ServiceConfig.GetInstance().DaoManager; _Dao = (IQuestionDao)_daoManager.GetDao(typeof(IQuestionDao)); _daoManager.SessionStore = new HybridWebThreadSessionStore(_daoManager.Id); }
private GroupService() { _daoManager = ServiceConfig.GetInstance().DaoManager; _groupDao = (IGroupDao)_daoManager.GetDao(typeof(IGroupDao)); }