Home > Net >  Originally very free asp.net MVC receiving parameters, rise after the core complex feeling much bett
Originally very free asp.net MVC receiving parameters, rise after the core complex feeling much bett

Time:12-09

Such as the
 public ActionResult getUserList (int every, int pageIndex, int pageSize, int ordertype=1) 
{
,,,
}


Before this, in the postman, whether it's address to add parameters, or a body in a json form submit can access to these parameters, change the core, the material, need to add [frombody] and changes of these parameters to model, feel too much trouble, I'm in the controller of more than 100, each of the parameters are set up a model class, workload is too big, have set up automatic way to obtain parameters, please people

CodePudding user response:

to change the dynamic

CodePudding user response:

The Controller and add [ApiController]

The.net core [FromBody] - in the morning - blog garden
https://www.cnblogs.com/KQNLL/p/10322143.html
  •  Tags:  
  • C#
  • Related