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>();
精彩评论