Exemplo n.º 1
0
        public void ConfigureServices(IServiceCollection services)
        {
            IocRegistry.Register(
                services,
                Configuration);

            ConfigureNGrok(services);
            ConfigureAspNetCore(services);
            ConfigureSwagger(services);
            ConfigureAuthentication(services);
        }
Exemplo n.º 2
0
        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));
        }
Exemplo n.º 3
0
        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();
        }