I have a βtableβ in memory that might look something like this:
Favorite# Name Profession
--------- ---------- ------------------
3 Names.Adam Profession.Baker
9 Names.Bob Profession.Teacher
7 Names.Carl Profession.Coder
7 Names.Dave Profession.Miner
5 Names.Fred Profession.Teacher
And what I want to do is quickly and efficiently search using any of the three fields. In other words, I want:
myTable[3]
and myTable[Names.Adam]
and myTable[Professions.Baker]
all return{3,Names.Adam,Profession.Baker}
myTable[Profession.Teacher]
to return both {9,Names.Bob,Profession.Teacher}
, and {5,Names.Fred,Profession.Teacher}
.
The table is created at runtime, in accordance with the actions of the user, and cannot be stored in the database, since it is used in sections in which it is impossible to connect to the database.
"" (hah!) 3 uber-Dictionaries, (FavoriteNumber, Name, Profession), uber- 2 , ( uber- "" Dictionary<FavoriteNumber,Profession[]>
Dictionary<Profession, FavoriteNumber[]>
2 2 ( 1 2 .)
- ? , , , ( 20 ), , ...