0

Are the following data structures almost same ?

ILookup<int, string>  vs.  Dictionary<int, IEnumerable<string>>
A.B.
  • 2,374
  • 3
  • 24
  • 40
  • Yes they would be similar / same. But ILookup is an interface. – paparazzo Jun 29 '16 at 12:07
  • 1
    The main difference is in the implementation: the current default Lookup (created with `ToLookup()`) implementation of the item indexer `[]` will return an empty enumeration if the key is not found, where a dictionary will throw an exception. Of course since ILookup is an interface, it's up to the implementation how this is handled. – Me.Name Jun 29 '16 at 12:09

0 Answers0