0

I would like to build emails in dotnet core 1.0 using the Razor engine, but I cannot work out how to do that.

I have created a view model containing the data for the view and I have made a view and run that view in code:

var confirm = new ConfirmEmailHtmlViewModel();
confirm.CallbackUrl = callbackUrl;
var message = View("ConfirmEmailHtml", confirm);

What I cannot figure out is how to extract a string containing the rendered view from 'message'.

Is this possible and if it is how do I do that?

Martin Tomes
  • 181
  • 1
  • 10

1 Answers1

0

I have answered this here: Where are the ControllerContext and ViewEngines properties in MVC 6 Controller?

The original answer on that question was for a pre-release of ASP.NET Core and not the 1.0 release.

Community
  • 1
  • 1
Martin Tomes
  • 181
  • 1
  • 10