Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
b977664
feat(enumerable): add HasAny, OrEmpty, None
rbipin May 28, 2026
f74d4c5
style: fix test indentation for HasAny, OrEmpty, None tests
rbipin May 28, 2026
28d8219
feat(enumerable): add WhereNotNull, AsReadOnlyList, ToHashSetSafe
rbipin May 28, 2026
40ee94d
feat(enumerable): add Yield, JoinAsString, WithIndex
rbipin May 28, 2026
326d26f
feat(enumerable): add ToDictionarySafe
rbipin May 28, 2026
5baff6b
feat(enumerable): add AddIf, AddRangeIf
rbipin May 28, 2026
9eef11a
feat(enumerable): add ConcatIf
rbipin May 28, 2026
e7a96e6
feat(enumerable): add None(predicate), IsSingle, IndexOf
rbipin May 28, 2026
6576703
feat(enumerable): add Partition, Batch
rbipin May 28, 2026
a75ead5
feat(enumerable): add MinByOrDefault, MaxByOrDefault
rbipin May 28, 2026
5630a3e
feat(enumerable): add SelectAsync, WhenAllList
rbipin May 28, 2026
6bb43d2
style: remove unnecessary using, simplify collection expressions in S…
rbipin May 28, 2026
7cfd86b
feat(enumerable): add enumerable-extension.ipynb sample notebook; lin…
rbipin May 28, 2026
b84baaa
docs(samples): add chaining examples section to both notebooks
rbipin May 28, 2026
a8d8073
reviewing and fixing things up
rbipin May 28, 2026
13fa54d
fixing the AddBraces warning
rbipin May 28, 2026
91317be
editorconfig fixes
rbipin May 28, 2026
b454a2d
enumerable extension plan
rbipin May 28, 2026
1872ecc
update value extensions
rbipin May 28, 2026
019ffb6
Merge branch 'main' into Enumerable-extn
rbipin May 29, 2026
9552045
move the solution file
rbipin May 29, 2026
ba1031b
fix the solution folder path
rbipin May 29, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ jobs:
with:
dotnet-version: 10.0.x
- name: Restore dependencies
run: dotnet restore
run: dotnet restore src/CSharpHelperExtensions.slnx
- name: Build
run: dotnet build --no-restore
run: dotnet build src/CSharpHelperExtensions.slnx --no-restore
- name: Test
run: dotnet test --no-build --verbosity normal
run: dotnet test src/CSharpHelperExtensions.slnx --no-build --verbosity normal
6 changes: 3 additions & 3 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ The library splits extensions across three namespaces — callers must import th

| File | Namespace | Key types |
|------|-----------|-----------|
| `GenericExtensions.cs` | `CSharpHelperExtensions` | `In`, `IsNullOrEmpty` (string), `IsBetween`, `ToJson` |
| `ValueExtensions.cs` | `CSharpHelperExtensions.Values` | `In`, `IsBetween`, `ToJson` |
| `EnumerableExtensions.cs` | `CSharpHelperExtensions.Enumerable` | `IsNullOrEmpty<T>`, `HasAny`, `None`, `CleanNullOrEmptyItems`, `WhereNotNull`, `ContainsOnly`, `AreEqual`, `ForEach`, `Reduce`, `SelectAsync`, `WhenAllList`, `Partition`, `Batch`, `MinByOrDefault`, `MaxByOrDefault`, `ToDictionarySafe`, `AddIf`, `AddRangeIf`, `ConcatIf`, `IsSingle`, `IndexOf`, `Yield`, `WithIndex`, `JoinAsString`, `AsReadOnlyList`, `ToHashSetSafe`, `OrEmpty` |
| `StringExtensions.cs` | `CSharpHelperExtensions.Strings` | `IsNullOrEmpty`, `HasValue`, `OrEmpty`, `OrDefault`, `Truncate`, `Reverse`, `TrimToLower`, `TrimToUpper`, `ToTitleCase`, `ToSlug`, `MaskStart`, `EqualsIgnoreCase`, `ContainsIgnoreCase`, `StartsWithIgnoreCase`, `EndsWithIgnoreCase`, `EnsurePrefix`, `EnsureSuffix`, `TrimPrefix`, `TrimSuffix`, `SplitNonEmpty`, `JoinWith`, `ReplaceMany`, `RemoveWhitespace`, `CollapseWhitespace`, `RemoveDiacritics`, `IsNumeric`, `IsAlpha`, `IsAlphaNumeric`, `ToNullable<T>`, `ToIntOrNull`, `ToDecimalOrNull`, `ToDateTimeOrNull`, `ToGuidOrNull`, `ToBoolOrNull`, `Base64Encode`, `Base64Decode`, `ToBase64Url`, `FromBase64Url`, `ToUtf8Bytes`, `ToUtf8Stream` |

`IsNullOrEmpty` exists in **both** `GenericExtensions` (for `string`) and `EnumerableExtensions` (for `IEnumerable<T>`). Be careful about which namespace is imported.
`IsNullOrEmpty` exists in **both** `StringExtensions` (for `string`, namespace `CSharpHelperExtensions.Strings`) and `EnumerableExtensions` (for `IEnumerable<T>`, namespace `CSharpHelperExtensions.Enumerable`). Be careful about which namespace is imported.

### `BetweenComparison` enum

Defined in `GenericExtensions.cs`, controls how `IsBetween` handles bounds:
Defined in `ValueExtensions.cs` (namespace `CSharpHelperExtensions.Values`), controls how `IsBetween` handles bounds:
- `None` (default) — inclusive on both ends
- `ExcludeBoth` — exclusive on both ends
- `ExcludeLower` — excludes lower bound, includes upper
Expand Down
4 changes: 0 additions & 4 deletions CSharpHelperExtensions.slnx

This file was deleted.

9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@ Don't Repeat Yourself Extensions

A set of helper extension methods that are used very often when coding

## Namespaces

| Namespace | Methods |
|---|---|
| `CSharpHelperExtensions.Values` | `In`, `IsBetween`, `ToJson` |
| `CSharpHelperExtensions.Enumerable` | All `IEnumerable<T>` extensions |
| `CSharpHelperExtensions.Strings` | All `string` extensions |

1. _**In() Method**_

Checks to see if a item is part of the quick list
Expand Down Expand Up @@ -67,6 +75,7 @@ The item being compared needs to be comparable (IComparable<T>)

Usage
```c#
// using CSharpHelperExtensions.Values;
decimal value = 3;
decimal lower = 1;
decimal upper = 3;
Expand Down
Loading
Loading