NHibernate - good complete working Helper class for managing SessionFactory/Session

前端 未结 9 705
余生分开走
余生分开走 2020-12-07 14:37

can anyone provide/refer a proper OO type helper class for managing a singleton of the SessionFactory and then also for managing Sessions?

9条回答
  •  攒了一身酷
    2020-12-07 15:12

    I've had great success in the past using Spring.NET's NHibernate support modules. See http://www.springframework.net/downloads/Spring.Data.NHibernate/. You should be able to use the OpenSessionInView module and extend your DAOs off of the NHibernateSupport DAO to get full management support of the open session in view pattern.

    Additionally, although I've never tried it, you should be able to use the above stated framework even if you opt out of the reset of Spring.NET's offerings (namely IoC and AOP).

提交回复
热议问题