You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -316,27 +323,27 @@ Use the *FormFilesWithPayload* type to upload multiple files and a JSON payload
316
323
}
317
324
```
318
325
319
-
## Full compatibility with [Futurum.Core](https://www.nuget.org/packages/Futurum.Core)
320
-
Comprehensive set of extension methods to transform a [Result](https://docs.futurum.dev/dotnet.futurum.core/result/overview.html) and [Result<T>](https://docs.futurum.dev/dotnet.futurum.core/result/overview.html) to an *TypedResult*.
Comprehensive set of extension methods - *WebApiEndpointRunner.Run* and *WebApiEndpointRunner.RunAsync* - to run a method and if it throws an *exception* it will catch and transform it into a *BadRequest<ProblemDetails>*.
- If the Result<IResult> is a *Success<IResult>*then the *IResult* will be returned.
324
-
- If the Result<T> is a *Failure<T>*then the*BadRequest<ProblemDetails>* will be returned, with the appropriate details set on the ProblemDetails. The *error message* will be safe to return to the client, that is, it will not contain any sensitive information e.g. StackTrace.
329
+
The *Run* and *RunAsync* methods will:
330
+
- If the method passed in **does not** throw an exception, then the existing return remains the same.
331
+
- If the method passed in **does** throw an exception, then a*BadRequest<ProblemDetails>* will be returned, with the appropriate details set on the ProblemDetails. The *error message* will be safe to return to the client, that is, it will not contain any sensitive information e.g. StackTrace.
325
332
326
-
This works for:
333
+
The returned type from *Run* and *RunAsync* is always augmented to additionally include *BadRequest<ProblemDetails>*
This means you can use the helper functions without having to specify the namespace. As in the examples.
391
+
392
+
## Full compatibility with [Futurum.Core](https://www.nuget.org/packages/Futurum.Core)
393
+
Comprehensive set of extension methods to transform a [Result](https://docs.futurum.dev/dotnet.futurum.core/result/overview.html) and [Result<T>](https://docs.futurum.dev/dotnet.futurum.core/result/overview.html) to an *TypedResult*.
394
+
395
+
- If the method passed in is a *success*, then the *IResult* will be returned.
396
+
- If the method passed in is a *failure*, then a *BadRequest<ProblemDetails>* will be returned, with the appropriate details set on the ProblemDetails. The *error message* will be safe to return to the client, that is, it will not contain any sensitive information e.g. StackTrace.
397
+
398
+
The returned type from *ToWebApi* is always augmented to additionally include *BadRequest<ProblemDetails>*
*Results* has a maximum of 6 types. So 5 are allowed leaving one space left for the *BadRequest<ProblemDetails>*.
413
+
379
414
#### How to handle *successful* and *failure* cases in a typed way with *TypedResult*
380
415
You can optionally specify which TypedResult success cases you want to handle. This is useful if you want to handle a specific successes case differently.
381
416
@@ -413,6 +448,7 @@ There can only be 1 *success* helper function, but there can be multiple *failur
0 commit comments