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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:37:56+00:00 2026-05-23T08:37:56+00:00

Probably something simple I overlooked how do I fix this? Note: compiler generates 0

  • 0

Probably something simple I overlooked how do I fix this?

Note: compiler generates 0 errors yet it doesn’t build

    /**
     * The action (optional object[] is the params)
     */
    private Action<object[]> action;

    /**
     * Parameters
     */
    private object[] parameters;

    public virtual void runAction() //<- this is overridable
    {
        action(parameters);
    }

    public void setAction(Action action)
    {
        this.action<null> = action<null>;
    }

    public void setAction(Action action, params object[] parameters)
    {
        this.parameters = this.parameters;
        this.action<parameters> = action<parameters>;
    }

Maybe there is a way I can make this even without object[] parameters even..

I call runAction outside this class. there are many classes like this in List all I call runAction method. I generate these classes on demend. This class contains a bunch more logic then just what you see.

Let me know thanks I appreciate the support.

  • 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-23T08:37:56+00:00Added an answer on May 23, 2026 at 8:37 am
    this.action<parameters> = action<parameters>;
    

    This is a mess. action isn’t a generic type or generic method, so this isn’t supplying a generic parameter (and anyway, generic parameters are types, not variables. You’re actually somehow using the less-than and greater-than relational operators? But parameters > ; doesn’t compare anything.

    The compiler is absolutely right not to let this build. It seems like this would be what you want:

    private Action action;
    
    public virtual void runAction()
    {
        action();
    }
    
    public void setAction(Action action)
    {
        this.action = action;
    }
    
    public void setAction(Action<object[]> action, params object[] parameters)
    {
        this.action = delegate { action(parameters) };
    }
    

    I recommend that you read about “closures”. You might find that this class you’re writing isn’t very useful at all.

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

Sidebar

Related Questions

This is probably something simple but it's driving me nuts. I'm making some pagination
This is probably something very simple but I'm not getting the results I'm expecting.
I've probably overlooked something simple, but I can't figure out how to convert a
This is probably something simple but I'm scratching my head over easing with the
This is probably something really simple that I am blind to see, but the
I'm probably missing something simple here, but I can't find the answer elsewhere. I
I am probably overlooking something really simple here but I am trying to redirect
I get the feeling this is probably something I should know but I can't
It's probably the tenth time I'm implementing something like this, and I've never been
Probably a really simple one this - I'm starting out with C# and need

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.