Newly minted father. C# dev that enjoys playing around with random ideas.

Menu

Razor without mvc part ii

After the wonderful blog post by Matt at http://www.fidelitydesign.net/ (which is based on my previous post here.) I looked into adding anonymous types to the compiler. Rather than start with my version of the compiler I’ve used his version. It was written much better than my thrown together example. (You can download the original here.)

Original code

To call the razor parser is simple. We create our template as a string, create our model (if necessary) and call Razor.Parse.