Skip to content

Commit

Permalink
Update SampleAsyncActionFilter.cs (dotnet#4259)
Browse files Browse the repository at this point in the history
The existing code sample implies that the user can access the result of the action method in `context.Result`, but that is not the case. User needs to capture the result of the `next` delegate in order to access this info.
  • Loading branch information
irontoby authored and scottaddie committed Sep 15, 2017
1 parent f8f6b59 commit 669347e
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ public async Task OnActionExecutionAsync(
ActionExecutionDelegate next)
{
// do something before the action executes
await next();
// do something after the action executes
var resultContext = await next();
// do something after the action executes; resultContext.Result will be set
}
}
}
}

0 comments on commit 669347e

Please sign in to comment.