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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T21:57:10+00:00 2026-05-17T21:57:10+00:00

I was having a discussion with a co-worker over whether it is better to

  • 0

I was having a discussion with a co-worker over whether it is better to use a Dictionary and repopulate it whenever a result set changes or to just use linq loop over all elements in the list each time.

We’re trying to map a parent / child relationship, and I suggested using the ParentID as the dictionary key, and the dictionary value as the custom object.

We will usually be needing to iterate over all parent / children and run down the list.

Is there any reason why you wouldn’t want to use a Dictionary in this circumstance? if so what would you use instead

  • 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-17T21:57:11+00:00Added an answer on May 17, 2026 at 9:57 pm

    If you really do need to iterate over the whole collection every time, there would not be much (if any) benefit to having a Dictionary. On the other hand, if you occasionally need to locate specific instances by their keys, Dictionary could be what you need.

    Note that even if you are using a Dictionary, you can still just iterate through the list of Values when needed, for not too much more ‘weight’ than iterating through a normal List, but then you’d still have the Dictionary capabilities, if needed.

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

Sidebar

Related Questions

We've been having a discussion at work about whether to use Domain Objects in
I was having a discussion with a colleague of mine. We use Linq to
I am having a discussion with a friend over whether to show or not
I was having a discussion at our office whether to use Hibernate or not.
I've been having a discussion with my coworkers as to whether to prefix overridden
We're having this discussion here. Which is better and why? 1) a php file
I was having a discussion about this with a co-worker and we couldn't come
My friends were having discussion on nested lists of objects in LINQ and when
A co-worker and I are having a discussion about WFC services when the topic
I was having a discussion with coworkers. We have to implement some security standards.

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.