Search code examples
wpfrazortemplate-enginerazor-2

Formatting a .cshtml with WPF


I have a Razor template which I want to format with a model (a custom DTO) to return a string. I'm doing this from WPF, so I don't have an HttpContext. So far, the closest I've come is https://github.com/smsohan/MvcMailer/wiki/MvcMailer-Step-by-Step-Guide but when I call Execute(), I just get the name of the template file.

I'm sure this is possible but I can't get the syntax right.


Solution

  • I ended up using Spark, and wrote a quick blog post - Templating with Spark and WPF.