MintPlayer.SeasonChecker
1.1.1
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package MintPlayer.SeasonChecker --version 1.1.1
NuGet\Install-Package MintPlayer.SeasonChecker -Version 1.1.1
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="MintPlayer.SeasonChecker" Version="1.1.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add MintPlayer.SeasonChecker --version 1.1.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: MintPlayer.SeasonChecker, 1.1.1"
#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 MintPlayer.SeasonChecker as a Cake Addin #addin nuget:?package=MintPlayer.SeasonChecker&version=1.1.1 // Install MintPlayer.SeasonChecker as a Cake Tool #tool nuget:?package=MintPlayer.SeasonChecker&version=1.1.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
MintPlayer.SeasonChecker
Helper library find out the season for a specific date.
NuGet package
https://www.nuget.org/packages/MintPlayer.SeasonChecker/
Installation
NuGet package manager
Open the NuGet package manager and install MintPlayer.SeasonChecker in your project
Package manager console
Install-Package MintPlayer.SeasonChecker
Usage
Adding SeasonChecker services
The SeasonChecker becomes available in the Service Container with the following command (Startup@ConfigureServices).
services.AddSeasonChecker();
Code sample
class Program
{
static void Main(string[] args)
{
// This data can be sourced from a database
var seasons = new Season[] {
new Season
{
Name = "Spring",
Start = new DateTime(2000, 3, 21),
End = new DateTime(2000, 6, 20)
},
new Season
{
Name = "Summer",
Start = new DateTime(2000, 6, 21),
End = new DateTime(2000, 9, 20)
},
new Season
{
Name = "Automn",
Start = new DateTime(2000, 9, 21),
End = new DateTime(2000, 12, 20)
},
new Season
{
Name = "Winter",
Start = new DateTime(2000, 12, 21),
End = new DateTime(2001, 3, 20)
}
};
// Create service provider
var serviceProvider = new ServiceCollection()
.AddSeasonChecker()
.BuildServiceProvider();
// Get the season checker from the service-container
var seasonChecker = serviceProvider.GetService<ISeasonChecker>();
// Run the test for all days of the year
var testStart = new DateTime(2020, 1, 1);
var testDays = 366;
for (int i = 0; i < testDays; i++)
{
var day = testStart.AddDays(i);
var season = seasonChecker.FindSeasonAsync(seasons, day).Result;
Console.WriteLine("{0:dd/MM/yyyy} is in the {1}", day, season.Name);
}
Console.ReadKey();
}
}
class Season : ISeason
{
public string Name { get; set; }
public DateTime Start { get; set; }
public DateTime End { get; set; }
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. 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. net9.0 was computed. 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. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 3.1.7)
- MintPlayer.SeasonChecker.Abstractions (>= 1.0.3)
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 |
---|---|---|
9.0.0 | 98 | 11/13/2024 |
8.1.1 | 135 | 6/24/2024 |
8.1.0 | 248 | 2/28/2024 |
8.0.0 | 546 | 11/15/2023 |
1.3.1 | 885 | 6/9/2021 |
1.3.0 | 799 | 5/29/2021 |
1.2.2 | 797 | 4/11/2021 |
1.2.1 | 815 | 4/11/2021 |
1.2.0 | 831 | 4/11/2021 |
1.1.17 | 955 | 9/11/2020 |
1.1.16 | 898 | 9/11/2020 |
1.1.15 | 899 | 9/11/2020 |
1.1.14 | 936 | 9/11/2020 |
1.1.13 | 1,043 | 9/5/2020 |
1.1.12 | 1,047 | 9/5/2020 |
1.1.11 | 956 | 8/27/2020 |
1.1.10 | 963 | 8/20/2020 |
1.1.9 | 945 | 8/20/2020 |
1.1.8 | 977 | 8/19/2020 |
1.1.7 | 929 | 8/19/2020 |
1.1.6 | 949 | 8/19/2020 |
1.1.5 | 994 | 8/19/2020 |
1.1.4 | 958 | 8/19/2020 |
1.1.3 | 943 | 8/19/2020 |
1.1.2 | 986 | 8/19/2020 |
1.1.1 | 1,047 | 8/13/2020 |
1.1.0 | 969 | 8/13/2020 |
Add overload to pick hemisphere with built-in seasons