Query String Parameter Fails to Populate .NET Core

Viewed 24

I am upgrading an app from MVC to .NET Core. The ruleSetId parameter works in MVC, but not in .NET CORE. Why is ruleSetId = when I sent 203389?

POST https://localhost:44313/Customer/RuleSet/CreateRule?ruleSetId=203389

enter image description here

1 Answers

Use [FromQuery] attribute for ruleSetId and for other parameter you want get it from body use [FromBody]

See this link about Model Binding

Related