diff --git a/Extensions/CommonExtensions.cs b/Extensions/CommonExtensions.cs index 5d1fca6..e3b272e 100644 --- a/Extensions/CommonExtensions.cs +++ b/Extensions/CommonExtensions.cs @@ -1054,6 +1054,26 @@ namespace xCommons.Extensions return source; } + /// + /// Converts an Enumerable to HashSet ... + /// + /// + /// + /// + public static HashSet ToHashSet(this IEnumerable source) + { + // + var result = new HashSet(); + if (source.IsNull()) + { + return result; + } + + // + result = [.. source]; + return result; + } + /// /// Select and Retrieve Nth Childs of given List ... ///