Skip to content

Microsoft.AspNetCore.Mvc.Filters.ActionFilterAttribute isn't working properly with .Net Core 2.2 #4958

@jaydeept

Description

@jaydeept

I am not sure if this is a correct repository to report the issue related to Microsoft.AspNetCore.Mvc, but can you please redirect to correct one if found this one as incorrect? Here is the issue:
I am using Microsoft.AspNetCore.Mvc.Filters.ActionFilterAttribute for my .Net Core 2.2 project. Below is the type of my controller:

public IActionResult Post([FromBody] IEnumerable<NewObject> input)
        {
            xyz.CreateObjects(input);
            return NoContent();
        }

With that I am using following API from ActionFilterAttribute in my class:

public override void OnActionExecuting(ActionExecutingContext actionContext)
{
............
}

Now though I am passing correct JSON structure from my test cases, the actionArguments is coming as an empty. This used to work in .Net Framework with System.Web.Http.Filters.ActionFilterAttribute

with below code:
public override void OnActionExecuting(HttpActionContext actionContext)

But now with .Net Core I am not able to use that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions