CommunityToolkit / CommunityToolkit/dotnet
Guard add support System.Collections.Immutable
- Dominant language
- C#
- Stars
- 3.8k
- Forks
- 400
- PR merge metrics
- No merged PRs in 30d
Description
### Overview
Guard IsNotEmpty not support ImmutableArray
### API breakdown
```csharp
namespace CommunityToolkit.Diagnostics;
partial class Guard
{
public static void IsNotEmpty(ImmutableArray collection, [CallerArgumentExpression("collection")] string name = "")
public static void IsNotEmpty(ImmutableHashSet collection, [CallerArgumentExpression("collection")] string name = "")
public static void IsNotEmpty(ImmutableList collection, [CallerArgumentExpression("collection")] string name = "")
public static void IsNotEmpty(ImmutableQueue collection, [CallerArgumentExpression("collection")] string name = "")
public static void IsNotEmpty(ImmutableSortedSet collection, [CallerArgumentExpression("collection")] string name = "")
public static void IsNotEmpty(ImmutableStack collection, [CallerArgumentExpression("collection")] string name = "")
public static void IsNotEmpty(ImmutableDictionary collection,
[CallerArgumentExpression("collection")] string name = "") where TKey : notnull
}
public static void IsNotEmpty(ImmutableSortedDictionary collection,
[CallerArgumentExpression("collection")] string name = "") where TKey : notnull
}
```
### Usage example
```csharp
using CommunityToolkit.Diagnostics;
public class Foo
{
public void Test(ImmutableArray values)
{
Guard.IsNotEmpty(values);
}
}
```
### Breaking change?
No
### Alternatives
no
### Additional context
_No response_
### Help us help you
Yes, I'd like to be assigned to work on this item
Contributor guide
Assessment
This issue has not been assessed yet.