Example #1
0
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddSingleton <PathResolver>(ResolvePath);

            services
            .AddRouting(options => options.LowercaseUrls = true)
            .AddControllers()
            .AddNewtonsoftJson();

            services.Configure <CorsOptions>(configuration.GetSection("Cors"));

            accountsStartup.ConfigureServices(services, environment);
            entriesStartup.ConfigureServices(services, environment);
            sharingStartup.ConfigureServices(services);
        }
Example #2
0
        private static void ConfigureServices(IServiceCollection services)
        {
            DefaultEventManager eventManager = new DefaultEventManager();

            services
            .AddLogging()
            .AddExceptions()
            .AddComponents()
            .AddUiOptions()
            .AddHttpClientFactory(GetApiBaseUrl())
            .AddSingleton <IEventDispatcher>(eventManager)
            .AddSingleton <IEventHandlerCollection>(eventManager)
            .AddSingleton <Json>()
            .AddTransient <Navigator>();

            ConfigureConverts();

            common.ConfigureServices(services);
            accounts.ConfigureServices(services);
            entries.ConfigureServices(services);
            sharing.ConfigureServices(services);
        }