mirror of https://github.com/abpframework/abp.git
2 changed files with 21 additions and 0 deletions
@ -0,0 +1,20 @@ |
|||||
|
using Autofac; |
||||
|
using Volo.Abp.Autofac; |
||||
|
using Microsoft.Extensions.DependencyInjection; |
||||
|
|
||||
|
namespace Microsoft.Extensions.Hosting |
||||
|
{ |
||||
|
public static class AbpAutofacHostBuilderExtensions |
||||
|
{ |
||||
|
public static IHostBuilder UseAutofac(this IHostBuilder hostBuilder) |
||||
|
{ |
||||
|
var containerBuilder = new ContainerBuilder(); |
||||
|
|
||||
|
return hostBuilder.ConfigureServices((_, services) => |
||||
|
{ |
||||
|
services.AddObjectAccessor(containerBuilder); |
||||
|
}) |
||||
|
.UseServiceProviderFactory(new AbpAutofacServiceProviderFactory(containerBuilder)); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue