// Author: simon.gockner // Created: 2019-05-20 // Copyright(c) 2019 SimonG. All Rights Reserved. using System; using LightweightIocContainer.Interfaces.Installers; using LightweightIocContainer.Interfaces.Registrations; namespace LightweightIocContainer.Interfaces { /// /// The main container that carries all the s and can resolve all the types you'll ever want /// public interface IIocContainer : IDisposable { /// /// Install the given installers for the current /// /// The given s /// An instance of the current IIocContainer Install(params IIocInstaller[] installers); /// /// Register an Interface with a Type that implements it /// /// The Interface to register /// The Type that implements the interface /// The for this /// The created IDefaultRegistration Register(Lifestyle lifestyle = Lifestyle.Transient) where TImplementation : TInterface; /// /// Register multiple interfaces for a that implements them /// /// The base interface to register /// A second interface to register /// The that implements both interfaces /// The for this /// The created IMultipleRegistration Register(Lifestyle lifestyle = Lifestyle.Transient) where TImplementation : TInterface2, TInterface1; /// /// Register a without an interface /// /// The to register /// The for this /// The created ISingleTypeRegistration Register(Lifestyle lifestyle = Lifestyle.Transient); /// /// Register an Interface with a Type that implements it as a multiton /// /// The Interface to register /// The Type that implements the interface /// The Type of the multiton scope /// The created IMultitonRegistration RegisterMultiton() where TImplementation : TInterface; /// /// Register an Interface as an abstract typed factory /// /// The abstract typed factory to register /// The created ITypedFactoryRegistration RegisterFactory(); /// /// Register an Interface with an as a callback that is called when is called /// /// The Interface to register /// The for the callback /// The created [Obsolete("RegisterUnitTestCallback is deprecated, use `WithFactoryMethod()` from ISingleTypeRegistration instead.")] IUnitTestCallbackRegistration RegisterUnitTestCallback(ResolveCallback unitTestCallback); /// /// Gets an instance of the given /// /// The given /// An instance of the given T Resolve(); /// /// Gets an instance of the given /// /// The given /// The constructor arguments /// An instance of the given T Resolve(params object[] arguments); /// /// Clear the multiton instances of the given from the registered multitons list /// /// The to clear the multiton instances void ClearMultitonInstances(); /// /// Is the given registered with this /// /// The given /// True if the given is registered with this , false if not bool IsTypeRegistered(); } }