SCM.SwissArmyKnife 0.0.0-preview.0.28

This is a prerelease version of SCM.SwissArmyKnife.
There is a newer version of this package available.
See the version list below for details.
dotnet add package SCM.SwissArmyKnife --version 0.0.0-preview.0.28                
NuGet\Install-Package SCM.SwissArmyKnife -Version 0.0.0-preview.0.28                
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="SCM.SwissArmyKnife" Version="0.0.0-preview.0.28" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SCM.SwissArmyKnife --version 0.0.0-preview.0.28                
#r "nuget: SCM.SwissArmyKnife, 0.0.0-preview.0.28"                
#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 SCM.SwissArmyKnife as a Cake Addin
#addin nuget:?package=SCM.SwissArmyKnife&version=0.0.0-preview.0.28&prerelease

// Install SCM.SwissArmyKnife as a Cake Tool
#tool nuget:?package=SCM.SwissArmyKnife&version=0.0.0-preview.0.28&prerelease                

SwissArmyKnife

This is a project full of utility methods that can be used across multiple projects.
The code is:

Installation

This library can be installed from Nuget or Github Packages.

Nuget

You can install it from nuget by running dotnet add package SwissArmyKnife

Github

If you are developing the library or want the latest packages built from the main branch, you can get them from Github packages.

  1. Add a nuget.config file to the root of your project.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <packageSources>
        <clear />
        <add key="github" value="https://nuget.pkg.github.com/SCADAMINDS/index.json" />
    </packageSources>
    <packageSourceCredentials>
        <github>
            <add key="Username" value="USERNAME" />
            <add key="ClearTextPassword" value="TOKEN" />
        </github>
    </packageSourceCredentials>
</configuration>
  1. Replace USERNAME with your Github username and TOKEN with a personal access token.
  2. Add the package: dotnet add package SwissArmyKnife --version {VERSION} --prerelease

SwissArmyKnife.Extensions

A bunch of handy extension methods that you'll probably like to use! Examples:


// ------------- Dictionary.GetOr
myDictionary.GetOr("nonExistingKey", () => "myFallbackValue");


// ------------- Task.Select()
var enumerableTask = Task.FromResult(new int[]{1,2});

// Select to transform multiple values
// Alternative to (await enumerableTask).Select(i => i + 1)
await enumerableTask.Select(i => i + 1); // Returns [2,3]


// ------------- object.Yield
// Produce an Enumerable out of an item
int myItem = 3;

// Type: IEnumerable<int>
var myEnumerable = myItem.Yield();

// ------------- HttpClient.GetAsJsonAsync()
var client = new HttpClient();

var url = "http://www.some-url-that-produces-json.com"

// Gets URL and serializes model to MyResponseModel. On error prints http response
var await response = client.GetAsJsonAsync<MyResponseModel>(url)

And many more!

Documentation

We automatically build the documentation based on some written docs and the source code. You can find the main page of the generated documentation here. It is automatically published from the main branch, so it might be slightly ahead of the current Nuget release.

Product 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. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen 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
1.5.0 7,078 9/13/2021
1.4.3 211 7/16/2021
1.4.2 134 7/16/2021
1.4.1 208 7/1/2021
1.4.0 187 5/27/2021
1.3.0 522 5/26/2021
1.2.0 415 5/3/2021
1.1.0 194 4/6/2021
1.0.1 1,001 2/2/2021
0.0.0-preview.0.28 177 2/2/2021