Searchable Generic

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Bob Ross
    New Member
    • Jan 2007
    • 119

    Searchable Generic

    I have recently been looking into using generics to hold collections of objects as I like the type safe features they provide. But I want to be able to store objects with a key for easy finding. Which is the best object to do this? Is it a dictionary?
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    Dictionary<stri ng, object>, is that what you are referring to?

    Comment

    • Frinavale
      Recognized Expert Expert
      • Oct 2006
      • 9749

      #3
      Have you looked into using LINQ?

      Comment

      • Bob Ross
        New Member
        • Jan 2007
        • 119

        #4
        I was referring to Generic.Diction ary(Of String, Object)

        I have had a brief look at LINQ but I think to implement it would require an overhaul of the site somewhat. It doesn't seem to make sense to use it only in one place.
        Also the objects I am building are not from database tables but from settings defined as committed text in the stored procedures. Which I don't think LINQ would be any good for.

        Comment

        • Frinavale
          Recognized Expert Expert
          • Oct 2006
          • 9749

          #5
          Originally posted by Bob Ross
          I was referring to Generic.Diction ary(Of String, Object)

          I have had a brief look at LINQ but I think to implement it would require an overhaul of the site somewhat. It doesn't seem to make sense to use it only in one place.
          Also the objects I am building are not from database tables but from settings defined as committed text in the stored procedures. Which I don't think LINQ would be any good for.
          LINQ isn't just for database stuff, it lets you use SQL like commands on your objects too. The demonstrations I've seen are really cool...but I haven't tried it in any of my applications yet.

          Anyway, have you looked at using a Hash Table?
          Hash tables let you store objects with a key....

          Comment

          Working...