using IoC container in azure functions

℡╲_俬逩灬. 提交于 2019-12-25 04:12:10

问题


I have been used to writing Windows Services using TopShelf to do all stuff which cannot be done in a web request and am slowly moving to using azure functions.

With topshelf I could generally do

  1. scan and register on start of a service
  2. use nested container for each ticket / request

How can I use IOC in an azure function call ? Should I be using it at all ?


回答1:


No there isn't currently a way to do IOC in a natural way in Azure Functions. Generally you'd want to initialize your IOC container at application startup, but we don't currently give you a way to do that. We have an open issue in our repo related to that here. Furthermore, we'd have to make this container available to Function instances.



来源:https://stackoverflow.com/questions/40430342/using-ioc-container-in-azure-functions

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!