Service<TSettingsClass,TSettingsInterface> Class
Base class for HAKOM HTTP services that require strongly-typed settings bound from configuration.
public abstract class Service<TSettingsClass,TSettingsInterface> : HAKOM.Http.Core.Net.Api.Service, System.IAsyncDisposable where TSettingsClass : class, TSettingsInterface, HAKOM.Configuration.Core.Net.Api.ISettings<TSettingsClass, TSettingsInterface> where TSettingsInterface : classType parameters
Section titled “Type parameters”TSettingsClass
The concrete settings class that implements TSettingsInterface and ISettings<TSettingsClass,TSettingsInterface>.
TSettingsInterface
The settings interface exposed to the service implementation.
Inheritance System.Object 🡒 Service 🡒 Service<TSettingsClass,TSettingsInterface>
Implements System.IAsyncDisposable
Constructors
Section titled “Constructors”Service() Constructor
Section titled “Service() Constructor”Initializes a new instance of Service<TSettingsClass,TSettingsInterface>.
protected Service();Properties
Section titled “Properties”Service<TSettingsClass,TSettingsInterface>.Settings Property
Section titled “Service<TSettingsClass,TSettingsInterface>.Settings Property”Gets the strongly-typed settings bound from configuration. Available after Setup(string[]) has been called.
protected TSettingsInterface Settings { protected get; }Property Value
Section titled “Property Value”Methods
Section titled “Methods”Service<TSettingsClass,TSettingsInterface>.ConfigureHakomServices(IContainer, IConfiguration) Method
Section titled “Service<TSettingsClass,TSettingsInterface>.ConfigureHakomServices(IContainer, IConfiguration) Method”Registers HAKOM services and resolves hosting configuration from the DI container.
protected override void ConfigureHakomServices(HAKOM.DependencyInjection.Core.Net.Api.IContainer container, out Microsoft.Extensions.Configuration.IConfiguration? hostConfiguration);Parameters
Section titled “Parameters”container IContainer
The DI container to register services into.
hostConfiguration Microsoft.Extensions.Configuration.IConfiguration
When this method returns, contains the resolved Microsoft.Extensions.Configuration.IConfiguration for the hosting section, or null if no host configuration was found.
Remarks
Section titled “Remarks”Override this method in derived classes to register additional services. Always call base.ConfigureHakomServices.