| name | csharpessentials-core |
| description | Use for low-level C# utility helpers — string case conversions (ToPascalCase/ToSnakeCase/ToKebabCase), URL-safe and v7 GUID generation, null-safe collection helpers (WhereNotNull, AddIf), and async cancellation utilities. |
CSharpEssentials.Core
Lightweight C# utility helpers. No functional patterns here — those live in the Results, Errors, Maybe, and Any skills.
Installation
dotnet add package CSharpEssentials.Core
Or the meta-package (includes Core + Results + Errors + Maybe + Any):
dotnet add package CSharpEssentials
Namespace
using CSharpEssentials.Core;
String Case Conversions
"helloWorld".ToPascalCase()
"HelloWorld".ToSnakeCase()
"HelloWorld".ToKebabCase()
"hello-world".ToCamelCase()
GUID Utilities
string id = Guider.NewGuid();
Guid id = Guider.NewGuidV7();
Null-Safe / Conditional Helpers
value.IfNotNull(v => process(v));
list.AddIf(condition, item);
IEnumerable<string> names = rawList.WhereNotNull();
await longRunningTask.WithCancellation(ct);
Best Practices
- Use
Guider.NewGuidV7() for database primary keys — time-sortable GUIDs reduce index fragmentation
WhereNotNull() is safer than .Where(x => x != null).Select(x => x!) — handles nullable annotations correctly
IfNotNull() is a statement form; for transforms use Maybe<T>.Map() instead