net.tellerapps.sunrise-sunset-client.dependency-injection 5.0.0

dotnet add package net.tellerapps.sunrise-sunset-client.dependency-injection --version 5.0.0
NuGet\Install-Package net.tellerapps.sunrise-sunset-client.dependency-injection -Version 5.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="net.tellerapps.sunrise-sunset-client.dependency-injection" Version="5.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add net.tellerapps.sunrise-sunset-client.dependency-injection --version 5.0.0
#r "nuget: net.tellerapps.sunrise-sunset-client.dependency-injection, 5.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install net.tellerapps.sunrise-sunset-client.dependency-injection as a Cake Addin
#addin nuget:?package=net.tellerapps.sunrise-sunset-client.dependency-injection&version=5.0.0

// Install net.tellerapps.sunrise-sunset-client.dependency-injection as a Cake Tool
#tool nuget:?package=net.tellerapps.sunrise-sunset-client.dependency-injection&version=5.0.0

SunriseSunset

https://sunrise-sunset.org/ API client
GitHub: https://github.com/gilad-teller/SunriseSunset

SunriseSunsetClient Dependency Injection

This extension allows you to easily add SunriseSunsetClient to your .Net 5 application
Add this to the Startup:

services.AddSunriseSunsetClient();

When adding this service, SunriseSunsetService and SunriseSunsetHttpClient are added as scoped services.
Also, an HttpClient is registered and binded to SunriseSunsetService.
This means you don't need to manage the HttpClient.
You can then consume SunriseSunsetService as a dependency.

public class MyService
{
	private readonly SunriseSunsetService _sunriseSunsetService;
	
	public MyService(SunriseSunsetService sunriseSunsetService)
	{
		_sunriseSunsetService = sunriseSunsetService;
	}

	public async Task<Response> Get()
	{
		return await _sunriseSunsetService.Get(51.5010, -0.1406, new DateTime(2021, 1, 1));
	}
}
Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
5.0.0 257 12/18/2021

Sunset Sunrise client with dependency injection support.
Receiving data from https://sunrise-sunset.org/