CommunityToolkit / CommunityToolkit/dotnet
Provide `Guard.IsNotNullOrEmpty` for collection types
- Dominant language
- C#
- Stars
- 3.8k
- Forks
- 400
- PR merge metrics
- No merged PRs in 30d
Description
### Overview
`Guard` provides `IsNotEmpty` overloads for many collection types. It should also provide `IsNotNullOrEmpty` overloads.
### API breakdown
```cs
public static class Guard
{
public static void IsNotNullOrEmpty(ICollection collection, [CallerArgumentExpression("collection")] string name = "");
// Also other overloads like already exist for 'IsNotEmpty'.
}
```
### Usage example
`Guard.IsNotNullOrEmpty(myCollection);`
### Breaking change?
No
### Alternatives
```cs
Guard.IsNotNull(myCollection);
Guard.IsNotEmpty(myCollection);
```
### Additional context
_No response_
### Help us help you
No, just wanted to propose this
Contributor guide
Assessment
This issue has not been assessed yet.