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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T05:14:54+00:00 2026-06-03T05:14:54+00:00

Is there a way to add comments to document a Dictionary or ConcurrentDictionary to

  • 0

Is there a way to add comments to document a Dictionary or ConcurrentDictionary to know what the key / values mean?

For example:

Dictionary<guid, string> _users;

This example has a dictionary of users. The guid is the UserId and the string is the username, but it’s hard to tell other than just “knowing”.

Is there a way to add docs so that when you add items, intellisense tells the developer a note about the key & value?

I know I can add a <summary> comment above it and it puts that note in the object itself, but was looking for when adding, removing, etc.

  • 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-03T05:14:55+00:00Added an answer on June 3, 2026 at 5:14 am

    Recently in GOOS book I found interesting idea of packaging common types (such as collections) in own classes:

    Try to use the language of the problem you are working on, rather than the language of .Net constructs. It
    reduces conceptual gap between domain and code. Also try to limit
    passing around types with generics. This is a form of
    duplication. It’s a hint that there is domain concept that should be
    extracted to type.

    Frankly speaking I’m not so extremal in packaging common generic collections, but even giving a type own name makes it match easier to read and understand:

    public class UserNameDictionary : Dictionary<int, string>
    {
    }
    

    Very simple. And now what is better to read:

    Dictionary<int, string> users = new Dictionary<int, string>();
    UserNameDictionary users = new UserNameDictionary();
    

    Also you can quickly add comment to your class:

    /// <summary>
    /// Represents a dictionary of user names accessed by ids.
    /// </summary>
    

    This will not add comments to methods like Add(int, string), but when other people will use this class, they will think in context of UserNameDictionary, not in abstract Dictionary<int, string> context.

    If you want to make your class more handy, you can hide base class methods:

    public new void Add(int userId, string userName)
    {
        base.Add(userId, userName);
    }
    

    For more complex use cases I’d go with custom class which delegates work to internal dictionary.

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

Sidebar

Related Questions

Is there any way to add custom phpdoc annotation for Eclipse PDT? For example,
I created this regular expression to validate names: ^[a-zA-Z0-9\s\-\,]+.\*?$ Is there a way add
Is there any way to add a SQL Server Database Diagram to source control?
Is there any way to add validation (ie SSN) to a SharePoint field and
Is there a way to add a deployment administrator to Microsoft CRM 4.0 using
Is there any way to add fields to a DataSet which will be serialized
Is there a way to add styling to rails form_for and make it display
Is there any way to add a ActiveX control to a JPanel.
Is there a way to add up all of the positive numbers in a
Is there a way to add new methods to a class, without modifying original

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.