Table of Contents

Class AirthingsServiceExtensions

Namespace
Tudormobile.Airthings.Service
Assembly
Airthings.Service.dll

Extension methods for configuring Airthings Service endpoints.

public static class AirthingsServiceExtensions
Inheritance
AirthingsServiceExtensions
Inherited Members

Methods

AddAirthingsService(IServiceCollection, IConfiguration)

Registers services required by the Airthings Service, including the typed HTTP client and options.

public static IServiceCollection AddAirthingsService(this IServiceCollection services, IConfiguration configuration)

Parameters

services IServiceCollection

The service collection.

configuration IConfiguration

The application configuration used to bind AirthingsOptions.

Returns

IServiceCollection

The service collection for method chaining.

UseAirthingsService(WebApplication)

Sets up the Airthings Service endpoints for device status, device list, and sample data. Each endpoint requires an API key provided in the request header and is cached for performance.

public static WebApplication UseAirthingsService(this WebApplication app)

Parameters

app WebApplication

Returns

WebApplication