I\'m trying to hold a list of items in a collection with a key of my choice. In Java, I would simply use Map as follows:
class Test { Map
class Test { Dictionary entities; public string GetEntity(int code) { // java's get method returns null when the key has no mapping // so we'll do the same string val; if (entities.TryGetValue(code, out val)) return val; else return null; } }