*edit to highlight the problem if you don't want to read my explanation*
I have a controller that inserts a user:
public IActionResult Insert([FromBody]User user)
GREEN = NOT NULL AND POPULATED WITH DATA
I have another controller that inserts a lead:
public IActionResult Insert([FromBody]Lead lead)
RED = NULL, NOT PICKING UP DATA
The "Lead" controller was copied from the (working) User controller, however, when I submit the form for the Lead Insert, it doesn't pick up and populate the Lead object like it does for the User one, resulting in a NullReference Exception being thrown when trying to access data within it.
What am I missing here? Why would there be a day/night difference like this? I know we struggled to get the User controller to work as well, trying to figure out [FromBody] and Task<IActionResult> was the culprit (or so we thought)....
I need someone that's way more intelligent than me (and my google skills) to please explain this and what I'm doing wrong here.
Thanks in advance
#buysyouabeer
I have a controller that inserts a user:
Code:
[HttpPost("InsertUser")]
[Consumes("application/json")]
[ResponseCache(Location = ResponseCacheLocation.None, NoStore = true)]
GREEN = NOT NULL AND POPULATED WITH DATA
I have another controller that inserts a lead:
Code:
[HttpPost("InsertLead")]
[Consumes("application/json")]
[ResponseCache(Location = ResponseCacheLocation.None, NoStore = true)]
RED = NULL, NOT PICKING UP DATA
The "Lead" controller was copied from the (working) User controller, however, when I submit the form for the Lead Insert, it doesn't pick up and populate the Lead object like it does for the User one, resulting in a NullReference Exception being thrown when trying to access data within it.
What am I missing here? Why would there be a day/night difference like this? I know we struggled to get the User controller to work as well, trying to figure out [FromBody] and Task<IActionResult> was the culprit (or so we thought)....
I need someone that's way more intelligent than me (and my google skills) to please explain this and what I'm doing wrong here.
Thanks in advance
#buysyouabeer
Last edited: