nhibernate starting performance -
Does every time a request or only once the application starts?
What I'm doing here:
Public Session Session Manager (Private Readonly Foundation Factory _ Season Factor; Public Session Manager () {_sessionFactory = GetSessionFactory () ;} Public Isession GetSession () {Return _sessionFactory.OpenSession ();} Private Stable ISessionFactory GetSessionFactory () {return flu config. () .database (mssql configuration.mssql2005.connection string (c => c. (@ "Data source = pc-de-yasir; initial catalog = m Adderbase; user id = sa; password = password; integrated security = true ")). Mapping (m = & gt; m. Automapping. Add (autocarrestice model.mindtiesemeddendoffoffs & lt; model category & gt; ())) BuilderSecurityFactor ();}}
And here's how I get data from the database
Public IList & lt; Category & gt; ; GetCategories () {var session = new session manager (.) GetSession (); Return Session. Secret Carteria (Typef Line)). LIST & Lt; CATEGORY & gt; ();}
So my question will be configured to run this method for the first time or every time a request is made?
Once you instantiate ISessionFactory from top of my head ...
Comments
Post a Comment