I have a doubt on how to call the method of particular interface (Say IA or IB or In...) in the following code. Please help me on how to call. I have commented the lines of
To call an explicit interface method, you need to use a variable of the proper type, or directly cast to that interface:
static void Main() { Model m = new Model(); // Set to IA IA asIA = m; asIA.Display(); // Or use cast inline ((IB)m).Display(); Console.ReadLine(); }