ManiaAPI.TMX.Extensions.Hosting
2.9.0
dotnet add package ManiaAPI.TMX.Extensions.Hosting --version 2.9.0
NuGet\Install-Package ManiaAPI.TMX.Extensions.Hosting -Version 2.9.0
<PackageReference Include="ManiaAPI.TMX.Extensions.Hosting" Version="2.9.0" />
<PackageVersion Include="ManiaAPI.TMX.Extensions.Hosting" Version="2.9.0" />
<PackageReference Include="ManiaAPI.TMX.Extensions.Hosting" />
paket add ManiaAPI.TMX.Extensions.Hosting --version 2.9.0
#r "nuget: ManiaAPI.TMX.Extensions.Hosting, 2.9.0"
#:package ManiaAPI.TMX.Extensions.Hosting@2.9.0
#addin nuget:?package=ManiaAPI.TMX.Extensions.Hosting&version=2.9.0
#tool nuget:?package=ManiaAPI.TMX.Extensions.Hosting&version=2.9.0
ManiaAPI.TMX.Extensions.Hosting
Provides an efficient way to inject all TMX services into your application.
Setup
using ManiaAPI.TMX.Extensions.Hosting;
builder.Services.AddTMX();
Features this setup brings:
- You can inject
ImmutableDictionary<TmxSite, TMX>to get all TMX sites as individual instances - If you don't need specific site context, you can inject
IEnumerable<TMX>to get all TMX sites - Specific
TMXcan be injected using[FromKeyedServices(TmxSite.TMNF)]
If you just inject TMX alone, it will give the last-registered one (in this case, Original). If you need a specific site, use [FromKeyedServices(...)].
Resilience
HTTP requests can transiently fail, so it's a good idea to add some retry logic.
TmxOptions.ConfigureHttpClient gives you access to each site's IHttpClientBuilder, so you can add Microsoft.Extensions.Http.Resilience to automatically retry requests, apply timeouts, and use circuit breakers:
using ManiaAPI.TMX.Extensions.Hosting;
builder.Services.AddTMX(options =>
{
options.ConfigureHttpClient = http => http.AddStandardResilienceHandler();
});
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- ManiaAPI.TMX (>= 2.9.0)
-
net8.0
- ManiaAPI.TMX (>= 2.9.0)
-
net9.0
- ManiaAPI.TMX (>= 2.9.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.