CSharpEssentials 8.0.0

dotnet add package CSharpEssentials --version 8.0.0
                    
NuGet\Install-Package CSharpEssentials -Version 8.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="CSharpEssentials" Version="8.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CSharpEssentials" Version="8.0.0" />
                    
Directory.Packages.props
<PackageReference Include="CSharpEssentials" />
                    
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 CSharpEssentials --version 8.0.0
                    
#r "nuget: CSharpEssentials, 8.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 CSharpEssentials@8.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=CSharpEssentials&version=8.0.0
                    
Install as a Cake Addin
#tool nuget:?package=CSharpEssentials&version=8.0.0
                    
Install as a Cake Tool

CSharpEssentials

Meta-package that bundles the core functional modules. It targets net11.0, net10.0, net9.0 and netstandard2.1.

Included packages

  • CSharpEssentials.Core
  • CSharpEssentials.Errors
  • CSharpEssentials.Results
  • CSharpEssentials.Maybe
  • CSharpEssentials.Json
  • CSharpEssentials.Any
  • CSharpEssentials.These
  • CSharpEssentials.Rules
  • CSharpEssentials.Entity
  • CSharpEssentials.Http
  • CSharpEssentials.Time
  • CSharpEssentials.Clone
  • CSharpEssentials.Enums

Installation

dotnet add package CSharpEssentials

Usage

The other packages are installed separately: CSharpEssentials.Validation, CSharpEssentials.Mediator, CSharpEssentials.Resilience, CSharpEssentials.Endpoints, CSharpEssentials.DependencyInjection, CSharpEssentials.EntityFrameworkCore, CSharpEssentials.AspNetCore (with CSharpEssentials.AspNetCore.OpenApi or CSharpEssentials.AspNetCore.Swashbuckle), CSharpEssentials.Idempotency (with CSharpEssentials.Idempotency.Testing for store contract tests), CSharpEssentials.RequestResponseLogging and CSharpEssentials.GcpSecretManager.

using CSharpEssentials.Errors;
using CSharpEssentials.Maybe;
using CSharpEssentials.ResultPattern;

Maybe<User> maybe = FindUser(1);
Result<User> result = maybe.ToResult(Error.NotFound("User.Missing", "User not found."));

Extensions in the meta-package

The assembly adds a few helpers that combine the bundled packages:

using System.Text.Json;
using CSharpEssentials.Json;          // JsonExtensions
using CSharpEssentials.Maybe;
using CSharpEssentials.ResultPattern;
using CSharpEssentials.Time;          // TimeExtensions

using JsonDocument doc = JsonDocument.Parse("""{"a":{"b":5},"userName":"x"}""");

Result<JsonElement> name = doc.RootElement.TryGetProperty("user_name", "userName"); // the first name that exists
Result<JsonElement?> five = doc.TryGetNestedProperty("a", "b");                     // walks the names as a path

long? timestamp = 1_700_000_000_000;
Maybe<DateTime> date = timestamp.MsToDateTime();                                    // None for null, or the default you pass

TryGetProperty and TryGetNestedProperty return a failed Result (PropertyNotFound as the error code when no name matches, NoPropertyNames when you pass none, DocumentIsNull for a null document) instead of throwing.

Upgrading to 8.0

  • MsToDateTime returns a DateTime with Kind = Utc (it was Unspecified, with the same ticks). Wrap the value in DateTime.SpecifyKind(value, DateTimeKind.Unspecified) to keep the old behaviour. The other 8.0 changes are in the CSharpEssentials.Core upgrade notes.
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.  net9.0 is compatible.  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 is compatible.  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.  net11.0 is compatible. 
.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
8.0.0 158 11/9/2026
7.0.0 155 10/20/2026
6.5.2 108 10/10/2026
6.5.1 109 10/10/2026
6.5.0 111 10/9/2026
6.4.0 101 10/9/2026
6.3.0 104 10/8/2026
6.2.0 98 10/8/2026
6.1.0 111 10/7/2026
6.0.0 110 10/7/2026
5.2.1 113 10/7/2026
5.2.0 112 10/7/2026
5.1.0 102 10/7/2026
5.0.0 116 10/6/2026
4.1.0 110 10/6/2026
4.0.0 119 10/5/2026
3.2.3 313 5/31/2026
3.2.2 144 5/31/2026
3.2.1 143 5/31/2026
3.2.0 139 5/30/2026
Loading failed