AKlaus / DomainResult

Tiny package for decoupling domain operation results from IActionResult and IResult types of ASP.NET Web API
Apache License 2.0
53 stars 3 forks source link

Add method / status for 'Bad Gateway' (502) or 'Service Unavailable' (503) #45

Closed AKlaus closed 2 years ago

AKlaus commented 2 years ago

Use-case:

  1. An infrastructure logic calls an external service that fails, so the consumer has to receive 502 'Bad Gateway' or 503 'Service Unavailable' HTTP status code (see this SO discussion on the preferred HTTP code).
  2. The library containing the infrastructure code doesn't have a dependency on Microsoft.AspNetCore.App, so returning IDomainResult would be handy.

Task

Add additional extension method along with DomainOperationStatus state: