I want to get the rendered HTML my action in my console app, without making a web request.
I have a solution with (for simplicity sake) two projects in it. One is a Console App. One is an MVC4 project.
I have a reference to my MVC app from my console app.
I want to be able to create a new instance of my MVC controller in my console app and say something like:
var controller = new MyController();
var model = new MyModel();
var result = controller.GetHelloWorld(model);
var html = ?? // result.ToHtml();
I would like html
to contain the rendered HTML that was returned from the action.
Is this possible?