The question "How to call another controller Action From a controller in Mvc" has some good answers, but it would seem things have changed. The answer
var controller = DependencyResolver.Current.GetService<ControllerB>();
controller.ControllerContext = new ControllerContext(this.Request.RequestContext, controller);
doesn't work in mvc core because DependencyResolver
and a 2 param ControllerContext
constructor no longer exist.
What is the new way to do this?
I don't want to redirect. I don't want to loose the controller context.