diff --git a/README.md b/README.md index 5e729e4..3cb8a2e 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,58 @@ -![logo](./assets/logo.png) +

CSharpHelperExtensions

-# CSharpHelperExtensions +

+ A set of commonly used C# extension methods that reduce boilerplate across four focused namespaces: value checks, string manipulation, collection operations, and dictionary helpers. +

-A set of commonly used C# extension methods that reduce boilerplate across four focused namespaces: value checks, string manipulation, collection operations, and dictionary helpers. +

+ .NET build status + + + +

-[![.NET](https://github.com/rbipin/dry-extensions-csharp/actions/workflows/dotnet.yml/badge.svg)](https://github.com/rbipin/dry-extensions-csharp/actions/workflows/dotnet.yml) +CSharpHelperExtensions logo + +--- + +## Overview + + +CSharpHelperExtensions is a lightweight NuGet package of extension methods for values, strings, enumerables, and dictionaries — designed to cut down boilerplate you'd otherwise hand-write on every project. + + + +Most C# codebases end up with the same small helpers rewritten over and over: null-safe string checks, safe parsing, membership tests, batching, and dictionary lookups with fallbacks. Keeping these scattered across projects means copy-pasting and re-testing the same logic repeatedly. + +CSharpHelperExtensions exists to centralize these common patterns into one dependency-light, well-tested package, split across four focused namespaces so you only import what you need. + + +--- + +## Features + + +| | | +|---|---| +| **Values** | `In` (SQL-style membership), `IsBetween` (four inclusive/exclusive modes), `ToJson` | +| **Strings** | 50+ null-safe, parsing, transformation, whitespace, comparison, prefix/suffix, and encoding helpers | +| **Enumerable** | Presence checks, materialization, async projection, partitioning, batching, conditional mutation | +| **Dictionaries** | Safe lookup, add-if-missing, merging, bulk add, in-place filtering, read-only views | +| **Interactive samples** | Four `.NET Interactive` notebooks covering every namespace with runnable examples | + + +--- + +## Tech Stack + + +| Layer | Technology | +|---|---| +| Language / Runtime | C# on `net10.0` | +| Testing | xUnit + Shouldly | + + +--- ## Installation @@ -23,6 +71,8 @@ Import the namespace for the extensions you need: | `CSharpHelperExtensions.Enumerable` | All `IEnumerable` and collection extensions | | `CSharpHelperExtensions.Dictionaries` | All `IDictionary` extensions | +--- + ## Interactive Samples The `sample/` folder contains three [.NET Interactive](https://github.com/dotnet/interactive) notebooks you can run directly in VS Code (with the [Polyglot Notebooks](https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.dotnet-interactive-vscode) extension) or Jupyter. @@ -42,6 +92,8 @@ Each notebook loads the compiled DLL and imports the relevant namespace in its * | [`sample/enumerable-extension.ipynb`](sample/enumerable-extension.ipynb) | `CSharpHelperExtensions.Enumerable` | All collection methods: presence checks, materialization, async projection, partitioning, batching, conditional mutation, and chaining pipelines | | [`sample/dictionary-extensions.ipynb`](sample/dictionary-extensions.ipynb) | `CSharpHelperExtensions.Dictionaries` | All dictionary methods: safe lookup, add-if-missing, merging, bulk add, in-place filtering, read-only views, and chaining pipelines | +--- + ## Usage ### Values @@ -151,6 +203,8 @@ config.RemoveWhere(k => k.StartsWith("internal.")); // returns same dict for IReadOnlyDictionary view = DictionaryExtensions.AsReadOnly(dict); ``` +--- + ## Building and Testing ```bash @@ -166,3 +220,11 @@ dotnet test --verbosity normal # Run a specific test dotnet test --filter "FullyQualifiedName~MethodName" ``` + +--- + +## License + +Licensed under the [MIT License](LICENSE). + +Copyright (c) 2026 Bipin Radhakrishnan (https://github.com/rbipin/CSharpHelperExtensions)