public void ConfigureServices(IServiceCollection services) { IocRegistry.Register( services, Configuration); ConfigureNGrok(services); ConfigureAspNetCore(services); ConfigureSwagger(services); ConfigureAuthentication(services); }
protected void Application_Start() { AreaRegistration.RegisterAllAreas(); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); var container = new IocContainer(); IocRegistry.Register(container); IDependencyResolver resolver = DependencyResolver.Current; DependencyResolver.SetResolver(new IocDependencyResolver(container, resolver)); }
private static async Task DogfeedAsync(IConfiguration configuration) { var serviceCollection = new ServiceCollection(); serviceCollection.AddSingleton(configuration); IocRegistry.Register( serviceCollection, configuration); IocRegistry.ConfigureDogfeeding( serviceCollection); await using var serviceProvider = serviceCollection.BuildServiceProvider(); using var scope = serviceProvider.CreateScope(); var dogfeedService = scope .ServiceProvider .GetRequiredService <IDogfeedService>(); await dogfeedService.DogfeedAsync(); }