From 669347ee6246bad71bc9939e55145a3734d8f4a7 Mon Sep 17 00:00:00 2001 From: Toby Johnson Date: Thu, 14 Sep 2017 22:36:55 -0400 Subject: [PATCH] Update SampleAsyncActionFilter.cs (#4259) 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. --- .../src/FiltersSample/Filters/SampleAsyncActionFilter.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/aspnetcore/mvc/controllers/filters/sample/src/FiltersSample/Filters/SampleAsyncActionFilter.cs b/aspnetcore/mvc/controllers/filters/sample/src/FiltersSample/Filters/SampleAsyncActionFilter.cs index fe95547ed033..f90aba51f5e7 100644 --- a/aspnetcore/mvc/controllers/filters/sample/src/FiltersSample/Filters/SampleAsyncActionFilter.cs +++ b/aspnetcore/mvc/controllers/filters/sample/src/FiltersSample/Filters/SampleAsyncActionFilter.cs @@ -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 } } -} \ No newline at end of file +}