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-RC4
dotnet add package Architect.AmbientContexts --version 1.0.0-RC4
<PackageReference Include="Architect.AmbientContexts" Version="1.0.0-RC4" />
paket add Architect.AmbientContexts --version 1.0.0-RC4
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Architect.AmbientContexts:
Reliable unique ID generation for distributed applications. This package provides highly tuned tools for ID generation and 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. We can do better. - For a 93-bit UUID replacement that is efficient as a primary key and has virtually no caveats, use the DistributedId. - For a 64-bit UUID replacement that is extremely efficient as a primary key, use the Fluid. - To expose IDs externally in a sensitive environment where zero metadata must be leaked, transform them with PublicIdentities. - To assign a unique ID to each distinct application or instance thereof, use an ApplicationInstanceIdSource. https://github.com/TheArchitectDev/Architect.Identities
This package is not used by any popular GitHub repositories.