Any good replacement for the Razor Engine

As you know, the Razor Engine does not work under MVC4 .

So, I am wondering if we can use the Model object to generate the html body email in some other way.

Any key that the / dll tool we can use for it.

I really don't want to add attribute names manually and use the Replace method if I have 100 fields in Model ...

Example:

 <div class="display-label"> @Html.DisplayNameFor(model => model.Name) </div> <div class="display-field"> @Html.DisplayFor(model => model.Name) </div> <div class="clear"> </div> 
+4
source share
2 answers

Razor Engine now has Razor 2 compatibility (introduced in 3.1)

+1
source

I am using ActionMailer.net to generate html emails using Razor views. You can find it on NuGet or here: https://bitbucket.org/swaj/actionmailer.net/wiki/Home

+1
source

Source: https://habr.com/ru/post/1439503/


All Articles