Found 5 packages
Decorate your controllers with ExplicitDisposeAttribute to automatically dispose objects via ActionFilterAttribute.OnActionExecuted.
Decorate your controllers with ExplicitDisposeAttribute to automatically dispose objects via ActionFilterAttribute.OnActionExecuted.
Fork of Janitor.Fody that wants to be more explicit.
Provides the basis for implementing the Ambient Context pattern. Includes a Clock implementation based on it. 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. The pattern optimizes code reachability at the cost of reduced transparency, making it suitable for obvious, ubiquitous, rarely-changing dependencies. For example, an entity's constructor can access Clock.UtcNow, avoiding the need to inject the creation datetime or a dependency, at the cost of hiding the fact that a unit test could control the timestamp from the outside. An example from .NET 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. https://github.com/TheArchitectDev/Architect.AmbientContexts Release notes: 2.0.1: - Updated dependencies to the latest versions and removed some unused dependencies. 2.0.0: - BREAKING: ClockScope no longer has a configurable default scope. (See also next item). - BREAKING: Removed explicit support for "configured default scopes", i.e. scopes configured on startup. They posed too many concurrency risks, such as in test runs. (Default scopes without any configuration are still supported.) - BREAKING: Removed the RemoveAmbientScope() method. Deactivate() should be used instead. - Added support for netstandard2.0. - ClockScope's constructor now prefers UTC datetimes, to avoid lossy conversions (due to DST). - ClockScope now exposes a convenience constructor that takes a DateTime instead of a Func<DateTime>. 1.1.1: - Manually disposing scopes from a deeper async level (such as a DisposeAsync() method with the async keyword) now properly affects methods up the call stack and no longer breaks scope nesting. - Improved the protections against race conditions. - Parent properties are no longer unset on disposal (although implementations should not rely on this detail). - Performance improvement: A scope now avoids even instantiating its AsyncLocal as long as only its default scope is used, as is common in production for certain scopes. - Performance improvement: The JIT can now inline more code, since exceptions have been moved into helper methods. 1.1.0: - Introduced non-generic AmbientScope base class. - Performance improvement: A scope now avoids touching its AsyncLocal as long as only its default scope is used, as is common in production for certain scopes.
RentedMemory is a library that builds on ArrayPool to make it explicit that you are using a rented array and adds some functionality. Includes: - RentedMemory is a readonly struct wrapper around ArrayPool used kinda like dispose pattern. - RentedMemoryBuilder is a StringBuilder alternative with zero allocation (pooled) and works on any struct. - RentedObjects is a lightweight objectpool where you create the objects yourself.