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>(); }
public FakeTodoRepository(TodoDbConfig config) { _config = config; }