Ejemplo n.º 1
0
        /// <summary>
        /// Occurs after the action method is invoked.
        /// </summary>
        /// <param name="actionExecutedContext">The action executed context.</param>
        public override void OnActionExecuted(ActionExecutedContext actionExecutedContext)
        {
            //Validazione argomenti
            if (actionExecutedContext == null)
            {
                throw new ArgumentNullException(nameof(actionExecutedContext));
            }

            //Leggo il content e il relativo type
            BodyContent body = GetResponseBody(actionExecutedContext.Result);

            //Inizializzo la response
            _Response = TraceUtils.GenerateResponse(_Request,
                                                    body.Value, body.Type, body.Length, actionExecutedContext.Exception);

            //Traccio il response (se richiesto)
            if (EnableResponseTrace)
            {
                TraceResponse(_Response);
            }

            //Esecuzione delle funzioni base
            base.OnActionExecuted(actionExecutedContext);
        }