Sunday, 29 September 2013

implement multiple interfaces in C#

implement multiple interfaces in C#

In my program, I have defined a couple of interfaces, like IInterface1,
IInterface2, IInterface3, IInterface4, IInterface5, if I need implement
all five interfaces in a concrete class, do you implement those interface
directly like the following
public class EntityClass: IInterface1,IInterface2, *** IInterface5
{
}
or would you create an interface which inherits from those interface
firstly, and then implement that interface?
public interface IEntity: IInterface1,IInterface2, *** IInterface5
{
}
public class EntityClass:IEntity
{
}

No comments:

Post a Comment