MBUtils 0.1.1

The owner has unlisted this package. This could mean that the package is deprecated, has security vulnerabilities or shouldn't be used anymore.
dotnet add package MBUtils --version 0.1.1
                    
NuGet\Install-Package MBUtils -Version 0.1.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="MBUtils" Version="0.1.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MBUtils" Version="0.1.1" />
                    
Directory.Packages.props
<PackageReference Include="MBUtils" />
                    
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 MBUtils --version 0.1.1
                    
#r "nuget: MBUtils, 0.1.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 MBUtils@0.1.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=MBUtils&version=0.1.1
                    
Install as a Cake Addin
#tool nuget:?package=MBUtils&version=0.1.1
                    
Install as a Cake Tool

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 methods
  • StrategyBase<TContext, TResult> to simplify concrete implementations and provide a default async behavior
  • CompositeStrategy<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 creation
  • AsyncFactoryBase<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> and IAsyncDecorator<T> for sync and async decorators
  • DecoratorBase<T> and AsyncDecoratorBase<T> base classes for easy implementation
  • CompositeDecorator<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> and IAsyncHandler<TRequest> for sync and async handlers
  • HandlerBase<TRequest> and AsyncHandlerBase<TRequest> with template methods
  • HandlerChain<TRequest> and AsyncHandlerChain<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> and IAsyncAdapter<TSource, TTarget> for sync and async adapters
  • AdapterBase<TSource, TTarget> and AsyncAdapterBase<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:

  • IFacade and IFacade<TResult> for sync facades with or without return values
  • IAsyncFacade and IAsyncFacade<TResult> for async facades
  • FacadeBase and AsyncFacadeBase base classes for easy implementation
  • Simplifies complex subsystem interactions with a unified interface
  • Reduces coupling between client code and subsystem components
  • Comprehensive unit tests
Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .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