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

  • SEARCH
  • Home
  • 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 8758405
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T14:32:22+00:00 2026-06-13T14:32:22+00:00

I have a method that I call multiple times, but each time a different

  • 0

I have a method that I call multiple times, but each time a different method with a different signature is called from inside.

public void MethodOne()
{
//some stuff

*MethodCall();

//some stuff

}

So MethodOne is called multiple times, each time with a different *MethodCall(). What I’m trying to do is something like this :

public void MethodOne(Func<> MethodCall)
{
//some stuff

*MethodCall;

//some stuff

}

but the Methods that are called each have a different return type and different parameters. Is there a way to do this using Functors? If not, how would I go about doing this?

Thank you!

  • 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-06-13T14:32:23+00:00Added an answer on June 13, 2026 at 2:32 pm

    You best bet would be to use the non-generic Action type (or MethodInvoker would be the same), i.e.

    public void MethodOne(Action callback)
    {
        //some stuff
    
        if(callback != null) callback();
    
        //some stuff
    }
    

    From this you can call any method by wrapping it at the caller, i.e.

    MethodOne(SimpleMethod); // SimpleMethod has no parameters and returns void
    MethodOne(() => MoreComplexMethod(1, "abc")); // this one returns void
    MethodOne(() => { MethodThatReturnsSomething(12); }); // anything you like
    

    etc

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a method that I call and it returns bitmap data from a
I have a function that needs to call a virtual method many times in
I'm attempting to build a method call from strings that have been passed into
My webservice constructor is getting called each time that I call a webmethod. This
Say I have a method that I wish to call which has an argument
I have several models that need to call a method that takes a particular
I have a method which I am trying to call dynamically. That method has
Let's say I have a subroutine/method that a user can call to test some
I need to implement a call to a method that I have in my
I currently have a method right now that looks like the following: public void

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.