BaseTemplateKey tk = new NameOnlyTemplateKey("page", ResolveType.Include, new NameOnlyTemplateKey(null, ResolveType.Include, new NameOnlyTemplateKey()));
*.cshtml
file with a TextReader
and pass that into Engine.Razor.RunCompile()
. I feel there has to be a cleaner way of doing this, especially with all the classes I am seeing like TemplateManager
, CachingProvider
, TemplateKey
etc... I just cant seem to find a good example of how to use one or all of these to automatically parse a template which i have created in my project. any help would be much appreciated!
context
needs to be null
for at least some templates. The idea is that the context
gets set by RazorEngine when an inner
template is resolved, but at the same time give you a possibility to pre-compile those templates.
Hi, I'm been having a problem with Engine.Razor.Compile method in a WCF app as of RazorEngine 3.7.5 (tried 3.7.7). Here's my stackoverflow question: http://stackoverflow.com/questions/35512454/razorengine-3-7-7-error-when-compiling-a-cached-template
Any ideas of a solution to fix that problem would be appreciated.