Skip to content

v1.1.0

Compare
Choose a tag to compare
@AKlaus AKlaus released this 31 Oct 05:48
· 107 commits to master since this release

New Features

  • #3. Added conversion between IDomainResult<T> with different types of {T}.
    Example: for var res = IDomainResult.NotFound<int>() use res.To<string>() for propagating the response from a nested call in a method returning a different type of T (in this case - IDomainResult<string> or Task<IDomainResult<string>>).
  • #1. Added a method / status for returning Unauthorized (403).
    The domain methods can use DomainResult.Unauthorized(), DomainResult.UnauthorizedTask(), IDomainResult.Unauthorized() or IDomainResult.UnauthorizedTask() as the method's result that later will be converted to HTTP code 403 (Forbidden) in the MVC/API controllers.
  • #9. Added a deconstructor for IDomainResult<T> for easy access to the value and IDomainResult properties.
    Example: for IDomainResult<int> res = DomainResult.Success(10) use var (value, details) = res for deconstruction.

Breaking changes

This release contains a small, but breaking change.

  • #2. The Error() methods is renamed to Failed() to downplay the severity of the returned status.
    So instead of "old" IDomainResult.Error<int>() use IDomainResult.Failed<int>()