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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T16:44:22+00:00 2026-05-22T16:44:22+00:00

I need to return a list of two values. I tried Dictionary but the

  • 0

I need to return a list of two values.
I tried Dictionary but the first parameter is the key and in my case it will repeat.
My list needs to return something like this:

Manager – John Zambers

Developer – Paul Myers

Developer – John Zambers

Tester – Mary Marie

etc… – etc…

I dont want to create my own class to represent this list.
Dot.Net have a built in Type that represent it? Somethink like List()?

Thanks in advance.

  • 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-22T16:44:23+00:00Added an answer on May 22, 2026 at 4:44 pm

    You could use the System.Tuple<T1, T2> class, e.g,:

    List<Tuple<String, String>> people = new List<Tuple<String, String>>();
    people.Add(Tuple.Create("Manager", "John Zambers"));
    // etc.
    

    However, what’s wrong with creating your own class? They can be almost self-documenting, especially in a simple case like this (e.g, it’s obvious what’s going to be in the Name field). For example:

    public class Person
    {
       public string Role { get; set; }
       public string Name { get; set; }
    }
    

    Side note: I don’t know your application domain or what all the possible roles/titles you have, but if you’re doing any sort of processing based on this value it looks like a good place to use an enum instead. E.g.,

    public enum Roles
    {
        Manager,
        Developer,
        Tester
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a function that returns two values in a list. Both values need
I need to copy two linked lists recursively and return a new list .
I need to return a list of counties, but I need to filter out
Given a list I need to return a list of lists of unique items.
I'm working on a project in wich I need to return a list of
I need to return an a generic list in the correct order for my
I am using ObjectContext.ExecuteStoreQuery to return a list of entities, about 30K. I need
Maybe somebody could help me. I need a two methods. The first should open
public static Dictionary<string,List<LookupItem>> dict; if (dict == null) { dict = IsolatedStorage.GetDropDowns(); return dict[Priority]
I have two different collections: List<int> IEnumerable<IDataRecord> The first contains a list of primary

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.