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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T14:45:49+00:00 2026-06-10T14:45:49+00:00

Somewhere inside my function I need to do something like that: smsg[isin].set(ii.ISIN); smsg[client_code].set(Constants.CLIENT_CODE); smsg[type].set(1);

  • 0

Somewhere inside my function I need to do something like that:

        smsg["isin"].set(ii.ISIN);
        smsg["client_code"].set(Constants.CLIENT_CODE);
        smsg["type"].set(1);
        smsg["dir"].set(order.Operation == Side.Buy ? 1 : 2);
        smsg["amount"].set(order.Lots);
        smsg["price"].set(textPrice);
        smsg["ext_id"].set(0);

set method has a lot of overloads it can accept int, string, boolean, DateTime etc. totally about 15 methods.

After refactoring I decided function to use just list of parameters ignoring other variables order ii etc. The problem is that I don’t know how can I transfer this parameters via function arguments

    public uint ExecuteTransaction(Dictionary<string, object> parameters)
    {
        ....
        foreach (var parameter in parameters)
        {
            smsg[parameter.Key].set(parameter.Value);  // compile time error!
        }

Compiler doesn’t know which overload to use and so I have such error:

The best overloaded method match has some invalid arguments

My Dictionary contains appropiate value for each parameter. So boolean parameters contain boolean value etc. That’s why I declared Dictionary to contain general type object.

Thanks for your help!

  • 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-10T14:45:50+00:00Added an answer on June 10, 2026 at 2:45 pm

    You should implement the set(object value) method which will determine parameter type and call typed set(T value). This is only way to use set in this maner.

    Upd: if you haven’t access to set as it a library you can write extension method

    public static class Ext
    {
      public static void set(this YOUR_LIB_TYPE lib, object value)
      {
        if(value is int)
        {
          lib.set((int) value);
        }
        else if(value is string)
        {
          lib.set((string) value);
        }
        ...
      }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know that if I am inside some function foo() which is called somewhere
I remember seeing somewhere that you could call python methods from inside C using
I have a function that allows me to drag a something around. My js:
I read somewhere that i need to dispose objects when closing the application ?
i ve created two dimensional array inside a function, i want to return that
This function doesn't work and I can't find the problem, which is somewhere inside
Somewhere I did something silly. I was deploying my Rails app via cloning the
For everyone that was thinking of the error_reporting() function, then it isn't, what I
Imagine a lightbox with a beautiful picture inside it and a button somewhere near
I'm want to put a tableView inside a UIViewController, because I need a toolbar

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.