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 96821
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T23:53:12+00:00 2026-05-10T23:53:12+00:00

Does someone knows if it’s possible to dynamically create a call chain and invoke

  • 0

Does someone knows if it’s possible to dynamically create a call chain and invoke it?

Lets say I have two classes A & B:

public class A     public function Func() as B         return new B()     end function end class  public class B    public function Name() as string       return 'a string';    end function end class 

I want to be able to get MethodInfo for both Func() & Name() and invoke them dynamically so that I can get a call similar to A.Func().Name().

I know I can use Delegate.CreateDelegate to create a delegate I can invoke from the two MethodInfo objects but this way I can only call the two functions separately and not as part of a call chain.

I would like two solutions one for .NET 3.5 using expression tree and if possible a solution that is .NET 2.0 compatible as well

  • 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. 2026-05-10T23:53:13+00:00Added an answer on May 10, 2026 at 11:53 pm

    Are you using .NET 3.5? If so, it should be relatively straightforward to build an expression tree to represent this. I don’t have enough expression-tree-fu to easily write the relevant tree without VS open, but if you confirm that it’s an option, I’ll get to work in notepad (from my Eee… hence the lack of VS).

    EDIT: Okay, as an expression tree, you want something like (C# code, but I’m sure you can translate):

    // I assume you've already got fMethodInfo and nameMethodInfo. Expression fCall = Expression.Call(null, fMethodInfo); Expression nameCall = Expression.Call(fCall, nameMethodInfo); Expression<Func<string>> lambda = Expression.Lambda<Func<string>>(nameCall, null); Func<string> compiled = lambda.Compile(); 

    This is untested, but I think it should work…

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

Sidebar

Ask A Question

Stats

  • Questions 68k
  • Answers 68k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer As a general rule, avoid TopMost unless you absolutely must… May 11, 2026 at 12:06 pm
  • added an answer If you want to determine what character you will get… May 11, 2026 at 12:06 pm
  • added an answer In Objective-C, the 'init' method is just a method. Unlike… May 11, 2026 at 12:06 pm

Related Questions

Does someone knows if it's possible to dynamically create a call chain and invoke
Does someone know if it is possible to modify the JVM settings at runtime
Does anyone know of any documentation by MS or someone else that lays out
Does someone have any tips/advice on database design for a web application? The kind
I just started to read about this new technology... Does someone have some knowledge
Can someone please explain what the & does in the following: class TEST {
Does Google force employees who have offers from Facebook to leave immediately?
Does anyone remember the XMP tag? What was it used for and why was
Does the Java language have delegate features, similar to how C# has support for
Does anybody know any good resources for learning how to program CIL with in-depth

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.