Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

How to Get Body From Response in OnActionExecuted and ActionFilterAttribute

$
0
0

HI

I want to Get Body in OnActionExecuted from ActionExecutedContext  and  add Some Text or HTML To It and write again My Result  to Response Body ///

How Can I do It?? for Example :

 public override void OnActionExecuted(ActionExecutedContext context)
        {
            timer.Stop();

            ====================
            GeT Orginal Body
            =========================

            string result =
               "<br/><div>Elapsed time:" + $"{timer.Elapsed.TotalMilliseconds} ms </div>";

            ==========================
                Orginal Bady + Result
            =============================

            context.HttpContext.Response.Body.Write(?);





        }

Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>