public void OnStartUp() { SetRootPathProject(); XmlTextReader configReader = new XmlTextReader(new MemoryStream(NHibernate.Test.Properties.Resources.Configuration)); DirectoryInfo dir = new DirectoryInfo(this.rootPathProject + ".Hbm"); Console.WriteLine(dir); builder = new NhConfigurationBuilder(configReader, dir); builder.SetProperty("connection.connection_string", GetConnectionString()); try { builder.BuildSessionFactory(); sessionFactory = builder.SessionFactory; } catch (Exception ex) { Console.WriteLine(ex); throw; } sessionProvider = new SessionManager(sessionFactory); currentPagedDAO = new EnterprisePagedDAO(sessionProvider); currentRootPagedDAO = new EnterpriseRootDAO<object>(sessionProvider); currentSession = sessionFactory.OpenSession(); }
/// <summary> /// /// </summary> /// <param name="customPagedDAO"></param> public SalesService(INhRootPagedDAO <IEntity> customPagedDAO) { this.customPagedDAO = customPagedDAO; }
/// <summary> /// /// </summary> /// <param name="customPagedDAO"></param> public SalesService(INhRootPagedDAO<IEntity> customPagedDAO) { this.customPagedDAO = customPagedDAO; }