Esox.SharpAndRusty.EntityFrameworkCore 1.0.1

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

Esox.SharpAndRusty.EntityFrameworkCore

Entity Framework Core integration for Esox.SharpAndRusty.

License

This project is licensed under the MIT License. See LICENSE.txt.

Disclaimer

This package is provided "as is" without warranty of any kind.

  • Exception mapping is best-effort and provider-specific details can vary.
  • DbError classification may differ between SQL Server, SQLite, PostgreSQL, and other providers.
  • You should still validate behavior in your own environment, especially for constraint handling and retry logic.
  • This package does not replace transactional design, idempotency, or proper database observability in production systems.

What it adds

  • FirstOrNoneAsync() and SingleOrNoneAsync() to return Option<T> instead of nullable entities.
  • ExecuteSafeAsync() and SaveChangesSafeAsync() to return Result<T, DbError> instead of throwing for common EF/SQL failures.

Quick example

using Esox.SharpAndRusty.EntityFrameworkCore.Extensions;

var userOption = await dbContext.Users
    .Where(x => x.Email == email)
    .SingleOrNoneAsync(cancellationToken);

var saveResult = await dbContext.SaveChangesSafeAsync(cancellationToken);

Notes

  • Option<T> methods are constrained to entity reference types (where T : class).
  • ExecuteSafeAsync() maps DbUpdateException, DbUpdateConcurrencyException, SqlException, timeout, cancellation, and query failures into DbError.
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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. 
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
1.0.1 80 5/23/2026