You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This function will be called at runtime to configure your data source like `MyNewDataSource.ConfigureDI<IEmissionsDataSource>(services, config);`. For more examples, check out the [implementations of the existing data sources](/src/CarbonAware.DataSources/).
Copy file name to clipboardExpand all lines: docs/architecture/overview.md
+8-13
Original file line number
Diff line number
Diff line change
@@ -84,19 +84,14 @@ result.
84
84
85
85
See the [data source README](./data-sources.md) for more detailed information.
86
86
87
-
## Dependency Registration
88
-
89
-
The SDK uses dependency injection to load the data sources based on set
90
-
environment variables. To register a new dependency, a new
91
-
ServiceCollectionExtension method must be defined. These dependencies are loaded
92
-
in a hierarchical structure such that:
93
-
94
-
1. Each data source defines a `ServiceCollectionExtension` method.
95
-
2. All available data sources are registered in the `DataSource.Registration`
96
-
project.
97
-
3. The GSF library defines a `ServiceCollectionExtension` method where it
98
-
registers the data sources for the handlers to use.
99
-
4. The `Program.cs` file registers the GSF library classes at startup
87
+
### Dependency Registration
88
+
89
+
The SDK uses dependency injection to load the data sources based on configuration. To register a new dependency, the data source musr define a static method `ConfigureDI<T>`. These dependencies are then loaded in the following manner:
90
+
91
+
1. Each data source defines a `ConfigureDI<T>` method.
92
+
2. The GSF library defines a `ServiceCollectionExtension` method where it
93
+
uses the configuration settings to dynamically load and configure the user-specified data sources for the handlers to use.
94
+
3. The `Program.cs` file registers the GSF library classes at startup
Copy file name to clipboardExpand all lines: src/CarbonAware.DataSources/CarbonAware.DataSources.ElectricityMaps/src/CarbonAware.DataSources.ElectricityMaps.csproj
Copy file name to clipboardExpand all lines: src/CarbonAware.DataSources/CarbonAware.DataSources.ElectricityMaps/src/Configuration/ServiceCollectionExtensions.cs
0 commit comments