0

I have a webAPI project written in ASP.NET MVC I want to validate each request to my API project for HTML and Javascript injection. I am writing a filter and on OnActionExecuting() I am trying to read filterContext.ActionArguments My aim is to check each action argument to check if it does not have any or tag. if any such tag present, I shall send a invalid request error.

Hence in below method, I want to reach each object and its properties. Can some one help me here. I can iterate through each object, but how can I read each property of each object

public override void OnActionExecuting(HttpActionContext filterContext)
    {

        int i = 0;
        for (i = 0; i < filterContext.ActionArguments.Count; i++)
        {
            var param = filterContext.ActionArguments.ElementAt(i);

        }
    }

0 Answers0