StructureMap is an old Ioc/di container that has been supported since 2004. NET 1.1.
An example of use
Create business Interface public interface Idispatchservice {} public interface Icourier {} public interface Ipaymentgateway {} public interface Ipaymentmerchant {}//Interface implementation public class Dispacthservice:idispatchservice {PR Ivate Icourier _courier; Public Dispacthservice (Icourier Courier) {_courier = Courier; } public override string ToString () {return _courier. ToString (); }} public class Fedexcourier:icourier {} public class Streamlinepaymentmerchant:ipaymentmerchant {} pub Lic class Paymentgateway:ipaymentgateway {private Ipaymentmerchant _paymentmerchant; Public Paymentgateway (Ipaymentmerchant paymentmerchant) {_paymentmerchant = paymentmerchant; } public override string ToString () {return _paymentmerchant.tostring (); }}//Business using public class OrderService {private Ipaymentgateway _payMentgateway; Private Idispatchservice _dispacthservice; Public OrderService (Ipaymentgateway Paymentgateway, Idispatchservice dispacthservice) {_paymentgateway = Paymentgateway; _dispacthservice = Dispacthservice; } public override string ToString () {return string. Format ("ipaymentgateway:{0} Idispatchservice:{1}", _paymentgateway.tostring (), _dispacthservice.tostring ()); }}//config dependency public class BootStrapper {public static void Configurestructuremap () { Objectfactory.initialize (x = x.addregistry<modelregistry> ()); }} public class Modelregistry:registry {public Modelregistry () {for<ipaymentgate Way> (). Use<paymentgateway> (); For<ipaymentmerchant> (). Use<streamlinepaymentmerchant> (); For<idispatchservice> (). Use<dispacthservice> (); for<icourier> (). Use<fedexcourier> (); }} class Program {static void Main (string[] args) {Bootstrapper.configurestructuremap ();//enable configuration OrderService OrderService = objectfactory.getinstance<orderservice> (); Console.WriteLine (Orderservice.tostring ()); Ipaymentgateway paymentgateway= objectfactory.getinstance<paymentgateway> (); Console.WriteLine (Paymentgateway); Console.readkey (); } }