CSharpEssentials.Results 8.0.0

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

CSharpEssentials.Results

Functional Result pattern for explicit success/failure handling in .NET, without exceptions for control flow.

Result and Result<T> are value types with implicit conversions from values and errors. Operations chain with Then, Bind, Map and Ensure, a failure can carry several errors, every operation has async overloads, and Result.Try, Result.TryAsync and TryCatch turn exceptions into errors.

Targets net11.0, net10.0, net9.0 and netstandard2.1. Depends on CSharpEssentials.Errors and CSharpEssentials.Json.

Benchmarks against CSharpFunctionalExtensions, ErrorOr and FluentResults are in BENCHMARKS.md. On net10, Map, Bind, Tap and Match allocate 0 B, like CSharpFunctionalExtensions and ErrorOr (FluentResults 88-344 B). A failure allocates 56 B (ErrorOr 88 B; CSharpFunctionalExtensions 0 B with its string error), and the async pipeline's failure path allocates 536 B vs 480 B for CSharpFunctionalExtensions. Error aggregation takes 99.09 ns / 336 B vs 42.79 ns / 184 B for ErrorOr's manual-list idiom. The package sets IsAotCompatible on its .NET 9+ targets and brings CSharpEssentials.Errors, Json, Core and Enums (CSharpFunctionalExtensions has no dependencies).

Installation

dotnet add package CSharpEssentials.Results

Usage

Creating results

using CSharpEssentials.ResultPattern;
using CSharpEssentials.Errors;

public Result<int> GetUser(int id)
{
    if (id <= 0)
        return Error.Validation("Id.Invalid", "ID must be positive.");

    return 42; // implicit conversion to Result<int>
}

public Result DeleteUser(int id)
{
    if (id <= 0)
        return Error.Validation("Id.Invalid", "ID must be positive.");

    return Result.Success();
}

Returning failures

Return the Error itself. Error, Error[], List<Error> and HashSet<Error> convert implicitly to Result and Result<T>, and a T value converts to Result<T>:

// Single error
Result fail = Error.Validation("Input.Invalid", "Input was invalid.");
Result<string> notFound = Error.NotFound("User.NotFound", "User not found.");

// Multiple errors in one failure
Result<int> multiError = new[]
{
    Error.Validation("Name.Empty", "Name is required."),
    Error.Validation("Email.Invalid", "Email is invalid.")
};

Result<T> does not accept null: Result<string> r = (string?)null; throws ArgumentNullException. A bool converts to Result too: true is a success and false is the Error.False failure. default(Result) and default(Result<T>) are successes; the Value of default(Result<T>) is default(TValue) (null for reference types) even though the nullability annotations say it is set, so call EnsureNotNull on results that may come from an uninitialized field or array slot. A failure must hold at least one error: Result.From and Result.Failure throw ArgumentException for an empty collection. Results serialize with System.Text.Json (an errors array and, for Result<T>, a Value) and deserialize back to the same state.

Use the explicit factories when the compiler cannot infer the target type, for example with var, in a lambda whose return type is inferred, or as a generic argument:

var conflict = Result.Failure<string>(Error.Conflict("User.Duplicate", "User already exists."));
Task<Result<int>> pending = Task.FromResult(Result.Success(42));

Inspecting a result

Result<int> result = GetUser(10);

if (result.IsSuccess)
{
    int value = result.Value;
}
else
{
    Error first = result.FirstError;
    Error last = result.LastError;
    Error[] all = result.Errors;
}

var (isSuccess, value2, errors) = result;   // Result<T>; Result deconstructs to (isSuccess, errors)

Value is default on a failure. Errors, FirstError and LastError on a success return the sentinel errors Error.NoErrors, Error.NoFirstError and Error.NoLastError; ErrorsOrEmptyArray returns an empty array instead. TryGet(out value, out errors) returns true for a success. Result<T>.ToResult() drops the value, and Result<T> values support ==, Equals, LINQ query syntax (from a in r1 from b in r2 select a + b) and r1 + r2 (a Result<T[]> that collects every value or every error).

ToString() is for logs. A success prints Success: plus the value's own ToString(), formatted with CultureInfo.InvariantCulture when the value is IFormattable, so a class without a ToString override prints its type name. Earlier versions printed JSON; for JSON, call result.Value.ConvertToJson() from CSharpEssentials.Json.

Chaining

Result<int> Parse(string input)
{
    if (int.TryParse(input, out int n))
        return n;
    return Error.Validation("Parse", "Not a number.");
}

Result<int> result = Parse("5")
    .Then(n => n * 2)
    .Then(n => n + 10);

Then takes either a plain function (Func<T, U>) or a function that returns a Result<U>. Bind takes a Result-returning function and Map a plain one (a Result-returning Map overload exists too). ThenDo and Tap run a side effect and return the same result. On a failure these operations skip the handler and pass the errors through.

Ensuring

Result<int> ensured = Result.Success(50)
    .Ensure(v => v > 0, Error.Validation("Range", "Must be positive."))
    .Ensure(v => v < 100, Error.Validation("Range", "Must be less than 100."));

Matching

string message = GetUser(10).Match(
    onSuccess: user => $"User: {user}",
    onError: errors => $"Failed: {errors[0].Description}");

GetUser(10).Switch(
    onSuccess: user => Console.WriteLine($"User: {user}"),
    onError: errors => Console.WriteLine($"Failed: {errors.Length} error(s)"));

MatchFirst and MatchLast (and SwitchFirst, SwitchLast) hand the handler a single Error instead of the array. On a non-generic Result the handlers take no value and the failure handler parameter is named onFailure.

Combining results

var r1 = Result.Success();
var r2 = Result.Success();
Result r3 = Error.NotFound();

Result combined = Result.And(r1, r2, r3); // Failure: returns r3's errors; Result.And stops at the first failure
Result all = new[] { r1, r2, r3 }.CombineAll(); // Failure: collects the errors of every failing result

Safe execution

Result<int> result = Result.Try(() => int.Parse("not a number"), ex => Error.Exception(ex));

Result.TryAsync converts exceptions to errors the same way, but when the CancellationToken you pass is cancelled it lets the OperationCanceledException propagate instead of turning it into an Error. An OperationCanceledException that did not come from your token (for example an HttpClient timeout) is still passed to the error handler.

Mapping errors

// Per-error mapper: runs once for every error, in order. Never called on success.
Result<User> result = GetUser(id)
    .MapError(e => Error.Failure($"Users.{e.Code}", e.Description));

// Array mapper: replaces the whole error array.
Result<User> single = GetUser(id)
    .MapError(errors => [Error.Failure("Users.Failed", $"{errors.Length} error(s)")]);

MapError(Func<Error, Error>) used to map only FirstError and drop the rest; it now maps every error.

MapErrorAsync takes Task or ValueTask mappers in the same two shapes. Per-error async mappers run one at a time, in order. The CancellationToken is checked before each mapper call; a mapper that is already running is not abandoned, so pass the token into the mapper if it must stop early. An async lambda (async e => ...) binds to the Task overload.

// Instance: async mapper on a Result / Result<T>
Result<User> localized = await result.MapErrorAsync(e => LocalizeAsync(e, ct), ct);

// Task<Result<T>> source: sync or Task mappers
Result<User> mapped = await GetUserAsync(id)
    .MapErrorAsync(e => Error.Failure($"Users.{e.Code}", e.Description));

// ValueTask<Result<T>> source: sync or ValueTask mappers
Result<User> fromCache = await GetCachedUserAsync(id)
    .MapErrorAsync(errors => CollapseAsync(errors));

Operations reference

Handlers run only on the side named in the table. The Async counterparts are under Async.

Operation Runs on Behaviour
Then, Bind, Map success Transform or chain the value; on a non-generic Result the handlers take no argument. Select and SelectMany exist on Result<T> only.
BindIf(condition, func) success Bind only when the bool, Func<bool> or Func<T, bool> condition holds.
ThenDo, Tap, TapIf success Side effect; Tap(condition, action) takes a bool or Func<bool>, TapIf (Result<T> only) a Func<T, bool> predicate. The result is returned unchanged.
Ensure(predicate, error) success Result<T> only. Fail with the error, or with errorFactory(value), when the predicate is false. EnsureNotNull fails on a null value.
FailIf(predicate, error) success Result<T> only. The opposite of Ensure: fail when the predicate is true.
ThenEnsure(validator) success Result<T> only. Run a validator that returns a Result or a Result<T>; its failure becomes the result.
MapError failure Rewrite the errors; see Mapping errors.
Else(...) failure Replace the failure with an Error, or with what a function of the Error[] returns: an Error, an Error[] (IEnumerable<Error> on Result) or, on Result<T>, a TValue. Result<T> also takes a fallback TValue directly.
ElseDo, ElseDoFirst, TapError, TapErrorFirst, TapErrorIf failure Side effect with the Error[] or the first Error; the failure is returned unchanged.
Compensate, CompensateFirst failure Replace the failure with the result of a function of the errors or the first error.
Recover(errorType, recovery), Recover(predicate, recovery), RecoverFirst failure Result<T> only. Replace the failure with a value or Result<T> when an error has the given ErrorType or matches the predicate.
Match, MatchFirst, MatchLast, Switch, SwitchFirst, SwitchLast both Consume the result.
Finally(func) both Receive the whole result and return a value (or run an action and return the result).
GetValueOrDefault(), GetValueOrDefault(value), GetValueOrDefault(factory), UnwrapOrDefault(value) both Result<T> only. The value, or a fallback on failure.
GetValueOrThrow(message), GetValueOrThrow(exception), Unwrap() both Result<T> only. The value, or throw: InvalidOperationException, your exception, or ResultUnwrapException with the Errors.
TryCatch(func, error) success Run func; an exception becomes error, or Error.Exception(ex) when none is given.

Static helpers on Result:

Result a = Result.SuccessIf(age >= 18, Error.Validation("Age.Minor", "Must be 18 or older."));
Result b = Result.FailureIf(() => items.Count == 0, Error.Validation("Items.Empty", "No items."));
Result<int> c = Result.SuccessIf(age >= 18, age, Error.Validation("Age.Minor", "Must be 18 or older."));
Result<(int, string)> pair = Result<int>.Combine(Result.Success(1), Result.Success("a"));   // up to 8 results, collects every error
Result either = Result.Or(r1, r2);   // success as soon as one succeeds, otherwise every error

Result.From and Result.Failure build failures from one or more errors; an empty error list throws. ToResult() extension methods turn an Error, an Error[], an IEnumerable<Error> or a plain value into a Result or Result<T>. On .NET 10 and later result.ValueOrDefault and left | right (the left result when it succeeded, otherwise the right) are available as extension members. ResultComparer, ResultComparer<T> and ResultBaseComparer in CSharpEssentials.ResultPattern.Comparers are IEqualityComparer implementations, and TrimStart(prefix)/TrimEnd(suffix) on string return a Result<string> that fails when the input or the prefix/suffix is empty.

Async

Result<UserDto> result = await FetchUserAsync(id)
    .ThenAsync(user => EnrichAsync(user))
    .EnsureAsync(dto => IsValidAsync(dto), Error.Validation("Invalid", "Not valid."));

Every member that returns Task or ValueTask ends in Async: BindAsync, ElseAsync, FailIfAsync, MatchAsync, MatchFirstAsync, MatchLastAsync, SwitchAsync, SwitchFirstAsync, SwitchLastAsync, ThenAsync and ThenDoAsync. The old unsuffixed names on Task/ValueTask sources (task.Match(...), task.Then(...)) and the instance Bind overloads that take a Task/ValueTask function still compile as [Obsolete] forwarders, as do the Bind members on IResult/IResult<T>; see the async naming migration. Use BindAsync for async lambdas: result.Bind(async v => ...) is ambiguous (CS0121). The CancellationToken is optional on every Task source.

Async overload matrix

The source decides the handler flavour. A Task<Result> source takes sync and Task handlers, a ValueTask<Result> source takes sync and ValueTask handlers, and an instance Result/Result<T> takes Task handlers and, on .NET 9+, ValueTask handlers. Handlers that already took a Task on a ValueTask source are kept.

Operation Result / Result<T> instance Task<Result> / Task<Result<T>> source ValueTask<Result> / ValueTask<Result<T>> source
MapAsync Task, ValueTask¹ sync, Task sync, ValueTask
BindAsync Task, ValueTask sync, Task sync, ValueTask
TapAsync Task, ValueTask¹ Action, Task Action, ValueTask
EnsureAsync (Result<T>) Task, ValueTask¹ sync, Task sync, Task, ValueTask¹
MapErrorAsync Task, ValueTask sync, Task sync, ValueTask
MatchAsync, MatchFirstAsync, MatchLastAsync Task, ValueTask¹ sync, Task sync, Task, ValueTask¹
SwitchAsync Task, ValueTask¹ sync, Task sync, Task, ValueTask¹
SwitchFirstAsync, SwitchLastAsync Task, ValueTask¹ sync, Task sync, Task, ValueTask¹
ElseAsync Task, ValueTask¹ sync, Task sync, Task, ValueTask¹
FailIfAsync (Result<T>) Task, ValueTask¹ sync, Task sync, Task, ValueTask¹
TapErrorAsync, TapErrorFirstAsync, ElseDoAsync, ElseDoFirstAsync Task, ValueTask¹ Task Task, ValueTask¹
CompensateAsync, CompensateFirstAsync Task, ValueTask¹ Task Task, ValueTask¹
ThenEnsureAsync (Result<T>) Task, ValueTask¹ Task Task, ValueTask¹
FinallyAsync sync, Task sync, Task, ValueTask¹
Result.TryAsync (static) Task, ValueTask¹
ThenAsync, ThenDoAsync Task, ValueTask¹ sync, Task sync, Task, ValueTask¹
TapIfAsync (Result<T>) Task, ValueTask¹ sync, Task sync, Task, ValueTask¹
TraverseAsync (IEnumerable<T>) Task selector, ValueTask selector¹

¹ .NET 9+ assets only. The netstandard2.1 asset (.NET 8, older hosts) does not have these overloads.

ThenAsync is an alias of BindAsync. A Task<Result> source has no ValueTask handler.

Task and ValueTask sources also have BindIfAsync, SelectAsync, TryCatchAsync and GetValueOrDefaultAsync, which are not part of the matrix.

// Task source: Task handlers, awaited in order
Result<OrderDto> order = await LoadOrderAsync(id)
    .EnsureAsync(o => o.Lines.Count > 0, Error.Validation("Order.Empty", "Order has no lines."))
    .TapAsync(async o => await _audit.WriteAsync(o.Id, ct))
    .MapAsync(o => new OrderDto(o));

// ValueTask source: sync or ValueTask handlers
Result<Price> price = await GetCachedProductAsync(sku)
    .MapAsync(p => _pricing.QuoteAsync(p, ct));   // Func<Product, ValueTask<Price>>
Lambda binding and C# 12

On .NET 9+, a lambda that returns ValueTask binds the ValueTask handler, and an untyped async lambda binds the Task handler through OverloadResolutionPriority, which needs C# 13 or later. With LangVersion 12 on a .NET 9+ target, an untyped async lambda is ambiguous (CS0121) on every operation marked ¹, TraverseAsync included. Move to C# 13, or type the handler: (Func<int, Task<string>>)(async v => ...) or a local function. Two more shapes need a typed handler on C# 12, on every target including netstandard2.1:

  • result.MapErrorAsync(async e => ...): the per-error Func<Error, Task<Error>> and the array Func<Error[], Task<Error[]>> mappers both fit.
  • result.BindAsync(async v => ...) on a Result<T>.

On C# 13 or later both compile. On a Result<T>, MapErrorAsync matches an untyped async lambda on what its body returns: a body that returns an Error, including return e;, binds the per-error mapper, so async errors => errors receives a single Error, and a body that returns a new Error[] binds the array mapper. Cast to Func<Error[], Task<Error[]>> when the array mapper must be explicit.

Handlers that are not awaited

Upgrading from 6.x changes what some TapAsync, MapAsync, SwitchFirstAsync/SwitchLastAsync and FinallyAsync call sites bind to, mostly so that async lambdas are now awaited; the list is in the async naming migration. These shapes still bind a sync Action and do not await the handler:

  • A non-async lambda that returns a Task on a ValueTask source still binds Action<T> for TapAsync and the conditional TapAsync, so the task is not awaited. Use an async lambda or a ValueTask handler.
  • A non-async lambda that returns a ValueTask on a Task source, such as taskResult.TapAsync(x => SaveValueTaskAsync(x)) or taskResult.TapAsync(isNew, x => SaveValueTaskAsync(x)), still binds Action<T>, so the ValueTask is discarded. Use an async lambda or a Task handler.
  • A non-async lambda that returns ValueTask<T> on a ValueTask source still binds Action<T> for TapAsync and the conditional TapAsync, so the ValueTask<T> is discarded: unlike Task<T> on a Task source, ValueTask<T> does not convert to ValueTask. Use an async lambda.
  • The sync Tap(condition, action) on a Result/Result<T> instance takes only Action, so result.Tap(isNew, async () => await SaveAsync()) still runs as async void. Check the condition inside an awaited handler instead: result.TapAsync(() => isNew ? SaveAsync() : Task.CompletedTask).

Collection extensions

// Collect ALL errors from multiple results
Result validation = new[] { ValidateName(input), ValidateEmail(input), ValidateAge(input) }
    .CombineAll();

// Map each item and collect: success array or all errors
Result<OrderDto[]> orders = orderIds.Traverse(id => GetOrder(id));

// Split into successes and errors without short-circuiting
var (succeeded, failed) = results.Partition();

// Stop at first failure
Result pipeline = new[] { CheckStock(), ReserveItem(), CreateOrder() }
    .FirstFailureOrSuccesses();
Method Strategy Returns
CombineAll() Collect all errors Result or Result<T[]>
Sequence() Collect all Result<T[]> with all values or all errors
Traverse(selector) Map then sequence Result<TOut[]>
Partition() Split (T[] Successes, Error[] Errors)
FirstFailureOrSuccesses() Short-circuit Result or Result<T[]>
TraverseAsync(selector, ct) Async map then sequence, one item at a time Task<Result<TOut[]>>
SequenceAsync(ct) Await already-started tasks, collect all Task<Result<T[]>> or ValueTask<Result<T[]>>
TraverseAsync and SequenceAsync

TraverseAsync runs an async selector over a sequence sequentially: each item is awaited before the next one starts, so side effects keep their order and a non-thread-safe resource such as a DbContext is safe to use. Like Traverse, it never short-circuits: every failure is collected and the errors come back in input order.

Result<OrderDto[]> orders = await orderIds.TraverseAsync(
    (id, ct) => GetOrderAsync(id, ct),
    cancellationToken);

// Tasks that are already running: every task is awaited, and all errors are collected
Result<int[]> values = await new[] { LoadA(), LoadB(), LoadC() }.SequenceAsync();
  • Cancellation throws OperationCanceledException; it is never turned into an error. The token is checked before each item, and (item, ct) selectors receive it.
  • Selector exceptions propagate. They are not converted to errors.
  • SequenceAsync awaits every task, even after a failed Result or a faulted task. Only the first exception is rethrown, after all tasks have completed (like Task.WhenAll).
  • On cancellation SequenceAsync stops waiting at once. The remaining tasks of a materialized collection (ICollection<T>/IReadOnlyCollection<T>) are observed, so a later fault does not surface as an unobserved task exception. Lazy sources are not enumerated further, because that would start new work.
  • Overloads: Func<T, Task<Result<U>>> and Func<T, CancellationToken, Task<Result<U>>> on all targets; the ValueTask selector twins are available on .NET 9+. SequenceAsync accepts IEnumerable<Task<Result<T>>> and IEnumerable<ValueTask<Result<T>>>.

TapIf: conditional side effects

Result<int> result = 42;

// Runs only on success when the predicate is true
result.TapIf(v => v > 10, v => logger.LogInformation("Large value: {Value}", v));

// Async variants
await result.TapIfAsync(v => v > 10, async v => await AuditAsync(v));
await result.TapIfAsync(isEnabled, async v => await TrackAsync(v));

// Works on Task<Result<T>> and ValueTask<Result<T>>
await GetResultAsync().TapIfAsync(v => v > 0, v => Enqueue(v));

Upgrading to 8.0

Deserializing a failure without errors

A failed result must carry at least one error, and deserialization now enforces that. JSON with "IsFailure": true (for Result) or "IsSuccess": false (for Result<T>) and a missing, null or empty errors array throws JsonException. Earlier versions read {"IsFailure":true} as a success and "errors":[] as a failure whose FirstError and ToString() threw.

Payloads written by this library already include the flag and the errors. Check hand-written or third-party payloads: a Result<T> success must include "IsSuccess": true, because a missing flag reads as false, and every failure needs at least one error.

Cancellation in async operations

Async operations that take a CancellationToken and wait on a task source (MapAsync, BindAsync, TapAsync, MatchAsync, EnsureAsync, ThenAsync, TryAsync and the rest) wait through Core WithCancellation, which is Task.WaitAsync on the .NET 9, 10 and 11 targets. When the token is cancelled while they wait, they throw TaskCanceledException, a subclass of OperationCanceledException, instead of OperationCanceledException itself. A catch (OperationCanceledException) still catches it; an exact type check no longer matches. The netstandard2.1 asset is unchanged.

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 (11)

Showing the top 5 NuGet packages that depend on CSharpEssentials.Results:

Package Downloads
CSharpEssentials

A comprehensive C# library enhancing functional programming capabilities with type-safe monads (Maybe, Result), discriminated unions (Any), and robust error handling. Features include: domain-driven design support, enhanced Entity Framework integration, testable time management, JSON utilities, and LINQ extensions. Built for modern C# development with focus on maintainability, testability, and functional programming principles.

CSharpEssentials.EntityFrameworkCore

Enhances Entity Framework Core with functional programming patterns and DDD-friendly features. Includes base entity classes, soft delete support, audit trails, query filters, optimistic concurrency, PostgreSQL integration, query performance monitoring, and domain event handling. Perfect for building maintainable and scalable data access layers in modern .NET applications.

CSharpEssentials.AspNetCore

A comprehensive ASP.NET Core library that enhances functional programming capabilities in web applications. Features include API versioning, global exception handling with enhanced problem details, enum binding and wire formats, model validation, optimized JSON handling, and seamless integration with CSharpEssentials core functional patterns (Result, Maybe, Rule Engine). Perfect for building robust, maintainable, and type-safe web APIs following functional programming principles. OpenAPI documents come from CSharpEssentials.AspNetCore.OpenApi or CSharpEssentials.AspNetCore.Swashbuckle.

CSharpEssentials.Maybe

Maybe monad implementation with LINQ support for functional programming in C#. Provides type-safe null handling, eliminates null reference exceptions, and enables functional composition. Essential for functional programming patterns and safe value handling.

CSharpEssentials.Entity

Domain-driven design (DDD) entity base classes and patterns for CSharpEssentials. Provides EntityBase<TId> with soft delete functionality, audit trails, and domain event integration. Essential for building robust domain models with type safety and functional programming principles.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
8.0.0 502 11/9/2026
7.0.0 514 10/20/2026
6.5.2 471 10/10/2026
6.5.1 440 10/10/2026
6.5.0 463 10/9/2026
6.4.0 457 10/9/2026
6.3.0 451 10/8/2026
6.2.0 452 10/8/2026
6.1.0 464 10/7/2026
6.0.0 449 10/7/2026
5.2.1 461 10/7/2026
5.2.0 452 10/7/2026
5.1.0 468 10/7/2026
5.0.0 461 10/6/2026
4.1.0 437 10/6/2026
4.0.0 438 10/5/2026
3.2.3 657 5/31/2026
3.2.2 489 5/31/2026
3.2.1 457 5/31/2026
3.2.0 433 5/30/2026
Loading failed