public CustomerService() { #region Define the Base Map _getDaoManager = ServiceConfig.GetInstance().DaoManager; if (_getDaoManager != null) { _getbaseService = _getDaoManager.GetDao(typeof(CustomerMapDao)) as ICustomerDao; } #endregion #region Use SqlMaper Style to Soleuv this Connection Problem f**k =--- DomSqlMapBuilder getbuilder = new DomSqlMapBuilder(); if (getbuilder != null) { _getsqlmaper = getbuilder.Configure() as SqlMapper; } #endregion }
static public ServiceConfig GetInstance() { if (_instance == null) { lock (_synRoot) { if (_instance == null) { ConfigureHandler handler = new ConfigureHandler(ServiceConfig.Reset); DomDaoManagerBuilder builder = new DomDaoManagerBuilder(); builder.ConfigureAndWatch("Dao.config", handler); builder.Configure(); _instance = new ServiceConfig(); // TODO:默认为sqlMapDao指定的Context, 要提供对多个Context的支持. _instance._daoManager = IBatisNet.DataAccess.DaoManager.GetInstance("SqlMapDao"); } } } return(_instance); }
static public ServiceConfig GetInstanceByFile() { if (_instance == null) { lock (_synRoot) { if (_instance == null) { //Define the Absoluate File path to Found the Dao File [f**k this shit] string filepath = @"E:\ADO.NEt Entity FrameWork Program\MyBatis_Demo\BatisDemonstarate_DUI\CustomerWeb_UI\Dao.Config"; if (File.Exists(filepath)) { DomDaoManagerBuilder getbuilder = new DomDaoManagerBuilder(); getbuilder.Configure(filepath); _instance = new ServiceConfig(); _instance._daoManager = IBatisNet.DataAccess.DaoManager.GetInstance("SqlMapDao"); } } } } return(_instance); }
public static ServiceConfig GetInstance() { if (_instance == null) { lock (_synRoot) { if (_instance == null) { ConfigureHandler handler = new ConfigureHandler(ServiceConfig.Reset); DomDaoManagerBuilder builder = new DomDaoManagerBuilder(); builder.ConfigureAndWatch("Dao.config", handler); builder.Configure(); _instance = new ServiceConfig(); // TODO:默认为sqlMapDao指定的Context, 要提供对多个Context的支持. _instance._daoManager = IBatisNet.DataAccess.DaoManager.GetInstance("SqlMapDao"); } } } return _instance; }
/// <summary> /// Reset the singleton /// </summary> /// <remarks> /// Must verify ConfigureHandler signature. /// </remarks> /// <param name="obj"> /// </param> static public void Reset(object obj) { _instance = null; }
public static ServiceConfig GetInstanceByFile() { if (_instance == null) { lock (_synRoot) { if (_instance == null) { //Define the Absoluate File path to Found the Dao File [f**k this shit] string filepath = @"E:\ADO.NEt Entity FrameWork Program\MyBatis_Demo\BatisDemonstarate_DUI\CustomerWeb_UI\Dao.Config"; if (File.Exists(filepath)) { DomDaoManagerBuilder getbuilder = new DomDaoManagerBuilder(); getbuilder.Configure(filepath); _instance = new ServiceConfig(); _instance._daoManager = IBatisNet.DataAccess.DaoManager.GetInstance("SqlMapDao"); } } } } return _instance; }
/// <summary> /// Reset the singleton /// </summary> /// <remarks> /// Must verify ConfigureHandler signature. /// </remarks> /// <param name="obj"> /// </param> public static void Reset(object obj) { _instance = null; }