Is a static repository a right way to use NHibernate?

前端 未结 2 1059
暖寄归人
暖寄归人 2020-12-23 18:26

I spent the rest of the evening reading StackOverflow questions and also some blog entries and links about the subject. All of them turned out to be very helpful, but I stil

2条回答
  •  抹茶落季
    2020-12-23 18:40

    For what it is worth, Sharp Architecture is doing more or less exactly what you are suggesting. It ends up delivering one session per HTTP request (more accurately, one session per database per HTTP request). Your approach is certainly valid and also delivers one session per request. I rather prefer SharpArch's cleaner OO approach via DI over using static repositories and the helper class.

提交回复
热议问题