StructureMap CacheBy InstanceScope.HttpSession not working
问题 This is my StructureMap bootstrapping: ObjectFactory.Initialize(factory => { //Business Conversation is per session factory.ForRequestedType<IConversation>(). TheDefaultIsConcreteType<Conversation>(). CacheBy(InstanceScope.HttpSession); //Session Factory is life time factory.ForRequestedType<INHibernateSessionManager>(). TheDefaultIsConcreteType<NHibernateSessionManager>(). CacheBy(InstanceScope.Singleton); }); var conversation = ObjectFactory.GetInstance<IConversation>(); When I have my