The answer to this question really depends on how you have implemented your interfaces in the class. In other words, have you explicitly and/or implicitly implemented the interfaces. Let's consider a simple example:
public interface IFoo
{
void SetName(string name);
int Age { get; set; }
}
public interface IBar
{
void SetName(string name);
DateTime DOB { get; set; }
}
public class FooBar : IFoo, IBar
{
public void SetName(string name)
{
Console.WriteLine("Name is " + name);
}
public int Age
{
get
{
throw new NotImplementedException();
}
set
{
throw new NotImplementedException();
}
}
void IBar.SetName(string name)
{
Console.WriteLine("IBar Name is " + name);
}
DateTime IBar.DOB
{
get
{
throw new NotImplementedException();
}
set
{
throw new NotImplementedException();
}
}
}
Now, let's call this like this:
IFoo foo = new FooBar();
foo.SetName("Foo");
IBar bar = new FooBar();
bar.SetName("Bar");
This would produce the output
Name is Foo
IBar Name is Foo
Now, if we don't use the interface to in the instantiation, the explicit implementation is called.
FooBar fooBar = new FooBar();
fooBar.SetName("FooBar");
This produces
Name is FooBar
Okay, so you may be tempted to think that the order of the interfaces in the declaration determines which one is the explicit and which one is the implicit declaration. This is not correct. Let's change our class a bit
public class FooBar : IFoo, IBar
{
public void SetName(string name)
{
Console.WriteLine("Name is " + name);
}
int IFoo.Age
{
get
{
throw new NotImplementedException();
}
set
{
throw new NotImplementedException();
}
}
void IFoo.SetName(string name)
{
Console.WriteLine("IFoo Name is " + name);
}
public DateTime DOB
{
get
{
throw new NotImplementedException();
}
set
{
throw new NotImplementedException();
}
}
}
Now, calling the same code as we did above, we see that the output has changed like this:
IFoo Name is Foo
Name is Bar
Name is FooBar
As you can see, IBar is now the explicit implementation.