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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T06:39:03+00:00 2026-06-10T06:39:03+00:00

I know that it was asked for Reflection on ExpandoObjects here before. My question

  • 0

I know that it was asked for Reflection on ExpandoObjects here before.

My question is a little different. I have static and dynamic functions which should be executed from some function similar to object ExecuteFunction(string name, params object[] parameters).

I execute the static functions via Reflection. So the question is, if I can reuse the MethodInfo call and get a MethodInfo object from the ExpandoObject? Or do I have to implement 2 functions (One with Action and one with MethodInfo)?

  • 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-10T06:39:05+00:00Added an answer on June 10, 2026 at 6:39 am

    You won’t get any MethodInfo for the dynamically defined methods on an ExpandoObject.
    Dynamically defined methods are the same as dynamically defined properties, they just happen to be of a delegate type.

    However, this delegate type contains a property named Method of type MethodInfo which you can utilize:

    object ExecuteFunction(IDictionary<string, object> obj, string name,
                           params object[] parameters)
    {
        object property;
        if(!obj.TryGetValue(name, out property))
            return null;
    
        var del = property as Delegate;
        if(del == null)
            return null;
    
        var methodInfo = del.Method;
    
        // do with methodInfo what you need to do to invoke it.
        // This should be in its own method so you can call it from both versions of your
        // ExecuteFunction method.
    }
    

    Please note that the first parameter is of type IDictionary<string, object>. ExpandoObject implements this interface, and we need no other features from ExpandoObject, so the parameter is just of the type of the implemented interface we need the functionality of.

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

Sidebar

Related Questions

I know that this sort of question has been asked here before, but still
I know that similar questions have already been asked here before, but they all
I know that this question must have been asked and answered a million times,
I know that this question had already been asked a couple of times before,
I know that similar questions have been asked before, but I am very much
I know that this question have been asked several times. But I can't get
I know that this question might have been asked like 100 times, but, believe
I know that this question has been asked loads of times, but I have
I know that variations on this question have been asked, but I've tried all
I know that similar question was asked here : Running SOAP and RESTful on

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.