如何在Global.asax中注入和使用注入的类?

我在我的应用程序中使用了StructureMap。我需要为我的类创建一个实例,该实例也需要注入!我知道无法在Global.asax中注入任何内容。

反正Owin可以做到这一点吗? 这是我在Global.asax中创建的班级:

public class NotificationComponent : INotificationComponent
{
    private IUnitOfWork _uow;
    private readonly ISystemMessageManagement _systemMessageManagement;
    public NotificationComponent(IUnitOfWork uow,ISystemMessageManagement systemMessageManagement)
    {
        _uow = uow;
        _systemMessageManagement = systemMessageManagement;
    }

,当我在Global.asax中创建NotificationComponent时,当然需要注入两个接口。

非常感谢。

song4th 回答:如何在Global.asax中注入和使用注入的类?

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3116926.html

大家都在问