-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
37 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- | ||
Title: Request Context | ||
--- | ||
|
||
Do you want to get certain bits of contextual data without having to muck up your data? For that matter, if you're using HTTP OpenApi generation, how would | ||
you even do that? Enter `Request Contexts`. These are basically dictionaries of objects that allow middleware to set pieces of data you may be interested in. | ||
|
||
Some Examples | ||
|
||
* Is this data coming from the cache? If so, when is it from? | ||
* Is this data coming from the offline store? If so, when was it last updated? | ||
* There was an error that user notification trapped, we displayed it to the user and logged it, but maybe I want to do a little more processing on that Exception | ||
|
||
## How to use | ||
|
||
```csharp | ||
IMediator mediator; // injected | ||
var response = mediator.RequestWithContext(myRequest, CancellationToken.None); | ||
|
||
response.Result // your result | ||
response.Context. | ||
|
||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters