ByteDecoder.Common
1.0.0
dotnet add package ByteDecoder.Common --version 1.0.0
NuGet\Install-Package ByteDecoder.Common -Version 1.0.0
<PackageReference Include="ByteDecoder.Common" Version="1.0.0" />
paket add ByteDecoder.Common --version 1.0.0
#r "nuget: ByteDecoder.Common, 1.0.0"
// Install ByteDecoder.Common as a Cake Addin #addin nuget:?package=ByteDecoder.Common&version=1.0.0 // Install ByteDecoder.Common as a Cake Tool #tool nuget:?package=ByteDecoder.Common&version=1.0.0
ByteDecoder.Common
Common utility classes, guard clauses, and more.
Targeted to .Net6 onwards
Installation
Install the ByteDecoder.Common NuGet Package.
Package Manager Console
Install-Package ByteDecoder.Common
.NET Core CLI
dotnet add package ByteDecoder.Common
Documentation
All the documentation can be found on the github page.
Examples and usage
Guard Clauses
They are a piece of code in charge of protecting params at the top of methods against undesirable values.
Supported Guard Clauses:
- IfArgumentIsNull
- IfArgumentIsNullOrEmpty
- IfArgumentOutOfRange
Usage examples:
using ByteDecoder.Common.GuardClauses;
// Null Argument Guard check
public void MethodOne(IEnumerable<string> collection)
{
Guard.Break.IfArgumentIsNull(collection, nameof(collection));
// More logic code if the param is suitable after the guard evaluates the condition.
}
// String is NUll or Empty Guard check
public void MethodTwo(string word)
{
Guard.Break.IfArgumentIsNull(word, nameof(word));
// More logic code if the param is suitable after the guard evaluates the condition.
}
// Calling the method and passing a null value in the param
MethodOne((IEnumerable<string>) null); // This will throw an ArgumentNullException
MethodTwo(string.Empty); // This will throw an ArgumentNullException
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/ByteDecoder/ByteDecoder.Common.
Copyright (c) 2020 Rodrigo Reyes released under the MIT license
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | 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 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. |
-
net6.0
- JetBrains.Annotations (>= 2021.3.0)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on ByteDecoder.Common:
Package | Downloads |
---|---|
ByteDecoder.RoyalLibrary
Collection of useful LINQ query operators |
|
ByteDecoder.Queryology.Providers.ObjectDumper
ObjectDumper provider the minimalist Queryology Engine |
GitHub repositories
This package is not used by any popular GitHub repositories.