I would like to better understand how the controller method knows when the returned parameter should be extracted from the mail data or URL.
Take the following example:
URL: /ModelController/Method/itemID
POST: objectOrArray: {JSON Object/Array}
The controller will look something like this:
[HttpPost]
public ActionResult InputResources(int? id, Object objectOrArray)
Now, somehow the method is smart enough to look for the first parameter id,, in the site URL and Objectin HTTPPost.
While this works, I don’t know why, and as a result, I sometimes encounter unpredictable and erratic behavior. For example, I seem to have found (although I'm not 100% sure) that removing ?from int? idmakes the controller method immediately assume that it should look for the identifier in HTTPPost, not the URL.
So, I would like to clarify the following points:
? ( [HttpPost] ?)
? (, ? id ?)
, , inpact? (.. Object id)
, , , , .