var container = new UnityContainer(); container.RegisterType(); IMyService myService = container.Resolve ();
var container = new UnityContainer(); container.RegisterTypeIn this example, two named instances of IMyService are registered with the UnityContainer. The Resolve() method is called twice to retrieve instances of the IMyService interface using the specified names. The Microsoft.Practices.Unity package is available on Nuget, and it can be installed using the Nuget Package Manager in Visual Studio or via command line using the Nuget CLI tool.("Svc1"); container.RegisterType ("Svc2"); IMyService myService = container.Resolve ("Svc1"); IMyService myOtherService = container.Resolve ("Svc2");