MBUtils 0.1.1
dotnet add package MBUtils --version 0.1.1
NuGet\Install-Package MBUtils -Version 0.1.1
<PackageReference Include="MBUtils" Version="0.1.1" />
<PackageVersion Include="MBUtils" Version="0.1.1" />
<PackageReference Include="MBUtils" />
paket add MBUtils --version 0.1.1
#r "nuget: MBUtils, 0.1.1"
#:package MBUtils@0.1.1
#addin nuget:?package=MBUtils&version=0.1.1
#tool nuget:?package=MBUtils&version=0.1.1
MBUtils
A small utility library for .NET with focused, reusable building blocks.
Installation
MBUtils is published as a NuGet package.
- Package ID:
MBUtils - Current version:
0.1.0 - Target frameworks:
net8.0,netstandard2.0
Install using your preferred method, for example:
dotnet add package MBUtils --version 0.1.0
Design Patterns
Command Pattern
A Command pattern utility with a thread-safe command queue and optional undo/redo support, available for both synchronous and asynchronous commands.
Key Features:
- Thread-safe command queue
- Undo/Redo support
- Synchronous and asynchronous commands
- FIFO execution order
- Comprehensive unit tests
Builder Pattern
A Builder pattern implementation with fluent interface support, validation, state tracking, and async capabilities.
Key Features:
- Fluent interface with method chaining
- Built-in validation framework
- State tracking to prevent misuse
- Async/await support with cancellation tokens
- Director pattern for reusable construction algorithms
- Comprehensive unit tests
Singleton Pattern
An opinionated Singleton helper providing a thread-safe, lazy-initialized base class suitable for global, single-instance services.
Key Features:
- Thread-safe lazy initialization using
Lazy<T> - Optional
OnInstanceCreated()hook for post-construction initialization ResetInstance()support for testing scenarios
Strategy Pattern
A Strategy pattern implementation that models interchangeable algorithms as objects and supports both synchronous and asynchronous execution.
Key Features:
IStrategy<TContext, TResult>with sync and async execution methodsStrategyBase<TContext, TResult>to simplify concrete implementations and provide a default async behaviorCompositeStrategy<TContext, TResult>to compose/chain strategies when input and output types match- Explicit interface implementations and clear error handling
- Comprehensive unit tests
Observer Pattern
A thread-safe implementation of the Observer pattern supporting both synchronous and asynchronous observers.
Key Features:
- Thread-safe observer management with locking
- Support for both synchronous and asynchronous observers
SubjectBase<T>abstract base class for easy subject implementation- Snapshot notification to avoid issues during observer attachment/detachment
- Separate lists for sync and async observers
- Comprehensive unit tests
Factory Pattern
A Factory pattern implementation providing flexible, thread-safe object creation based on keys or configuration, with support for both synchronous and asynchronous initialization.
Key Features:
- Thread-safe keyed factory with registration and resolution
FactoryBase<TKey, T>for synchronous object creationAsyncFactoryBase<TKey, T>for asynchronous initialization scenarios- Custom
IEqualityComparer<TKey>support for flexible key matching - Dynamic registration and unregistration
- Comprehensive unit tests
Decorator Pattern
A Decorator pattern implementation providing dynamic addition of responsibilities to objects, supporting both synchronous and asynchronous decoration with composite chaining.
Key Features:
IDecorator<T>andIAsyncDecorator<T>for sync and async decoratorsDecoratorBase<T>andAsyncDecoratorBase<T>base classes for easy implementationCompositeDecorator<T>for chaining multiple decorators- Explicit interface implementations and null safety
- Support for cross-cutting concerns (logging, caching, validation, etc.)
- Comprehensive unit tests
Chain of Responsibility Pattern
A Chain of Responsibility pattern implementation that allows passing requests along a chain of handlers, where each handler decides either to process the request or to pass it to the next handler in the chain.
Key Features:
IHandler<TRequest>andIAsyncHandler<TRequest>for sync and async handlersHandlerBase<TRequest>andAsyncHandlerBase<TRequest>with template methodsHandlerChain<TRequest>andAsyncHandlerChain<TRequest>fluent builders- Early termination when a handler processes the request
- Support for middleware pipelines, validation chains, and event routing
- Comprehensive unit tests
Adapter Pattern
An Adapter pattern implementation that allows objects with incompatible interfaces to work together, supporting both synchronous and asynchronous adaptation.
Key Features:
IAdapter<TSource, TTarget>andIAsyncAdapter<TSource, TTarget>for sync and async adaptersAdapterBase<TSource, TTarget>andAsyncAdapterBase<TSource, TTarget>base classes- Type-safe with variance support (contravariant source, covariant target)
- Built-in null checking and template method pattern
- Cancellation support for async adapters
- Comprehensive unit tests
Facade Pattern
A Facade pattern implementation that provides a simplified interface to complex subsystems, supporting both synchronous and asynchronous operations.
Key Features:
IFacadeandIFacade<TResult>for sync facades with or without return valuesIAsyncFacadeandIAsyncFacade<TResult>for async facadesFacadeBaseandAsyncFacadeBasebase classes for easy implementation- Simplifies complex subsystem interactions with a unified interface
- Reduces coupling between client code and subsystem components
- Comprehensive unit tests
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. 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 was computed. 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. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- No dependencies.
-
net8.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 |
|---|