using Microsoft.Practices.Unity;
namespace StudentsUserInterface
public static void Main()
IUnityContainer objContainer = new UnityContainer();
objContainer.RegisterType<Student>();
objContainer.RegisterType<StudentServer, WitsServer>();
objContainer.RegisterType<StudentServer, UjServer>();
Student obj =objContainer.Resolve<Student>();
obj.StudentName = "Vhudie";
private StudentServer myserver;
public string StudentName{get;set;}
public Student(StudentServer server)
public interface StudentServer
public class WitsServer : StudentServer
Console.WriteLine("Added to wits");
public class UjServer : StudentServer
Console.WriteLine("Added to UJ");