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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T01:57:30+00:00 2026-06-10T01:57:30+00:00

Currently i am having following function public int GetVariableValue(TaxReturn taxReturnObj, string identityKey) { int

  • 0

Currently i am having following function

  public int GetVariableValue(TaxReturn taxReturnObj, string identityKey)
    {
        int returnTypeOut = 0;
        if (taxReturnObj.Identity.ContainsKey(identityKey))
        {
            int.TryParse(taxReturnObj.Identity[identityKey], out returnTypeOut);
        }
        return returnTypeOut;
    }

To retrieve the value we are using following code,

e.g.

int valPayStatus = GetVariableValue(objTaxretrun, TaxReturnIdentity.aadata_identity_paystatus)

It was working fine untill now as All the Identity Values were Integer,but recently we have added New Identites with String and Boolean types.
So i want to make the above function as Generic…but i don’t know how to go about that,I tried to search on google but couldn’t find anything.

  • 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-10T01:57:31+00:00Added an answer on June 10, 2026 at 1:57 am
        public T GetVariableValue<T>(TaxReturn taxReturnObj, string identityKey) 
        { 
            if (taxReturnObj.Identity.ContainsKey(identityKey)) 
            { 
                return (T) Convert.ChangeType(taxReturnObj.Identity[identityKey], typeof(T));
            }
            else
            {
               return default(T);
            }
        } 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having the following (simplified) class: class Operator { private: std::map<std::string, std::unique_ptr<Operand>> op; public:
I'm currently having following error message when executing a .sql file with about 26MB
Hi currently I have a nested XMl , having the following Structure : <?xml
Hi I am currently having a problem with parsing an Xml string without any
I have the following issue with a Debug.Assert ine in a function public override
I'm currently having the following issue in my project: I'm using Core Data to
I have the following class... public class Product { public int Id { get;
I'm having some issues getting file uploads to work correctly and the following code
Currently having some problems- now = datetime.datetime.now() month = now.strftime(%B) site = wikipedia.getSite('en', 'wikiquote')
im currently having troubles on my codes in C#. I want to split strings

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.