{"id":19099988,"url":"https://github.com/ardalis/Ardalis.Extensions","last_synced_at":"2025-04-18T17:32:28.766Z","repository":{"id":43783442,"uuid":"384493537","full_name":"ardalis/Ardalis.Extensions","owner":"ardalis","description":"Some random C# extension methods I've found useful. Published as Ardalis.Extensions on Nuget.","archived":false,"fork":false,"pushed_at":"2023-11-21T20:48:39.000Z","size":1372,"stargazers_count":160,"open_issues_count":6,"forks_count":36,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-04-05T10:33:40.646Z","etag":null,"topics":["ardalis","csharp","dotnet","extension-methods","extensions","hacktoberfest"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ardalis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-07-09T16:26:31.000Z","updated_at":"2025-01-10T15:47:30.000Z","dependencies_parsed_at":"2025-04-05T10:41:31.386Z","dependency_job_id":null,"html_url":"https://github.com/ardalis/Ardalis.Extensions","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ardalis%2FArdalis.Extensions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ardalis%2FArdalis.Extensions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ardalis%2FArdalis.Extensions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ardalis%2FArdalis.Extensions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ardalis","download_url":"https://codeload.github.com/ardalis/Ardalis.Extensions/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249524959,"owners_count":21285915,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ardalis","csharp","dotnet","extension-methods","extensions","hacktoberfest"],"created_at":"2024-11-09T03:52:25.137Z","updated_at":"2025-04-18T17:32:28.226Z","avatar_url":"https://github.com/ardalis.png","language":"C#","funding_links":[],"categories":["csharp","hacktoberfest"],"sub_categories":[],"readme":"[![NuGet](https://img.shields.io/nuget/v/Ardalis.Extensions.svg)](https://www.nuget.org/packages/Ardalis.Extensions)\n[![NuGet](https://img.shields.io/nuget/dt/Ardalis.Extensions.svg)](https://www.nuget.org/packages/Ardalis.Extensions)\n[![publish Ardalis.Extensions to nuget](https://github.com/ardalis/Ardalis.Extensions/actions/workflows/publish.yml/badge.svg)](https://github.com/ardalis/Ardalis.Extensions/actions/workflows/publish.yml)\n\n# Ardalis.Extensions\nSome random C# extension methods I've found useful. Published as Ardalis.Extensions on Nuget.\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n   - [String checks](#string-checks)\n- [Conventions for Contributors](#conventions-for-contributors)\n- [Benchmarks](#benchmarks)\n- [Roadmap](#roadmap)\n\n## Installation\n\nJust add a reference the the package and then anywhere you want to use the extensions, add the appropriate `using` statement.\n\n```powershell\ndotnet add package Ardalis.Extensions\n```\n\n## Usage\n\n### String Checks\n\nIsNull() checks whether a given string is null.\n\n```csharp\n// replace\nif(someString is null)\n\n// with\nif(someString.IsNull())\n```\n\nIsNullOrEmpty() checks whether a given string is null or empty.\n\n```csharp\n// replace\nif(String.IsNullOrEmpty(someString))\n\n// with\nif(someString.IsNullOrEmpty())\n```\n\nIsNullOrWhiteSpace checks whether a given string is null or empty or consists of only whitespace characters.\n\n```csharp\n// replace\nif(String.IsNullOrWhiteSpace(someString))\n\n// with\nif(someString.IsNullOrWhiteSpace())\n```\n\n## Conventions for Contributors\n\n- Extension methods are grouped into folders based on similar purpose.\n- Folder nesting should match class namespaces.\n  - `Ardalis.Extensions.Parsing`\n  -  `Ardalis.Extensions.Encoding.Base64`\n- One extension method class per folder.\n- Extension methods classes should have an `Extensions` suffix.\n- Classes should be made [partial](https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/partial-classes-and-methods#partial-classes).\n- One extension method per file.\n- Overloads should be placed in the same file.\n- File names should be the contained extension method's name.\n- Tests should be provided for each extension method and overload.\n- Test classes should have a `Tests` suffix.\n- Benchmark classe should have a `Benchmarks` suffix.\n\n## Benchmarks\n\nTo run all of the benchmarks, run the following command from the benchmarks project folder:\n\n```ps\ndotnet run -c Release\n```\n\n## Roadmap\n\nFor now as I gather different useful extensions there is a single [Ardalis.Extensions](https://www.nuget.org/packages/Ardalis.Extensions) package available on NuGet. Once there are more than a few, I will most likely break up the extensions into separate individual NuGet packages (for example: Ardalis.StringExtensions? Ardalis.Extensions.Strings?) and then the original Ardalis.Extensions would become a meta-package that would pull in all of the separate smaller packages.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fardalis%2FArdalis.Extensions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fardalis%2FArdalis.Extensions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fardalis%2FArdalis.Extensions/lists"}