Skip to content
Peter Csajtai edited this page Feb 11, 2016 · 33 revisions

Stashbox is a lightweight, portable dependency injection framework for .NET based solutions.

##Features

  • Fluent interface - for faster and easier configuration.
  • Child container - scopes can be managed with child containers with automatic fallback to parent when required.
  • Lifetime scopes - including singleton and transient scope, custom lifetimes also can be used.
  • Conditional resolution - attribute and parent-type based conditions can be specified.
  • IDisposable object tracking - disposable objects are being disposed by the container when needed.
  • Special types - including IEnumerable, arrays, Lazy<T> and open generic types.
  • Custom resolvers - the built-in resolution operations can be extended by custom resolvers.
  • Container extensions - the functionality of the container can be extended by custom extensions.

##Supported platforms

  • .NET 4.5 and above
  • Windows 8/8.1/10
  • Windows Phone Silverlight 8/8.1
  • Windows Phone 8.1
  • Xamarin (Android/iOS/iOS Classic)

Sample usage

class Wulfgar : IBarbarian
{
    public Drizzt(IWeapon weapon)
    {
        //...
    }
}

container.RegisterType<IWeapon, AegisFang>();
container.RegisterType<IBarbarian, Wulfgar>();

var wulfgar = container.Resolve<IBarbarian>();