Asp.Net Core RC2中IHostingEnvironment的构造函数依赖项

时间:2016-07-20 00:29:35

标签: c# asp.net asp.net-mvc asp.net-core-mvc

如何在ServiceUtility类中为IHostingEnvironment创建构造函数依赖项。如何在Startup ConfigureServices方法中绑定IHostEnvironment的依赖项。

自定义类

public class ServiceUtility
    {
        private IHostingEnvironment _environment;
        public ServiceUtility(IHostingEnvironment environment)
        {
            _environment = environment;
        }
    }

0 个答案:

没有答案