SCM.SwissArmyKnife
0.0.0-preview.0.28
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
<PackageReference Include="SCM.SwissArmyKnife" Version="0.0.0-preview.0.28" />
paket add SCM.SwissArmyKnife --version 0.0.0-preview.0.28
#r "nuget: SCM.SwissArmyKnife, 0.0.0-preview.0.28"
// 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:
- Thoroughly documented
- Thoroughly tested
- Methods that are side-effect free are marked as
[Pure]
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.
- 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>
- Replace USERNAME with your Github username and TOKEN with a personal access token.
- 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)
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 | 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. |
.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. |
-
.NETStandard 2.1
- Newtonsoft.JSON (>= 11.0.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.