Exemple #1
0
        public void ConfigureEngineServices(IServiceCollection services, IConfiguration configuration, HarConfig config)
        {
            var typeFinder            = new AppDomainTypeFinder();
            var startupConfigurations = typeFinder.FindClassesOfType <IAppStartup>();
            var instances             = startupConfigurations.Select(t => (IAppStartup)Activator.CreateInstance(t)).OrderBy(o => o.Order);

            foreach (var instance in instances)
            {
                instance.ConfigureServices(services, configuration);
            }
        }
Exemple #2
0
        public void ConfigureContainer(ContainerBuilder builder, IConfiguration configuration)
        {
            var typeFinder = new AppDomainTypeFinder();

            builder.RegisterInstance(this).As <IEngine>().SingleInstance();

            builder.RegisterInstance(typeFinder).As <ITypeFinder>().SingleInstance();
            var startupConfigurations = typeFinder.FindClassesOfType <IAppStartup>();
            var instances             = startupConfigurations.Select(t => (IAppStartup)Activator.CreateInstance(t)).OrderBy(o => o.Order);

            foreach (var instance in instances)
            {
                instance.ConfigureContainer(builder, configuration);
            }
        }