This package provides the basis for implementing the Ambient Context pattern.
The Ambient Context pattern is an Inversion of Control (IoC) pattern that provides static access to a dependency while controlling the dependency from the outside.
A good example is System.Transactions.TransactionScope. Any code (such as the database connector) can access the static Transaction.Current, yet outer code in the current execution flow controls it, through TransactionScopes.
By inheriting from AmbientScope, a class can become an ambient scope much like TransactionScope. When code is wrapped in such a scope (with the help of a using statement), any code inside the scope can statically access that ambient scope.
The AmbientScope base class provides fine-grained control over scope nesting (by obscuring, combining, or throwing) and supports registration of a ubiquitous default scope.
The implementation honors logical execution flows and is async-safe.
See the version list below for details.
Install-Package Architect.AmbientContexts -Version 1.0.0-RC3
dotnet add package Architect.AmbientContexts --version 1.0.0-RC3
<PackageReference Include="Architect.AmbientContexts" Version="1.0.0-RC3" />
paket add Architect.AmbientContexts --version 1.0.0-RC3
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Architect.AmbientContexts:
This package provides tools for ID management. Auto-increment IDs reveal sensitive information. UUIDs (also known as GUIDs) are inefficient as primary keys in a database. Having two different IDs is cumbersome and counterintuitive. - For a 96-bit UUID replacement that is *efficient as a primary key* and has *virtually no caveats*, use **CompanyUniqueId**. - For a 64-bit UUID replacement that is *extremely efficient as a primary key* but *requires dependency registration and a synchronization mechanism*, use **Fluid**. - To expose IDs externally in a sensitive environment *where zero metadata can be leaked*, transform them with **PublicIdentities**. - To assign a unique ID to each distinct application or instance thereof, use an **ApplicationInstanceIdSource**.
This package is not used by any popular GitHub repositories.