Here's some code to show how it's done:
[Route("api/[controller]")]
ctrl.ControllerContext = ControllerContext;
return ctrl.Get(parm);
[Route("api/[controller]")]
[ApiController]
public class MySecondController :
ControllerBase
{
[HttpPut("{param}")]
public
ActionResult<string>
Update([FromRoute]string param)
{
// do some important work...
// call the First Controller
var ctrl = new MyFirstController();ctrl.ControllerContext = ControllerContext;
return ctrl.Get(parm);
Comments
Post a Comment