开发者

How to get the NHibernate ISession that is HttpContextScoped by StructureMap

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜