NPv.ExecutionContext.Abstractions 1.0.1

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

NPv.ExecutionContext.Abstractions

Minimal execution context contract for .NET applications.
Provides a unified abstraction to access the current user identity inside business logic, without direct dependency on ASP.NET Core or transport-specific details.


✨ Provided Interfaces

Interface Purpose
IUserContext Represents the current user identity (ID, name, authentication state)
namespace NPv.ExecutionContext;

public interface IUserContext
{
    Guid GetCurrentUserId();
    string? GetUserName();
    bool IsAuthenticated { get; }
}

🔧 Use Cases

  • Clean separation of user identity from transport layer
  • Enable testable and framework-agnostic business logic
  • Consistent access to the current user in APIs, background workers, or tests

📦 NuGet

dotnet add package NPv.ExecutionContext.Abstractions

Author's Note

This library grew out of my long-standing personal interest in structuring and publishing open source packages. Over time, I’ve revisited and refined earlier internal utilities and ideas, giving them a more consistent shape and preparing them for wider reuse. Along the way, I’ve also taken the opportunity to explore how open source distribution and licensing work in the .NET ecosystem.

It’s a small step toward something I’ve always wanted to try — sharing practical, minimal tools that reflect years of learning, experimentation, and refinement.

Hopefully, someone finds it useful.

Nikolai 😛


⚖️ License

MIT — free for commercial and open-source use.

Product Compatible and additional computed target framework versions.
.NET 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 was computed.  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.
  • net9.0

    • No dependencies.

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 161 8/24/2025