Method ToHashSet
- Namespace
- Open.Database.Extensions
- Assembly
- Open.Database.Extensions.Core.dll
ToHashSet(IEqualityComparer<T>?)
Reads every mapped row into a new HashSet<T>.
public HashSet<T> ToHashSet(IEqualityComparer<T>? comparer = null)
Parameters
comparerIEqualityComparer<T>The comparer for the rows, or null to use the default comparer.
Returns
- HashSet<T>
A set of the distinct rows. Rows that compare equal to an earlier row are dropped.
Remarks
All rows are buffered in memory before the call returns. Use Read(Action<IEnumerable<T>>) to process very large results as a stream.
- See Also
-
ToArray<T>(IMappedQuery<T>)