Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6683713
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:51:13+00:00 2026-05-26T04:51:13+00:00

And i have one interface public interface IMethod { String Add(string str); Boolean Update(string

  • 0

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}
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T04:51:13+00:00Added an answer on May 26, 2026 at 4:51 am

    Inside a class:

    public MyClass : IFoo   
    {
       public void CallAllMethodsOfIIMethodImpl()
       {
           if (this.MethodCaller != null)
           {
              this.MethodCaller.Add( ... );
              this.MethodCaller.Delete( ... );
              this.MethodCaller.Update( ... );
           }
       }
    }
    

    Outside:

    MyClass instance = new MyClass();
    if (instance.MethodCaller != null)
    {
       instance.MethodCaller.Add( ... );
       instance.MethodCaller.Delete( ... );
       instance.MethodCaller.Update( ... );
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'd like to have one interface for all my grid related tasks.The tasks implement
i have one interface /// <summary> /// Summary description for IBindable /// </summary> public
I've one interface which has following method signatures: public interface ITag { int M_Id
Suppose you have an interface like this: public interface IDoSomething<out T> { T DoSomething(object
I have an interface similar to the one below: public interface IInterface<T> where T
I have an IIdentifiable interface: public interface IIdentifiable { int Id { get; set;
Let's say I have a long established repository like this: interface IDonutRepository { public
I have my own ITrigger . Basically, it looks like the below: public interface
I Have a Base Interface Like this public interface IHRMISBaseConnector { IHRMISEmployeeConnector EmployeeConnector {
I have 2 C# interfaces like this: public interface IEvernoteJobListener { void CopyS3File(S3Location src,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.