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

前端 未结 9 717
余生分开走
余生分开走 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

    You might like to consider making your DAL less concerned with managing NHibernate sessions by leveraging NHibernate.Burrow (or implementing a similar pattern yourself).

    "NHibernate.Burrow is a light weight middleware developed to support .Net applications using NHibernate by providing advanced and smart session/transaction management and other facilitates."

    If you decide to roll your own there are some useful links at the bottom of this page:

    A useful google search term would be 'NHibernate Session Management' and 'Contextual Sessions'...

    There's no shortage of ideas - you could say there are too many choices, hopefully opinion will start to gravitate around Burrow or something like it...

提交回复
热议问题