Skip to content
CAI
Software that uses CAICheck a score

ardalis/Result

51.0

Adequate · 21 September 2026

2.7k

lines of production code

C#

primary language

4

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

A .NET library that implements a Result pattern to handle success and various error states without throwing exceptions. It provides ASP.NET Core integration to automatically map these results to HTTP responses and supports FluentValidation and FluentAssertions for testing. The system includes sample applications demonstrating localization, minimal API usage, and MediatR integration.

How it got here

2019 — Initial release of the Result pattern library

7 changes.

This period marks the initial release of the Ardalis.Result library, introducing a comprehensive Result type system for handling success and error states without exceptions. The work included creating the core library, associated packages for ASP.NET Core and FluentValidation, and a sample web application demonstrating usage and localization. Comprehensive unit and functional tests were added to validate the new functionality.

2020 — ASP.NET Core integration and sample application

6 changes.

This period focused on integrating the Result library with ASP.NET Core, introducing new packages and conventions for MVC and minimal APIs. The work also expanded the sample application to demonstrate localization, validation, and MediatR integration, supported by comprehensive unit tests.

2021–2025 — Sample applications and test coverage

8 changes.

This period focused on expanding the library's ecosystem by introducing new sample applications for ASP.NET Core and Minimal APIs, alongside comprehensive test coverage. The work included adding functional and unit tests for the new samples, as well as introducing FluentAssertions support for Result types to improve testing readability.

Features

Add FluentAssertions extension methods for Result types

Users can now use fluent assertions to verify the state of Result objects in tests. New extension methods allow checking for success, failure, and specific HTTP status codes (Conflict, Forbidden, Unauthorized, etc.) as well as validation error details, making test code more readable and expressive.

src/Ardalis.Result.FluentAssertions · high confidence

Add Minimal API sample with localization and result mapping

A new Minimal API sample project has been added, demonstrating how to use the library's ToMinimalApiResult extension to return Microsoft.AspNetCore.Http.IResult from endpoints. The sample includes localization support for English and German, Swagger integration, and a weather forecast endpoint.

sample/Ardalis.Result.SampleMinimalApi · medium confidence

Add sample application with localization, validation, and error handling examples

The sample application now includes DTOs, models, and services that demonstrate localization via resource files, validation using FluentValidation, and handling of error states such as NotFound, Conflict, and Invalid results. It also introduces custom exceptions for specific error conditions and showcases the use of string localizers for user-facing messages.

sample/Ardalis.Result.Sample.Core · high confidence

Add sample endpoints demonstrating Result-to-ActionResult conversion

The sample application now includes two new endpoints in the WeatherForecastFeature: a minimal API-style endpoint using the \ToActionResult\ extension method, and a traditional controller-based endpoint using the \\[TranslateResultToActionResult\]\ filter. These changes demonstrate how to convert \Ardalis.Result\ objects into \ActionResult\ responses in ASP.NET Core, including handling validation errors and mapping result types.

sample/Ardalis.Result.SampleWeb/WeatherForecastFeature · high confidence

Add sample endpoints for creating and removing persons

The sample web application now includes three new files in the PersonFeature directory: CreatePersonEndpoint.cs, PersonController.cs, and PersonEndpoint.cs. These files demonstrate how to use the library's Result type in ASP.NET Core, showing both the new extension method approach (ToActionResult) and the filter-based approach (\[TranslateResultToActionResult\]) for converting Result objects to HTTP responses.

sample/Ardalis.Result.SampleWeb/PersonFeature · high confidence

Add sample web app with localization support

A new Razor page (Index) and its code-behind were added to the sample web application. The page displays instructions for testing the API via Swagger and demonstrates localized messages using IStringLocalizer, providing a concrete example of how the library integrates with ASP.NET Core's localization features.

sample/Ardalis.Result.SampleWeb/Pages · medium confidence

Add sample web application with localization support

The sample web application now supports localization, allowing the app to serve content in multiple languages. The \Program.cs\ file configures supported cultures (English and German) and sets up the localization middleware. Resource files (\Pages.IndexModel.de-DE.resx\ and \Pages.IndexModel.en-US.resx\) provide localized strings, enabling the application to display text in the user's preferred language.

sample/Ardalis.Result.SampleWeb · high confidence

Added MediatR-based sample implementation for Result translation

The sample application now includes a MediatR-based API structure, featuring a new LoggingBehavior for MediatR pipeline processing and two controllers (Person and WeatherForecast) that use MediatR commands and handlers to return Result types. The controllers apply the TranslateResultToActionResult filter to convert Result objects into appropriate HTTP responses, demonstrating how to integrate the Result library with MediatR in an ASP.NET Core Web API.

sample/Ardalis.Result.SampleWeb/MediatrApi · high confidence

Added bad practice example for handling API status via exceptions

A new sample controller, BadWeatherForecastController, was added to the BadApproaches folder. It demonstrates an anti-pattern where expected negative conditions (not found, conflict, invalid request) are handled using try-catch blocks and exceptions for control flow, rather than returning specific result types. This serves as a contrast to the recommended approach of using a proper result type in the service itself.

sample/Ardalis.Result.SampleWeb/BadApproaches · medium confidence

Initial release of the Ardalis.Result library and supporting packages

This change introduces the core \Ardalis.Result\ library, which implements the Result pattern to return success or various non-success states (NotFound, Invalid, Conflict, etc.) without throwing exceptions. It also adds the \Ardalis.Result.AspNetCore\ package for translating results to MVC \ActionResult\ and Minimal API \IResult\, the \Ardalis.Result.FluentValidation\ package for bridging FluentValidation failures, and the \Ardalis.Result.FluentAssertions\ package for test assertions. The repository is initialized with solution files, project structures, and documentation (README, CONTRIBUTING, CODE\_OF\_CONduct) to support development and usage.

(repo-wide) · high confidence

Introduces a comprehensive Result type system with status-based handling and FluentValidation integration

The library now provides a full-featured \Result\ and \Result\<T\>\ type system that replaces the previous error-handling approach. This includes a \ResultStatus\ enum to represent success, creation, and various error states (NotFound, Forbidden, Unauthorized, Conflict, etc.), along with static factory methods (e.g., \Result.NotFound()\, \Result.Error()\) for each status. The \IResult\ interface and \IResultExtensions\ provide helper methods like \IsOk()\ and \IsNotFound()\. Additionally, a new \Ardalis.Result.FluentValidation\ package adds an extension to convert \FluentValidation.ValidationResult\ into \ValidationError\ objects, and a \PagedResult\<T\>\ class is introduced to support pagination scenarios.

src/Ardalis.Result · high confidence

New AspNetCore integration for Result types

The \Ardalis.Result.AspNetCore\ package introduces a new integration layer for ASP.NET Core, providing extension methods to convert \Result\ objects into \ActionResult\ or \IResult\ types. This includes \ToActionResult\ for standard MVC controllers and \ToMinimalApiResult\ for minimal APIs, enabling seamless return of \Result\ types from controllers and endpoints. The package also adds a \ResultConvention\ that automatically generates \ProducesResponseType\ attributes for endpoints returning \Result\ types, ensuring accurate API documentation and validation of expected failure states via the \ExpectedFailures\ attribute.

src/Ardalis.Result.AspNetCore · high confidence

Test coverage

Added app.config with assembly binding redirects for the unit test project; Added functional tests for Person and WeatherForecast controllers; Added functional tests for the new weather forecast endpoint; Added unit tests for ASP.NET Core result conventions; Added unit tests for FluentAssertions result types; Added unit tests for PersonService and BadResultService; Added unit tests for PersonValidator validation logic; Added unit tests for Result and PagedResult constructors, mapping, and binding.

Dependencies

Centralize and update .NET and Ruby dependencies

The project now uses central package version management via Directory.Packages.props, defining specific versions for key dependencies including FluentAssertions 7.0.0, FluentValidation 11.9.2, and xUnit 2.4.2. The .NET sample and test projects have been updated to target net8.0, and the documentation site has been updated to use Jekyll 4.3.2 and just-the-docs 0.6.2.

(dependencies) · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

This is the PUBLIC form of this artifact. Findings are listed in full, but the details of SECURITY findings — which rule fired, in which file, on which line, and how to fix it — are deliberately withheld, and any secret-scanner results are excluded entirely. Where detail is absent here it was REMOVED FOR PUBLICATION; it is not missing from the analysis. The complete artifact is available from the repository owner.

Score

  • CAI 47 → 51 (+3.8)
  • Rubric changed (rubric-2026.08.18 → rubric-2026.09.15) — scores are not directly comparable.

Lenses

  • Code Health 63 → 62 (-1.5)
  • Architecture 100 → 100 (+0.0)
  • Maturity 63 → 63 (+0.0)
  • Readiness 49 → 48 (-1.1)
  • Security 35 → 44 (+9.1)
  • Performance 64 → 64 (+0.0)

Resolved (38)

  • Bounded contexts not declared
  • CRAP 120: ResultExtensions.ToMinimalApiResult (src/Ardalis.Result.AspNetCore/MinimalApiResultExtensions.cs)
  • Duplicated block (17 lines × 3) (src/Ardalis.Result.AspNetCore/MinimalApiResultExtensions.cs)
  • High CVE: MessagePack 2.1.152
  • High CVE: MessagePack 2.1.152
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • …and 18 more

New (49)

  • Base-context workflow trigger runs with an unscoped token
  • CRAP 31: ResultExtensions.ToMinimalApiResult (src/Ardalis.Result.AspNetCore/MinimalApiResultExtensions.cs)
  • Documentation: no installation or build instructions (README.md)
  • Documentation: no usage examples (README.md)
  • Duplicated block (11 lines × 5) (src/Ardalis.Result.AspNetCore/ResultStatusMap.cs)
  • Duplicated block (17 lines × 3) (src/Ardalis.Result.AspNetCore/MinimalApiResultExtensions.cs)
  • Duplicated block (31 lines × 2) (src/Ardalis.Result/ResultExtensions.cs)
  • Duplicated block (9 lines × 2) (src/Ardalis.Result/ResultExtensions.cs)
  • High CVE: MessagePack 2.1.152
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • …and 29 more

API surface

  • Unchanged — 10 HTTP endpoints

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

ardalis/Result was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 21 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 14cf45a126daa56f6798d033f4d5091aeb0900fc — the exact code this score is about.
  • Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-28e75b8e3254.