And i have one interface
public interface IMethod
{
String Add(string str);
Boolean Update(string str);
Boolean Delete(int id);
}
I have declared another Interface Like this
which has IMethod as property.
public interface IFoo
{
IMethod MethodCaller { get ; set; }
}
Now I gone implement IFoo interface in my one of class and from which i want to call IMethods method.
Class implementation
public MyClass : IFoo
{
public IMethod MethodCaller{ get ; set; }
}
How do i do it ? how do i call Add Update Delete method from MyClass
MyClasses that implement IMethod as follows :
public class foo1:IMethod
{
public String Add(string str){ return string.Empty;}
Boolean Update(string str){//defination}
Boolean Delete(int id){ //defination}
}
public class foo2:IMethod
{
public String Add(string str){ return string.Empty;}
Boolean Update(string str){//defination}
Boolean Delete(int id){ //defination}
}
Inside a class:
Outside: