Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion articles/v4sdk/bot-builder-concept-middleware.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ There are plenty of situations that require your bot to do something on every ac
### Modifying or enhancing the turn context
Certain conversations can be much more fruitful if the bot has more information than what is provided in the activity. Middleware in this case could look at the conversation state information it has so far, query an external data source, and append that to the [turn context](bot-builder-concept-activity-processing.md#turn-context) object before passing execution on to the bot logic.

The SDK defines logging middleware that can record incoming and outgoing activities, but You can alos define your own middleware.
The SDK defines logging middleware that can record incoming and outgoing activities, but You can also define your own middleware.

## The bot middleware pipeline
For each activity, the adapter calls middleware in the order in which you added it. The adapter passes in the context object for the turn and a _next_ delegate, and the middleware calls the delegate to pass control to the next middleware in the pipeline. Middleware also has an opportunity to do things after the _next_ delegate returns before completing the method. You can think of it as each middleware object has the first-and-last chance to act with respect to the middleware objects that follow it in the pipeline.
Expand Down