第一步先引用Nuget包
在Program文件里加入 .UseServiceProviderFactory(new AutofacServiceProviderFactory())
最后在Startup文件里加入