gpt4 book ai didi

azure - Azure 函数中的 Autofac 依赖注入(inject)

转载 作者:行者123 更新时间:2023-12-02 14:53:52 30 4
gpt4 key购买 nike

我正在尝试在Azure功能中使用Autofac IOC来实现DI。我需要构建容器,但不确定将构建容器的代码放在哪里

最佳答案

我确实写了一篇博客文章,用于在 Azure Functions 中使用 Autofac 进行依赖项注入(inject)。看看这里: Azure Function Dependency Injection with AutoFac: Autofac on Functions

它遵循类似的方法,如 Boris Wilhelms 的方法。 。另一个基于 Boris 方法的实现可以在 github 上找到:autofac dependency injection

-- 更新 ---

使用 Azure Function v2,可以创建基于 .net 标准的 nuget 包。看看 Azure Functions Dependency Injection with Autofac: Autofac on Functions nuget Package

关于azure - Azure 函数中的 Autofac 依赖注入(inject),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44397407/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com