---
title: SAIF.NetCore.PingableService overview
summary: High-level purpose, scope, and responsibilities for this library.
status: draft
owner: SAIF Platform Team
last_reviewed: 2026-10-02
library: SAIF.NetCore.PingableService
reference_type: package
---

# SAIF.NetCore.PingableService overview

> **Documentation context:** Packaged Component (NuGet)

SAIF.NetCore.PingableService adds a framework-standard, anonymous `GET /Ping` health route to any ASP.NET Core API. A request to `/Ping` pings every DI-registered `IPingableService` implementation and every MVC controller that implements `IPingableService`, all concurrently, and fails the whole request if any target fails. It depends only on the foundation package `SAIF.NetCore.ServiceContracts` and is consumed by `SAIF.NetCore.ServiceExtensions` (top layer) and, as one of the three documented implementation-to-implementation exceptions, by `SAIF.NetCore.Services.Messaging`.

## Purpose
- Provide a single, consistent health-check endpoint (`GET /Ping`) that any host can adopt with one line of MVC setup.
- Let services and controllers participate in health reporting through a C# 8 default-interface-method mixin (`IPingableService`), without requiring every implementer to write custom ping logic.
- Surface target failures as a single HTTP 500 so monitoring systems have one signal for "this API or one of its dependencies is unhealthy."

## Responsibilities
- Register pingable services under both their own service type and `IPingableService` so a single DI registration call (`AddPingable{Transient|Scoped|Singleton}`) is enough to participate.
- Discover pingable controllers by reflection over MVC application parts, with no per-controller startup code required.
- Run every ping concurrently, classify and flatten failures, and return a stable success/failure contract to the caller.

## Key components
- `IPingableService`: the mixin interface, with default implementations for `PingAsync` orchestration and `Ping`/`IsThrowablePingError`/`OnPingFailure`/`OnPingSuccess` hooks.
- `PingableController`: the `[AllowAnonymous]` `GET /Ping` endpoint that resolves and pings every target.
- `IServiceCollectionExtensions`: `AddPingableTransient`/`AddPingableScoped`/`AddPingableSingleton` registration helpers.
- `MvcBuilderExtensions.WithPingableController()`: opt-in host wiring that routes the controller and registers controller discovery.
- `ControllerRetriever`: reflection-based discovery of pingable MVC controllers from snapshotted application parts.
- `PingServiceException`: the HTTP 500 exception type used to report any ping failure.

## Related documentation
- [Index](index.md)
- [Architecture](architecture.md)
- [Dependencies](dependencies.md)
- [Operations and processes](operations-processes.md)
- [Business rules](business-rules.md)
- [Security and authorization](security-authorization.md)
- [Service registration](service-registration.md)
- [API reference](api/index.md)

## Sources
- `src/SAIF.NetCore.PingableService/SAIF.NetCore.PingableService/IPingableService.cs`
- `src/SAIF.NetCore.PingableService/SAIF.NetCore.PingableService/Controllers/PingableController.cs`
- `src/SAIF.NetCore.PingableService/SAIF.NetCore.PingableService/Extensions/MvcBuilderExtensions.cs`
- `src/SAIF.NetCore.PingableService/README.md`
- `Architecture.md`
