public static void Main()
IUnityContainer container = new UnityContainer();
container.RegisterType<IPedal, Speeder>("Speeder");
container.RegisterType<IPedal, Brake>("Brake");
container.RegisterType<Car>(new InjectionConstructor(new ResolvedParameter<IPedal>("Brake")));
container.RegisterType<Motorcycle>(new InjectionConstructor(new ResolvedParameter<IPedal>("Speeder")));
Car car = container.Resolve<Car>();
Motorcycle motorcycle = container.Resolve<Motorcycle>();
public class Brake : IPedal
public class Speeder : IPedal
Console.WriteLine(pedal.Engage());
public Motorcycle(IPedal pedal)
Console.WriteLine(pedal.Engage());