Beispiel #1
0
        protected IServiceProvider InitDependencyInjection(Action <IServiceCollection> servicesAction = null, Action <ContainerBuilder> containerBuilderAction = null)
        {
            IServiceProviderFactory <ContainerBuilder> factory = new InfrastructureFactory();

            var services = new ServiceCollection();

            servicesAction?.Invoke(services);

            ContainerBuilder containerBuilder = factory.CreateBuilder(services);

            containerBuilderAction?.Invoke(containerBuilder);

            return(factory.CreateServiceProvider(containerBuilder));
        }