{"id":21823455,"url":"https://github.com/f2calv/cascap.common","last_synced_at":"2026-05-27T14:11:50.019Z","repository":{"id":37884652,"uuid":"270056412","full_name":"f2calv/CasCap.Common","owner":"f2calv","description":".NET libraries of helper functions, extensions, utilities, abstract classes, etc...","archived":false,"fork":false,"pushed_at":"2026-04-17T23:20:29.000Z","size":817,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-18T01:29:19.867Z","etag":null,"topics":["caching-library","dotnet-standard","extension-methods"],"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/f2calv.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-06-06T17:41:32.000Z","updated_at":"2026-04-17T23:18:23.000Z","dependencies_parsed_at":"2023-11-16T04:29:00.335Z","dependency_job_id":"23cef163-53d1-480b-9413-168059fe3069","html_url":"https://github.com/f2calv/CasCap.Common","commit_stats":{"total_commits":125,"total_committers":7,"mean_commits":"17.857142857142858","dds":0.552,"last_synced_commit":"a3b8a328e4713b99f6ec0b98f34a055296ad822e"},"previous_names":[],"tags_count":104,"template":false,"template_full_name":null,"purl":"pkg:github/f2calv/CasCap.Common","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f2calv%2FCasCap.Common","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f2calv%2FCasCap.Common/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f2calv%2FCasCap.Common/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f2calv%2FCasCap.Common/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/f2calv","download_url":"https://codeload.github.com/f2calv/CasCap.Common/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f2calv%2FCasCap.Common/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32209897,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T03:15:14.334Z","status":"ssl_error","status_checked_at":"2026-04-24T03:15:11.608Z","response_time":64,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["caching-library","dotnet-standard","extension-methods"],"created_at":"2024-11-27T17:32:10.885Z","updated_at":"2026-05-27T14:11:50.013Z","avatar_url":"https://github.com/f2calv.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CasCap.Common\n\n[cascap.common.abstractions-badge]: https://img.shields.io/nuget/v/CasCap.Common.Abstractions?color=blue\n[cascap.common.abstractions-url]: https://nuget.org/packages/CasCap.Common.Abstractions\n[cascap.common.ai-badge]: https://img.shields.io/nuget/v/CasCap.Common.AI?color=blue\n[cascap.common.ai-url]: https://nuget.org/packages/CasCap.Common.AI\n[cascap.common.caching-badge]: https://img.shields.io/nuget/v/CasCap.Common.Caching?color=blue\n[cascap.common.caching-url]: https://nuget.org/packages/CasCap.Common.Caching\n[cascap.common.configuration-badge]: https://img.shields.io/nuget/v/CasCap.Common.Configuration?color=blue\n[cascap.common.configuration-url]: https://nuget.org/packages/CasCap.Common.Configuration\n[cascap.common.extensions-badge]: https://img.shields.io/nuget/v/CasCap.Common.Extensions?color=blue\n[cascap.common.extensions-url]: https://nuget.org/packages/CasCap.Common.Extensions\n[cascap.common.extensions.diagnostics.healthchecks-badge]: https://img.shields.io/nuget/v/CasCap.Common.Extensions.Diagnostics.HealthChecks?color=blue\n[cascap.common.extensions.diagnostics.healthchecks-url]: https://nuget.org/packages/CasCap.Common.Extensions.Diagnostics.HealthChecks\n[cascap.common.logging-badge]: https://img.shields.io/nuget/v/CasCap.Common.Logging?color=blue\n[cascap.common.logging-url]: https://nuget.org/packages/CasCap.Common.Logging\n[cascap.common.logging.serilog-badge]: https://img.shields.io/nuget/v/CasCap.Common.Logging.Serilog?color=blue\n[cascap.common.logging.serilog-url]: https://nuget.org/packages/CasCap.Common.Logging.Serilog\n[cascap.common.net-badge]: https://img.shields.io/nuget/v/CasCap.Common.Net?color=blue\n[cascap.common.net-url]: https://nuget.org/packages/CasCap.Common.Net\n[cascap.common.opentelemetry-badge]: https://img.shields.io/nuget/v/CasCap.Common.OpenTelemetry?color=blue\n[cascap.common.opentelemetry-url]: https://nuget.org/packages/CasCap.Common.OpenTelemetry\n[cascap.common.Serialization.json-badge]: https://img.shields.io/nuget/v/CasCap.Common.Serialization.Json?color=blue\n[cascap.common.Serialization.json-url]: https://nuget.org/packages/CasCap.Common.Serialization.Json\n[cascap.common.Serialization.messagepack-badge]: https://img.shields.io/nuget/v/CasCap.Common.Serialization.MessagePack?color=blue\n[cascap.common.Serialization.messagepack-url]: https://nuget.org/packages/CasCap.Common.Serialization.MessagePack\n[cascap.common.services-badge]: https://img.shields.io/nuget/v/CasCap.Common.Services?color=blue\n[cascap.common.services-url]: https://nuget.org/packages/CasCap.Common.Services\n[cascap.common.testing-badge]: https://img.shields.io/nuget/v/CasCap.Common.Testing?color=blue\n[cascap.common.testing-url]: https://nuget.org/packages/CasCap.Common.Testing\n\n![CI](https://github.com/f2calv/CasCap.Common/actions/workflows/ci.yml/badge.svg) [![Coverage Status](https://coveralls.io/repos/github/f2calv/CasCap.Common/badge.svg?branch=main)](https://coveralls.io/github/f2calv/CasCap.Common?branch=main) [![SonarCloud Coverage](https://sonarcloud.io/api/project_badges/measure?project=f2calv_CasCap.Common\u0026metric=code_smells)](https://sonarcloud.io/component_measures/metric/code_smells/list?id=f2calv_CasCap.Common)\n\nA .NET class library repository containing 14 NuGet packages with helper functions, extensions, utilities, AI integration, and abstract classes for .NET applications.\n\n| Library                                           | Package                                                                                                |\n| ------------------------------------------------- | ------------------------------------------------------------------------------------------------------ |\n| CasCap.Common.Abstractions                        | [![Nuget][cascap.common.abstractions-badge]][cascap.common.abstractions-url]                           |\n| CasCap.Common.AI                                  | [![Nuget][cascap.common.ai-badge]][cascap.common.ai-url]                                               |\n| CasCap.Common.Caching                             | [![Nuget][cascap.common.caching-badge]][cascap.common.caching-url]                                     |\n| CasCap.Common.Configuration                       | [![Nuget][cascap.common.configuration-badge]][cascap.common.configuration-url]                         |\n| CasCap.Common.Extensions                          | [![Nuget][cascap.common.extensions-badge]][cascap.common.extensions-url]                               |\n| CasCap.Common.Extensions.Diagnostics.HealthChecks | [![Nuget][cascap.common.extensions.diagnostics.healthchecks-badge]][cascap.common.extensions.diagnostics.healthchecks-url] |\n| CasCap.Common.Logging                             | [![Nuget][cascap.common.logging-badge]][cascap.common.logging-url]                                     |\n| CasCap.Common.Logging.Serilog                     | [![Nuget][cascap.common.logging.serilog-badge]][cascap.common.logging.serilog-url]                     |\n| CasCap.Common.Net                                 | [![Nuget][cascap.common.net-badge]][cascap.common.net-url]                                             |\n| CasCap.Common.OpenTelemetry                        | [![Nuget][cascap.common.opentelemetry-badge]][cascap.common.opentelemetry-url]                         |\n| CasCap.Common.Serialization.Json                  | [![Nuget][cascap.common.Serialization.json-badge]][cascap.common.Serialization.json-url]               |\n| CasCap.Common.Serialization.MessagePack           | [![Nuget][cascap.common.Serialization.messagepack-badge]][cascap.common.Serialization.messagepack-url] |\n| CasCap.Common.Services                            | [![Nuget][cascap.common.services-badge]][cascap.common.services-url]                                   |\n| CasCap.Common.Testing                             | [![Nuget][cascap.common.testing-badge]][cascap.common.testing-url]                                     |\n\n## Libraries\n\n| Library | Description | Targets | Packable |\n| ------- | ----------- | ------- | -------- |\n| [**CasCap.Common.Abstractions**](src/CasCap.Common.Abstractions/README.md) | Core interface definitions (`IAppConfig`, `IFeature\u003cT\u003e`, `ILocalCache`, `IEventSink\u003cT\u003e`, `INotifier`) | netstandard2.0; net8.0; net9.0; net10.0 | ✅ |\n| [**CasCap.Common.AI**](src/CasCap.Common.AI/README.md) | AI agent framework — multi-provider agent creation, session management, MCP tool/prompt resolution, chat history compaction | net10.0 | ✅ |\n| [**CasCap.Common.Caching**](src/CasCap.Common.Caching/README.md) | Distributed caching (cache-aside pattern) with Memory/Disk local cache, Redis remote cache, and optional distributed locking | netstandard2.0; net8.0; net9.0; net10.0 | ✅ |\n| [**CasCap.Common.Configuration**](src/CasCap.Common.Configuration/README.md) | Configuration bootstrapping — standard `IConfiguration` pipeline, Azure Key Vault, and validated `IOptions\u003cT\u003e` binding | netstandard2.0; net8.0; net9.0; net10.0 | ✅ |\n| [**CasCap.Common.Extensions**](src/CasCap.Common.Extensions/README.md) | Common extension methods and helper utilities | netstandard2.0; net8.0; net9.0; net10.0 | ✅ |\n| [**CasCap.Common.Extensions.Diagnostics.HealthChecks**](src/CasCap.Common.Extensions.Diagnostics.HealthChecks/README.md) | Custom health check extensions | netstandard2.0; net8.0; net9.0; net10.0 | ✅ |\n| [**CasCap.Common.Logging**](src/CasCap.Common.Logging/README.md) | Static logging abstraction via `ApplicationLogging` | netstandard2.0; net8.0; net9.0; net10.0 | ✅ |\n| [**CasCap.Common.Logging.Serilog**](src/CasCap.Common.Logging.Serilog/README.md) | Reusable Serilog configuration with standard enrichers, console sink, and health-check filtering | net8.0; net9.0; net10.0 | ✅ |\n| [**CasCap.Common.Net**](src/CasCap.Common.Net/README.md) | `HttpClientBase`, `BasicAuthenticationHandler`, HTTP client wrappers (net8.0+ only via `#if`) | netstandard2.0; net8.0; net9.0; net10.0 | ✅ |\n| [**CasCap.Common.OpenTelemetry**](src/CasCap.Common.OpenTelemetry/README.md) | Reusable OpenTelemetry configuration with standard metrics, traces, and log exporters via OTLP gRPC | net8.0; net9.0; net10.0 | ✅ |\n| [**CasCap.Common.Serialization.Json**](src/CasCap.Common.Serialization.Json/README.md) | System.Text.Json serialization helpers | netstandard2.0; net8.0; net9.0; net10.0 | ✅ |\n| [**CasCap.Common.Serialization.MessagePack**](src/CasCap.Common.Serialization.MessagePack/README.md) | MessagePack serialization helpers | netstandard2.0; net8.0; net9.0; net10.0 | ✅ |\n| [**CasCap.Common.Services**](src/CasCap.Common.Services/README.md) | `FeatureFlagBgService\u003cT\u003e` and `IFeature\u003cT\u003e` abstractions | net8.0; net9.0; net10.0 | ✅ |\n| [**CasCap.Common.Testing**](src/CasCap.Common.Testing/README.md) | xUnit test logging utilities | netstandard2.0; net8.0; net9.0; net10.0 | ✅ |\n\n### Test Projects\n\n| Project | Targets |\n| ------- | -------- |\n| [CasCap.Common.Caching.Tests](src/CasCap.Common.Caching.Tests/README.md) | net8.0; net9.0; net10.0 |\n| [CasCap.Common.Extensions.Tests](src/CasCap.Common.Extensions.Tests/README.md) | net8.0; net9.0; net10.0 |\n| [CasCap.Common.Net.Tests](src/CasCap.Common.Net.Tests/README.md) | net8.0; net9.0; net10.0 |\n| [CasCap.Common.Serialization.Tests](src/CasCap.Common.Serialization.Tests/README.md) | net8.0; net9.0; net10.0 |\n\n## Dependency Graph\n\nProject reference relationships between libraries (NuGet-only dependencies omitted).\n\n```mermaid\ngraph TD\n    Logging[CasCap.Common.Logging]\n    LoggingSerilog[CasCap.Common.Logging.Serilog]\n    Abstractions[CasCap.Common.Abstractions]\n    Extensions[CasCap.Common.Extensions]\n    Configuration[CasCap.Common.Configuration]\n    SerJson[CasCap.Common.Serialization.Json]\n    SerMsgPack[CasCap.Common.Serialization.MessagePack]\n    Net[CasCap.Common.Net]\n    Caching[CasCap.Common.Caching]\n    Services[CasCap.Common.Services]\n    HealthChecks[CasCap.Common.Extensions.Diagnostics.HealthChecks]\n    Testing[CasCap.Common.Testing]\n    AI[CasCap.Common.AI]\n    OTel[CasCap.Common.OpenTelemetry]\n\n    Extensions --\u003e Logging\n    LoggingSerilog --\u003e Logging\n    Configuration --\u003e Abstractions\n    Configuration --\u003e Logging\n    SerJson --\u003e Extensions\n    SerJson --\u003e Logging\n    SerMsgPack --\u003e Logging\n    Net --\u003e Abstractions\n    Net --\u003e SerJson\n    Net --\u003e Logging\n    HealthChecks --\u003e Extensions\n    HealthChecks --\u003e Logging\n    Testing --\u003e Logging\n    Services --\u003e Abstractions\n    Services --\u003e Extensions\n    Caching --\u003e Abstractions\n    Caching --\u003e Extensions\n    Caching --\u003e SerJson\n    Caching --\u003e SerMsgPack\n    Caching --\u003e Logging\n    AI --\u003e Abstractions\n    AI --\u003e Caching\n    AI --\u003e Extensions\n    AI --\u003e LoggingSerilog\n    OTel --\u003e Abstractions\n    OTel --\u003e LoggingSerilog\n    OTel --\u003e Services\n```\n\nTest project relationships:\n\n```mermaid\ngraph TD\n    Testing[CasCap.Common.Testing]\n    CachingTests[CasCap.Common.Caching.Tests] --\u003e Caching[CasCap.Common.Caching]\n    CachingTests --\u003e Testing\n    ExtTests[CasCap.Common.Extensions.Tests] --\u003e Extensions[CasCap.Common.Extensions]\n    ExtTests --\u003e Testing\n    NetTests[CasCap.Common.Net.Tests] --\u003e Net[CasCap.Common.Net]\n    NetTests --\u003e Testing\n    SerTests[CasCap.Common.Serialization.Tests] --\u003e SerJson[CasCap.Common.Serialization.Json]\n    SerTests --\u003e SerMsgPack[CasCap.Common.Serialization.MessagePack]\n    SerTests --\u003e Testing\n```\n\n## Prerequisites\n\n- **.NET SDK**: 10.0.x stable (see `global.json` — `allowPrerelease: false`)\n- **Docker**: Required for Redis in caching tests\n\n## Build and Test\n\n```bash\n# 1. Restore (required before build)\ndotnet restore\n\n# 2. Build\ndotnet build --no-restore\n\n# 3. Start Redis (required before caching tests)\ndocker run -d -p 6379:6379 --name cascap-redis redis\n\n# 4. Run tests — ALWAYS use --maxcpucount:1\ndotnet test --no-build --maxcpucount:1\n```\n\n\u003e **CRITICAL**: Always use `--maxcpucount:1` — parallel execution causes failures due to `InlineData` and Redis `ClearOnStartup` property conflicts.\n\n### Expected Build Behaviour\n\n- Build produces nullability warnings (CS8604, CS8765) — these are **accepted and must not be \"fixed\"**.\n- Multi-target builds take ~15–20 seconds.\n\n## Project Configuration\n\n### Key Files\n\n| File | Purpose |\n| ---- | -------- |\n| `Directory.Build.props` | C# 14.0, `ImplicitUsings`, `Nullable: enable`, `IsPackable: false` by default |\n| `Directory.Packages.props` | Central package version management (`ManagePackageVersionsCentrally: true`) |\n| `.editorconfig` | Code style rules (4-space indent, LF line endings, full formatting rules) |\n| `global.json` | SDK constraint — stable releases only |\n| `docker-compose.yml` | Redis and Redis UI (p3x-redis-ui) services |\n| `GitVersion.yml` | Semantic versioning configuration |\n\n### Suppressed Warnings\n\nConfigured in `Directory.Build.props`: `IDE1006`, `IDE0079`, `IDE0042`, `CS0162`, `CS1574`, `S125`, `NETSDK1233`, `NU1901`, `NU1902`, `NU1903`\n\n## CI/CD Pipeline\n\n### GitHub Actions (`.github/workflows/ci.yml`)\n\n**Triggers**: Push (except `preview/**`), PRs to `main`, manual dispatch.\n\n**Jobs**:\n\n1. **lint** — Reusable workflow from `f2calv/gha-workflows`\n2. **versioning** — GitVersion-based semantic versioning\n3. **build** — Ubuntu-latest with Redis service container; uses `f2calv/gha-dotnet-nuget@v2`; test args include `--maxcpucount:1`\n4. **release** — GitHub release (main branch only, when tag doesn't already exist)\n\n## Making Changes\n\n### Adding Code\n\n1. Place code in the correct project by functionality\n2. Follow `.editorconfig` style rules\n3. Add XML documentation to all public API surface\n4. Add tests in the corresponding `.Tests` project\n5. Validate: `dotnet build --no-restore` → 0 errors\n6. Validate: `dotnet test --no-build --maxcpucount:1` → all pass\n\n### Adding Dependencies\n\n1. Add version to `Directory.Packages.props`\n2. Reference in `.csproj` **without** a version attribute:\n\n   ```xml\n   \u003cPackageReference Include=\"PackageName\" /\u003e\n   ```\n\n3. Run `dotnet restore`\n\n### Creating New Projects\n\n- Library projects inherit `Directory.Build.props` automatically\n- Set `\u003cIsPackable\u003etrue\u003c/IsPackable\u003e` explicitly only for NuGet packages\n- Test projects must **not** be packable (default) and must target `net8.0;net9.0;net10.0`\n\n## Validation Checklist\n\n- [ ] `dotnet restore` succeeds\n- [ ] `dotnet build --no-restore` completes with 0 errors\n- [ ] Redis is running (if testing caching)\n- [ ] `dotnet test --no-build --maxcpucount:1` passes all tests\n- [ ] Public API has XML documentation\n- [ ] Properties separated by blank lines\n- [ ] `ServiceProvider` instances are disposed in tests\n- [ ] No shared mutable static state in test helpers\n\n## Contributing\n\n1. Fork the repository and create a feature branch\n2. Follow all conventions documented above\n3. Run the full validation checklist before submitting a PR\n4. PRs target the `main` branch and require CI to pass\n5. Versioning is automated via GitVersion — do not manually edit version numbers\n6. When using Copilot to implement code quality or legibility improvements, update the [copilot-instructions.md](.github/copilot-instructions.md) to capture any new conventions so they are applied consistently in future sessions\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ff2calv%2Fcascap.common","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ff2calv%2Fcascap.common","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ff2calv%2Fcascap.common/lists"}