Skip to content

v2.5.0

Choose a tag to compare

@ANcpLua ANcpLua released this 14 Jan 01:03
· 374 commits to main since this release

What's New

New Or* Extensions

  • OrUnexpected(description) - Returns Unexpected error (500) if null
  • OrError(Error error) - Returns custom error if null
  • OrError(Func<Error> factory) - Lazy custom error creation

Struct Overloads

Added missing struct overloads for nullable value types:

  • OrUnauthorized<T> where T : struct
  • OrForbidden<T> where T : struct
  • OrConflict<T> where T : struct
  • OrFailure<T> where T : struct

Documentation

  • Updated README with comprehensive API documentation
  • Improved NuGet package descriptions and tags

Usage

// New extensions
value.OrUnexpected("Something went wrong");
value.OrError(Error.Custom(422, "Custom.Code", "Custom message"));
value.OrError(() => BuildExpensiveError());

// Struct support
int? maybeId = GetId();
return maybeId.OrNotFound("ID not found");

Full Changelog: v2.4.0...v2.5.0