I’m looking for suitable .NET class that allows me to store a large number of custom records and then look for a record instance.
To be more concrete, the record class has 3 Properties and I will use alwas one of them to look for an instance. The ammount of instances to be stored will be up to 100.000.
I know about HastSetOf(MyRecord> used with custom IEqualityComarer. The propblem is that at the lookup operation I will know only one of the record’s props and will actually need the other 2 prop values.
Should I need a DictionaryOf(string, Record) or is there a faster one?
Thank you in advance!
Use the Dictionary class. In this case, you’ll need three Dictionaries: one for each property that you’re indexing by. If the properties are not unique, you’ll want to use a Lookup instead.