How could I access I1 and I2 interfaces methods through I3 interface. I want to implement I3 in TestIt class (public class TestIt:I3). Do not want to implement I1 and I2 (public class TestIt:I1,I2).
My code is as below...
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
/// <summary>
/// Summary description for TestIt
/// </summary>
public class TestIt:I3
{
public TestIt()
{
//
// TODO: Add constructor logic here
//
//TestItB tb = new TestItB();
}
public int abc()
{
return 10;
}
int I1.A1()
{
return 20;
}
void I2.A1()
{
int j = 0;
}
}
public interface I1
{
int A1();
}
public interface I2
{
void A1();
}
public interface I3 : I1, I2
{
}
And I try to call A1 method as below...
I3 t = new TestIt();
int i = t.A1();
above is throw error...
I do not want to create object as blow...
I1 t = new TestIT();
or
I2 t = new TestIT();