How do I use HashSet as a dictionary key?

后端 未结 3 618
名媛妹妹
名媛妹妹 2020-12-16 10:51

I wish to use HashSet as the key to a Dictionary:

Dictionary, TValue> myDictionary = new Dictionary

        
3条回答
  •  悲&欢浪女
    2020-12-16 10:52

    You can provide a IEqualityComparer> to the Dictionary constructor and make the desired implementation in that comparer.

提交回复
热议问题