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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T09:53:45+00:00 2026-06-07T09:53:45+00:00

Possible Duplicate: Duplicate keys in .NET dictionaries? I need to create a Collection<string,object> ,

  • 0

Possible Duplicate:
Duplicate keys in .NET dictionaries?

I need to create a Collection<string,object>, one is a string and another one is an object.
I cannot use Dictionary since none of items is unique.

Is there any way to create List<T,T> ? Since i don’t want to create an object to hold both values just to use it in single foreach loop.

Thanks

  • 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-07T09:53:48+00:00Added an answer on June 7, 2026 at 9:53 am

    Try List<Tuple<string, object>>. Then you can get the usual linq support over the list to get at each Tuple<string, object>.

    The Tuple<,> class is available as of .NET 4 onwards, but you can easily mimick a tuple type of your own without too much hassle.

    I think that tuples are considered equal based on their item values, but with object this would likely be reference equals and thus shouldn’t likely be equal… if that made any sense!

    More info on equality here:

    Surprising Tuple (in)equality

    Update:

    If you need to associate a list of items with a key for the purposes of a lookup, the duplicate question answer correctly highlights the Lookup class (in your case, Lookup<string, object>), which would express your intent a little clearer than a List<Tuple<string, object>>.

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

Sidebar

Related Questions

Possible Duplicate: Duplicate keys in .NET dictionaries? I want to use a kind of
Possible Duplicate: Duplicate keys in .NET dictionaries? I want to use a kind of
Possible Duplicate: python dict.add_by_value(dict_2) ? My input is two dictionaries that have string keys
Possible Duplicate: How do I make a dictionary with multiple keys to one value?
Possible Duplicate: Dictionary sorting by key length I need to use dictionary for search
Possible Duplicate: How can I convert String to Int? public List<int> GetListIntKey(int keys) {
Possible Duplicate: Python dictionary: are keys() and values() always the same order? If i
Possible Duplicate: In what order does python display dictionary keys? There was this very
Possible Duplicate: How to efficiently count the number of keys/properties of an object in
Possible Duplicate: How to efficiently count the number of keys/properties of an object in

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.