简体   繁体   中英

Inject a object in NancyFX module

I am trying to use Nancy as self-hosted in a legacy application, so I am trying to change as little as possible.

My Nancy's modules need to interact with a instance of a object previously constructed that, from the point of view of Nancy is like a singleton. I am guarantee that the same instance will exists during all the lifetime of the Nancy server.

My questions is, how can I use this instance inside my modules? Thanks in advance for any help or reference.

是否通过旧版应用程序中的依赖项容器创建此对象实例?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM