Skip to content

v1.0.2

Latest

Choose a tag to compare

@AlanBarber AlanBarber released this 28 Jan 04:34

Added Match() Method for Functional Result Handling

The Result and Result<T> types now include a Match() method that provides a functional approach to handling success and failure cases. This enables cleaner, more expressive code when transforming results into other types.

// Result<T> - success callback receives the value
return result.Match(
    user => Ok(user),
    error => NotFound(new { error })
);

// Result (non-generic) - success callback takes no parameters
return result.Match(
    () => NoContent(),
    error => BadRequest(new { error })
);

Full Changelog: v1.0.1...v1.0.2

Full Changelog: v1.0.1...v1.0.2