Skip to content

Commit

Permalink
NET core target to return IReadonlySet for freeze (#233)
Browse files Browse the repository at this point in the history
  • Loading branch information
JR-Morgan authored Feb 17, 2025
1 parent 87ae033 commit 358680c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Speckle.Sdk.Dependencies/Collections.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@ namespace Speckle.Sdk.Dependencies;

public static class Collections
{
public static IReadOnlyCollection<T> Freeze<T>(this IEnumerable<T> source) => source.ToFrozenSet();
#if NET5_0_OR_GREATER
public static IReadOnlySet<T> Freeze<T>(this IEnumerable<T> source)
#else
public static IReadOnlyCollection<T> Freeze<T>(this IEnumerable<T> source)
#endif
{
return source.ToFrozenSet();
}

public static IReadOnlyDictionary<TKey, TValue> Freeze<TKey, TValue>(
this IEnumerable<KeyValuePair<TKey, TValue>> source
Expand Down

0 comments on commit 358680c

Please sign in to comment.