• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

AKlaus / DomainResult / 44874615559
87%

Build:
DEFAULT BRANCH: master
Ran 21 Nov 2026 06:15AM UTC
Jobs 1
Files 22
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

21 Nov 2026 06:14AM UTC coverage: 87.554% (+0.05%) from 87.5%
44874615559

push

github

web-flow
Mvc: Return typed results from ToResult() (#116)

### Why

`ToResult()` and `ToCustomResult()` return `IResult`. The minimal API cannot read response metadata from `IResult`, so each endpoint needs `.Produces<T>()` for its success response.

### What changed

- **Mvc** — the `IResult` conversions return `Results<...>` unions of typed results
- **Package validation** — `CompatibilitySuppressions.xml` records the intended breaks against v3.4.0, and a build without a baseline permits them
- **Tests** — endpoint metadata checks for each result shape, and helpers that unwrap the union
- **Samples and README** — minimal-API examples drop `.Produces<T>()` for success responses

### Changes at a glance

No tangible change that `scope` detects.

**Areas**: `samples`, `src`, `tests`

**Public API** (not seen by `scope`)

| Conversion | New return type |
|---|---|
| `IDomainResult.ToResult()` | `Results<NoContent, ProblemHttpResult>` |
| `IDomainResult<T>.ToResult()`, `(T, IDomainResult).ToResult()` | `Results<Ok<T>, NoContent, ProblemHttpResult>` |
| `ToCustomResult()` | `Results<TResult, ProblemHttpResult>` |

Each `Task<...>` overload returns the same type in a `Task`.

> **Breaking**: the return types of the 10 `ToResult()` and `ToCustomResult()` overloads change. Most call sites still compile, because `Results<...>` implements `IResult`. A call site fails to compile when it puts the result in a `Task<IResult>`, or casts it to a type such as `Ok<T>`. Read `.Result` for the inner result. A lambda that returns two conversions of different shapes, or a conversion and a `TypedResults` value, fails to compile too. Declare its return type, as in `IResult (int id) => ...`. The endpoint then needs `.Produces<T>()` again. An assembly built against the old signatures fails at run time with `MissingMethodException`.

### Notes

- OpenAPI lists `204 No Content` for each value shape, because #104 kept 204 for a `null` value.
- Problem responses still need `.ProducesProbl... (continued)

92 of 109 branches covered (84.4%)

Branch coverage included in aggregate %.

18 of 18 new or added lines in 4 files covered. (100.0%)

1 existing line in 1 file now uncovered.

316 of 357 relevant lines covered (88.52%)

21.48 hits per line

Coverage Regressions

Lines Coverage ∆ File
1
91.89
0.72% src/Mvc/IResult/DomainResultToResult.cs
Jobs
ID Job ID Ran Files Coverage
1 44874615559.1 21 Nov 2026 06:15AM UTC 22
87.55
GitHub Action Run
Source Files on build 44874615559
  • Tree
  • List 22
  • Changed 4
  • Source Changed 4
  • Coverage Changed 4
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #44874615559
  • 32b046d4 on github
  • Prev Build on master (#44725752072)
  • Next Build on master (#44881277376)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc