https://github.com/masstransit/sample-scopedfilters
Sample showing how to use scoped filters with MassTransit and ASP.NET Core
https://github.com/masstransit/sample-scopedfilters
Last synced: about 1 year ago
JSON representation
Sample showing how to use scoped filters with MassTransit and ASP.NET Core
- Host: GitHub
- URL: https://github.com/masstransit/sample-scopedfilters
- Owner: MassTransit
- Created: 2021-04-07T22:34:34.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2024-05-30T13:36:58.000Z (about 2 years ago)
- Last Synced: 2025-03-23T06:11:45.980Z (over 1 year ago)
- Language: C#
- Size: 6.84 KB
- Stars: 12
- Watchers: 3
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Scoped Filters
MassTransit supports [scoped filters](https://masstransit-project.com/advanced/middleware/scoped.html), allowing access to the same container scope as consumers as well as message producers, like those within ASP.NET controllers, etc.
This sample shows how to manage a scoped class, `Token`, and use it to pass values between an ASP.NET controller action and MassTransit send/publish middleware filters.
Simply open it up and run it, and add a header to the request (using Postman, CURL, whatever) called "Token" with any string value to get a response.