开发者

How to get the NHibernate ISession that is HttpContextScoped by StructureMap

开发者 https://www.devze.com 2023-01-02 18:53 出处:网络
I\'m somewhat new to the MVC framework and in accordance with the following post: NHibernate with StructureMap I am not sure how to actually get the HttpContextScoped ISession in my controller?

I'm somewhat new to the MVC framework and in accordance with the following post: NHibernate with StructureMap I am not sure how to actually get the HttpContextScoped ISession in my controller?

I'm sure there is a simple way to do this but I am unsure.

Also, it's a small project and I don't want to go overboard with Enterprise Design Patterns.开发者_运维百科

Thanks!


did you try writting this line in your action method of your controller ?

ISession session = ObjectFactory.GetInstance<ISession>(); 
0

精彩评论

暂无评论...
验证码 换一张
取 消