BB84.Extensions 2.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package BB84.Extensions --version 2.0.0
                    
NuGet\Install-Package BB84.Extensions -Version 2.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="BB84.Extensions" Version="2.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="BB84.Extensions" Version="2.0.0" />
                    
Directory.Packages.props
<PackageReference Include="BB84.Extensions" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add BB84.Extensions --version 2.0.0
                    
#r "nuget: BB84.Extensions, 2.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.
#:package BB84.Extensions@2.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=BB84.Extensions&version=2.0.0
                    
Install as a Cake Addin
#tool nuget:?package=BB84.Extensions&version=2.0.0
                    
Install as a Cake Tool

CI Docs CodeQL Issues Commit License NuGet

BB84.Extensions

A collection of some random C# extensions I needed in many projects.

Usage

Depending on the application, there are several ways to skin a cat.

Example extensions

Start of week

The StartOfWeek method returns the first day of the week using the specified date and the definition of the first day of the week.

DateTime today = new(2023, 9, 5);
DateTime startOfWeek = today.StartOfWeek();
Random choice

The RandomChoice method returns a randomly chosen item from a given array.

int[] ints = { 1, 2, 3 };
int i = ints.RandomChoice();
For each

The ForEach method iterates over an enumerable and executes an action on each element.

int hits = default;
IEnumerable<string> strings = new List<string>() { "a", "ab", "b", "bb" };
strings.ForEach(x => x.Contains("a"), x => hits++);

Documentation

The complete API documentation can be found here.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  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 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 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.  net10.0 was computed.  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. 
.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 is compatible.  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.

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
3.2.930 37 9/30/2025
3.1.916 375 9/16/2025
3.1.831 385 8/31/2025
3.0.817 285 8/17/2025
3.0.722 752 7/22/2025
2.15.710 297 7/10/2025
2.14.613 373 6/13/2025
2.13.530 294 5/30/2025
2.12.523 168 5/23/2025
2.11.518 214 5/18/2025
2.11.409 1,041 4/9/2025
2.11.323 400 3/23/2025
2.11.322 221 3/22/2025
2.10.315 333 3/15/2025
2.10.130 617 1/30/2025
2.9.1225 972 12/25/2024
2.8.1216 342 12/16/2024
2.7.1012 1,300 10/12/2024
2.6.930 425 9/30/2024
2.6.928 174 9/28/2024
2.6.924 270 9/24/2024
2.5.727 1,090 7/27/2024
2.4.717 406 7/17/2024
2.3.421 1,428 4/21/2024
2.3.416 240 4/16/2024
2.2.0 720 3/8/2024
2.1.0 563 2/8/2024
2.0.0 618 1/9/2024
1.9.0 375 12/24/2023
1.8.1 193 12/21/2023
1.8.0 291 12/6/2023
1.7.4 349 11/23/2023
1.7.3 205 11/20/2023
1.7.2 267 11/12/2023
1.7.1 167 11/12/2023
1.7.0 239 11/1/2023
1.6.1 186 10/30/2023
1.6.0 169 10/29/2023
1.5.0 179 10/29/2023
1.4.0 167 10/26/2023
1.3.0 157 10/25/2023
1.2.0 189 10/22/2023
1.1.0 168 10/21/2023
1.0.1 180 10/21/2023
1.0.0 169 10/21/2023