Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Dictionary object in .Net

Dictionary object in .Net

Scheduled Pinned Locked Moved ASP.NET
csharpquestion
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    Tina P
    wrote on last edited by
    #1

    What could be the possible situations/scenarios when you want to have a dictionary object within dictionary? Meaning a dictionary object which would take another dictionary as its key. private Dictionary<Dictionary<string, string>, string> myDictionary = new Dictionary<Dictionary<string, string>, string> ; I mean, I'm trying to go through some code and its doing that, I am new to such complicated data structures such as ditionaries....and this doesnt even look like a common way most people use it. Post people would have a string key and a string value ( or interger or something). can someone elaborate on this? Thanks a lot Tina

    C 1 Reply Last reply
    0
    • T Tina P

      What could be the possible situations/scenarios when you want to have a dictionary object within dictionary? Meaning a dictionary object which would take another dictionary as its key. private Dictionary<Dictionary<string, string>, string> myDictionary = new Dictionary<Dictionary<string, string>, string> ; I mean, I'm trying to go through some code and its doing that, I am new to such complicated data structures such as ditionaries....and this doesnt even look like a common way most people use it. Post people would have a string key and a string value ( or interger or something). can someone elaborate on this? Thanks a lot Tina

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      What does this have to do with ASP.NET ? you would use it, if you need it. If you have no clear need, don't do it. Why are you asking ?

      Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

      T 1 Reply Last reply
      0
      • C Christian Graus

        What does this have to do with ASP.NET ? you would use it, if you need it. If you have no clear need, don't do it. Why are you asking ?

        Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

        T Offline
        T Offline
        Tina P
        wrote on last edited by
        #3

        I'm not sure what you meant...this is all done from a ASP .net page and that's why the questions was published in this section. Please educate me if there's a separate location pertaiing to questions regarding such data structures and their use. Now my question is that I'm not familiar with Dictionary data structure, so I'm not sure how is stuff functioning in the code that I'm looking at right now written by someone else with no cmments or documentation... I googled it quite a bit, but no one appear to be using Dictionary in a way that either its key or the value element are another DIctionary object. Can anyone please share their experience if they've used it or are familiar with it. Thanks Tina

        C 1 Reply Last reply
        0
        • T Tina P

          I'm not sure what you meant...this is all done from a ASP .net page and that's why the questions was published in this section. Please educate me if there's a separate location pertaiing to questions regarding such data structures and their use. Now my question is that I'm not familiar with Dictionary data structure, so I'm not sure how is stuff functioning in the code that I'm looking at right now written by someone else with no cmments or documentation... I googled it quite a bit, but no one appear to be using Dictionary in a way that either its key or the value element are another DIctionary object. Can anyone please share their experience if they've used it or are familiar with it. Thanks Tina

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          Tina P wrote:

          this is all done from a ASP .net page and that's why the questions was published in this section

          But it's not related to ASP.NET, it's just vanilla C#, it could be in any C# project.

          Tina P wrote:

          Please educate me if there's a separate location pertaiing to questions regarding such data structures and their use

          C# forum for general C# questions

          Tina P wrote:

          Now my question is that I'm not familiar with Dictionary data structure, so I'm not sure how is stuff functioning in the code that I'm looking at right now written by someone else with no cmments or documentation...

          OK, well, that's another question. You have a dictionary, and when you look up a key, the value you get back is another dictionary. So, you could use this, for example, to create a grid, look up x first, then y. Of course, you'd usually use a 2D array for that, but the point is, to get to the data you want, you obvously need to look up two values, not one. It's just a dictionary, twice. You provide two keys to get to the end value.

          Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups