How to convert linq results to HashSet or HashedSet

前端 未结 9 737
闹比i
闹比i 2020-11-28 05:17

I have a property on a class that is an ISet. I\'m trying to get the results of a linq query into that property, but can\'t figure out how to do so.

Basically, look

9条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-28 05:58

    This functionality has been added as an extension method on IEnumerable to .NET Framework 4.7.2:

    • ToHashSet(IEnumerable)
    • ToHashSet(IEnumerable, IEqualityComparer)

提交回复
热议问题