From a0764faa86e00c77189fb563039a9abbee08ca66 Mon Sep 17 00:00:00 2001 From: Anthony van der Hoorn Date: Mon, 5 Oct 2015 09:59:11 -0700 Subject: [PATCH] Bring arguments inline between before/after events --- .../Controllers/FilterActionInvoker.cs | 15 +++++++++++++-- .../Infrastructure/MvcRouteHandler.cs | 2 +- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/Microsoft.AspNet.Mvc.Core/Controllers/FilterActionInvoker.cs b/src/Microsoft.AspNet.Mvc.Core/Controllers/FilterActionInvoker.cs index b41c02a3e2..c058417101 100644 --- a/src/Microsoft.AspNet.Mvc.Core/Controllers/FilterActionInvoker.cs +++ b/src/Microsoft.AspNet.Mvc.Core/Controllers/FilterActionInvoker.cs @@ -625,7 +625,12 @@ namespace Microsoft.AspNet.Mvc.Controllers { _telemetry.WriteTelemetry( "Microsoft.AspNet.Mvc.BeforeActionMethod", - new { actionContext = ActionContext, arguments = _actionExecutingContext.ActionArguments }); + new + { + actionContext = ActionContext, + arguments = _actionExecutingContext.ActionArguments, + controller = _actionExecutingContext.Controller + }); } result = await InvokeActionAsync(_actionExecutingContext); @@ -636,7 +641,13 @@ namespace Microsoft.AspNet.Mvc.Controllers { _telemetry.WriteTelemetry( "Microsoft.AspNet.Mvc.AfterActionMethod", - new { actionContext = ActionContext, result = result }); + new + { + actionContext = ActionContext, + arguments = _actionExecutingContext.ActionArguments, + controller = _actionExecutingContext.Controller, + result = result + }); } } diff --git a/src/Microsoft.AspNet.Mvc.Core/Infrastructure/MvcRouteHandler.cs b/src/Microsoft.AspNet.Mvc.Core/Infrastructure/MvcRouteHandler.cs index 048ae17d44..d6c3275620 100644 --- a/src/Microsoft.AspNet.Mvc.Core/Infrastructure/MvcRouteHandler.cs +++ b/src/Microsoft.AspNet.Mvc.Core/Infrastructure/MvcRouteHandler.cs @@ -101,7 +101,7 @@ namespace Microsoft.AspNet.Mvc.Infrastructure { _telemetry.WriteTelemetry( "Microsoft.AspNet.Mvc.AfterAction", - new { actionDescriptor, httpContext = context.HttpContext }); + new { actionDescriptor, httpContext = context.HttpContext, routeData = context.RouteData }); } if (!context.IsHandled)