v1.1.0
New Features
- #3. Added conversion between
IDomainResult<T>
with different types of{T}
.
Example: forvar res = IDomainResult.NotFound<int>()
useres.To<string>()
for propagating the response from a nested call in a method returning a different type ofT
(in this case -IDomainResult<string>
orTask<IDomainResult<string>>
). - #1. Added a method / status for returning
Unauthorized (403)
.
The domain methods can useDomainResult.Unauthorized()
,DomainResult.UnauthorizedTask()
,IDomainResult.Unauthorized()
orIDomainResult.UnauthorizedTask()
as the method's result that later will be converted to HTTP code403 (Forbidden)
in the MVC/API controllers. - #9. Added a deconstructor for
IDomainResult<T>
for easy access to thevalue
andIDomainResult
properties.
Example: forIDomainResult<int> res = DomainResult.Success(10)
usevar (value, details) = res
for deconstruction.
Breaking changes
This release contains a small, but breaking change.
- #2. The
Error()
methods is renamed toFailed()
to downplay the severity of the returned status.
So instead of "old"IDomainResult.Error<int>()
useIDomainResult.Failed<int>()