HUMANiT.Core 1.0.3

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

// Install HUMANiT.Core as a Cake Tool
#tool nuget:?package=HUMANiT.Core&version=1.0.3

HUMANiT Core

This package provides platform features that we miss in .NET, but that find valuable for our own daily software development. -- the people of HUMANiT

This package is covered by over 800 automated tests and offers an API that is documented extensively inline.

Features

  • Inspections: Pre and post verification of parameters and variables to check their conditions. Fast and reliable.
  • Domains: Consitent domain objects.
  • Shipping: Consitent shipping models.
  • Vault: Cache with multiple shelves (sub-caches), simple lifetime principles. Fast, thread-safe, reliable; also for SharePoint.
  • Object analysis: Provides an easy test whether a generic type is null-able.
  • Call result: Generic carrier of a call result such as of a standard method or a Web service call.
  • Type converter: Converts enumeration values into pre-defined strings and vice versa.
  • Cryptography: Creation and verification of cryptographic salted hashes; fast; using RFC2898 instead of the insecure MD5.
  • Randomizer: Generates random codes of different lengths and passwords as well as numbers, first names (>400), last names (>200), full names (>97k), URLs (>39k) and emails (>9m).
  • Extensions: Enhancements and validations to datesdatetimes, datetimeoffsets, passwords, PINs, phone numbers, names, emails, and exceptions.
  • Exception support: Provides easy ways to throw an exception for reached code that was expected to be unreachable.

Extensions will move into their own NuGet package in a future version, so if you use them, consider that a future package upgrade may cause compiler errors and you will need to add the HUMANiT.Core.Extensions package (yet unavailable).

This package contains features which we require for our own software; therefore, some features are highly custom. If you require a fix, an enhancement, or a more configurable solution, please contact us.

Contact

  • Twitter -- stay in touch (@HUMANiTnz)
  • Facebook -- message with us (@HUMANiTnz)
  • support@humanit.nz -- contact us via email

License

MIT -- free software, hell yeah 🤩

Quickstart

Inspections

Pre and post verification of parameters and variables to check their conditions. Fast and reliable.

Inspections are the incarnation of verification. Data verification is checking rules and ensure they are correct. A passed inspection means we can trust data is of a certain state and our code can be based on that. A failed inspection leads to an exception highlighting at which point we came aware of a problem with expected data quality.

Use parameter inspections to verify that parameters, that were passed into a method or constructor, are of an expected qyality. When such an inspection fails, it throws argument exceptions such as ArgumentNullException and ArgumentOutOfRangeException. Examples:

Inspect.Param.IsTrue(birthday <= DateTimeOffset.Today());
Inspect.Param.IsNotEmpty(vehicleList, nameof(vehicleList));
Inspect.Param.IsNotNullOrWhitespace(lastName, nameof(lastName), "Last name is mandatory.");

Use value inspections to verify that a method returned what it promised. When such an inspection fails, it throws an InvalidOperationException. Examples:

var numberOfThings = Inspect.Param.IsBetween(CountThings(), 0, 99);
var details = Inspect.Param.IsNotNull(LoadDetails(name), message: $"{name}'s details missing.");

Domains

Consitent domain objects.

Quickstart guidance will come.

Shipping

Consitent shipping models.

Quickstart guidance will come.

Vault

Cache with multiple shelves (sub-caches), simple lifetime principles. Fast, thread-safe, reliable; also for SharePoint.

Quickstart guidance will come.

Object analysis

Provides an easy test whether a generic type is null-able.

Quickstart guidance will come.

Call result

Generic carrier of a call result such as of a standard method or a Web service call.

Quickstart guidance will come.

Type converter

Converts enumeration values into pre-defined strings and vice versa.

Quickstart guidance will come.

Cryptography

Creation and verification of cryptographic salted hashes; fast; using RFC2898 instead of the insecure MD5.

Quickstart guidance will come.

Randomizer

Generates random codes of different lengths and passwords as well as numbers, first names (>400), last names (>200), full names (>97k), URLs (>39k) and emails (>9m).

Quickstart guidance will come.

Extensions

Enhancements and validations to datesdatetimes, datetimeoffsets, passwords, PINs, phone numbers, names, and exceptions.

Quickstart guidance will come.

Exception support

Provides easy ways to throw an exception for reached code that was expected to be unreachable.

Quickstart guidance will come.

Product Versions
.NET net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows net7.0 net7.0-android net7.0-ios net7.0-maccatalyst net7.0-macos net7.0-tvos net7.0-windows
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.
  • net6.0

    • No dependencies.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on HUMANiT.Core:

Package Downloads
HUMANiT.Core.Web

RESTful base client that can call any RESTful API. Supports the HTTP verbs GET, POST and PATCH. Deals with the HTTP status code 200, 201, 204, 300, 301, 302, 303, 305, 307, 400, 404, 409, 500 and 502. [covered by 60+ tests]

HUMANiT.Azure

Simplified logging that is available in any custom component and can be enabled/disabled during runtime. [covered by 80+ tests]

HUMANiT.Core.Domain

Base domain objects for different scenarios such as simply a type definition or as complex as persitable objects. [covered by 80+ tests]

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.4 0 3/27/2023
1.0.4-alpha-2800 47 3/13/2023
1.0.4-alpha-2798 37 3/13/2023
1.0.4-alpha-2792 54 1/18/2023
1.0.3 292 1/17/2023
1.0.1 363 1/10/2023
1.0.1-alpha-2558 99 1/6/2023
1.0.1-alpha-2527 88 1/4/2023
1.0.1-alpha-2475 74 1/2/2023
1.0.1-alpha-2433 177 9/19/2022
1.0.1-alpha-2430 71 9/19/2022
1.0.1-alpha-2396 82 8/22/2022
1.0.0 562 8/21/2022
1.0.0-preview-2356 116 8/5/2022
1.0.0-preview-2354 81 8/5/2022
1.0.0-alpha-2351 73 8/5/2022
1.0.0-alpha-2349 73 8/5/2022
0.8.0 278 8/4/2022
0.8.0-rc-1600 77 8/4/2022
0.8.0-preview-1600 80 8/4/2022
0.8.0-alpha-1600 81 8/4/2022
0.7.1-alpha-1139 3,705 4/10/2020
0.7.0 4,762 3/31/2020
0.6.1 16,182 12/2/2019
0.6.0 1,583 10/19/2019
0.5.2 6,587 2/10/2019
0.5.1 4,234 1/27/2019
0.4.1 1,966 4/1/2018
0.4.0 1,645 2/3/2018
0.3.2 1,347 1/12/2018
0.3.0 955 12/9/2017
0.2.2 823 9/18/2017
0.1.6 802 9/1/2017

Contact HUMANiT for details: support@HUMANiT.nz