Say that your object has three properties codeA, codeB and codeC, you support three hash tables, for example:
Dictionary<string, MyObj> dictA, dictB, dictC;
When creating a new one, MyObjyou add it to three dictionaries:
dictA[obj.codeA] = obj;
dictB[obj.codeB] = obj;
dictC[obj.codeC] = obj;
The look is very simple. Your example will be encoded asdictA["149"].codeB
Keep everything in order in one big search class, of course.
source
share