The following code throw the following exception:
await (await this._userManagementService.GetUserInfo())
.WhenError()
.MapTo(
statusCode => Task.FromResult(
new HttpResponseMessage
{
StatusCode = statusCode
}))
.WhenSuccess()
.MapTo(
async email => await this.Post("tenant/setup", tenantId, new[] { email }))
.Map();
System.InvalidCastException: Unable to cast object of type 'SolidStack.Core.Flow.Internal.Result.UnresolvedMappableError`3[System.Net.HttpStatusCode,Smo365Api.Services.Dtos.User.UserInfo,System.Threading.Tasks.Task`1[System.Net.Http.HttpResponseMessage]]' to type 'SolidStack.Core.Flow.Internal.Result.ResolvedMappableSuccess`3[System.Net.HttpStatusCode,Smo365Api.Services.Dtos.User.UserInfo,System.Threading.Tasks.Task`1[System.Net.Http.HttpResponseMessage]]'.\r\n at SolidStack.Core.Flow.Internal.MappableContent`3.TryUseLastMapping()\r\n at SolidStack.Core.Flow.Internal.Result.UnresolvedMappableError`3.WhenSuccess()\r\n
But this code don't:
await (await this._userManagementService.GetUserInfo())
.WhenSuccess()
.MapTo(
async email => await this.Post("tenant/setup", tenantId, new[] { email }))
.WhenError()
.MapTo(
statusCode => Task.FromResult(
new HttpResponseMessage
{
StatusCode = statusCode
}))
.Map();
The following code throw the following exception:
But this code don't: