Sep 11, 2019 01:46 PM|PatriceSc|LINK
I would expect something such as :
public IActionResult PostUserLogins([FromBody] Users user)
// call action result to get GetBranches(Users user) as json;
// And so here it could : // do whatever else you want before
var branches=MyService.GetBranches(user.Id); // call your underlying "building block"
// do whatever else needs to be done
public IActionResult GetBranches([FromBody] Users user)
return MyService.GetBranches(user.Id); // Not sure why you have a full user object on what appears to be a GET ??
In short action are just "http entry points" you need to expose and behind the scene you just call whatever is doing the actual work.
If you have already complex code right into GetBranches and you need to call this it seems a bad application architecture. A first step miight at least to turn this into a private method you could call when needed elsewhere in your controller.