Skip to content

API reference index

7 public types are exposed by SAIF.NetCore.PingableService: 2 interfaces, 3 concrete classes, and 2 static extension classes, supporting 1 HTTP endpoint (GET /Ping) and 4 public extension methods.

Types

Type Kind Namespace Purpose
IPingableService Interface (C# 8 default interface implementations) SAIF.NetCore.Services.PingableService Mixin contract that any service or controller implements to participate in ping health checks; its default PingAsync orchestrates Ping plus the IsThrowablePingError/OnPingFailure/OnPingSuccess hooks so most implementers need no custom code at all.
PingableController Class : ControllerBase SAIF.NetCore.Services.PingableService.Controllers The anonymous GET /Ping endpoint; resolves every DI-registered and controller-discovered IPingableService target, runs all pings concurrently, and returns the run id on success or throws PingServiceException on any failure.
PingServiceException Class : HttpStatusCodeException SAIF.NetCore.Services.PingableService.Exceptions The HTTP 500 exception type that reports any ping failure, including flattened concurrent failures from a faulted Task.WhenAll.
IServiceCollectionExtensions Static class SAIF.NetCore.Services.PingableService.Extensions Dual-registers a host's own service under both its own type and IPingableService, with a forwarding factory, so PingableController.Get discovers it.
MvcBuilderExtensions Static class SAIF.NetCore.Services.PingableService.Extensions Adds PingableController's assembly as an MVC application part and registers the singleton IControllerRetriever that enables controller-based ping discovery.
IControllerRetriever Interface SAIF.NetCore.Services.PingableService.Services Contract for discovering and resolving MVC controllers that implement IPingableService from the host's DI container.
ControllerRetriever Class : IControllerRetriever SAIF.NetCore.Services.PingableService.Services Reflection-based implementation of IControllerRetriever: scans snapshotted application parts for types implementing both IPingableService and ControllerBase, then resolves each from DI by concrete type.

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/Exceptions/PingServiceException.cs
  • src/SAIF.NetCore.PingableService/SAIF.NetCore.PingableService/Extensions/IServiceCollectionExtensions.cs
  • src/SAIF.NetCore.PingableService/SAIF.NetCore.PingableService/Extensions/MvcBuilderExtensions.cs
  • src/SAIF.NetCore.PingableService/SAIF.NetCore.PingableService/Services/IControllerRetriever.cs
  • src/SAIF.NetCore.PingableService/SAIF.NetCore.PingableService/Services/ControllerRetriever.cs