帮助使用 inRequestScope inversifyJS 例如:
container.bind<ITransactionManager>(Types.MysqlTransactionManager).to(MysqlTransactionManager).inRequestScope()
...
container.get<ITransactionManager>(Types.MysqlTransactionManager)//call the MysqlTransactionManager constructor and return the instance
container.get<ITransactionManager>(Types.MysqlTransactionManager) //call the constructor one more time and return a new instance
我希望在第二次调用 get 时返回相同的实例,而不是再次实例化它