Esempio n. 1
0
        private void RegisterDependencies(IServiceCollection services)
        {
            var dbConfig = new TodoDbConfig();

            Configuration.Bind("DbConfig", dbConfig);

            var apiConfig = new ExternalTodoApiConfig();

            Configuration.Bind("ApiConfig", apiConfig);


            services.AddSingleton(dbConfig);
            services.AddSingleton(apiConfig);
            services.AddSingleton <ITodoManagementService, TodoManagementService>();
            services.AddSingleton <ITodoRepository, FakeTodoRepository>();
            services.AddSingleton <IExternalTodoApi, FakeExternalTodoApiService>();
        }
Esempio n. 2
0
 public FakeTodoRepository(TodoDbConfig config)
 {
     _config = config;
 }