An HtmlHelper instance (named Html) should be added to RazorTemplateBase, and the Write method should html encode any objects that don't implement IHtmlString to match Razor's behaviour in MVC.
Comments: Missing a lot of context here. What exactly are you trying (e.g. sample project would be great), and what specific issue are you running into?
Comments: Missing a lot of context here. What exactly are you trying (e.g. sample project would be great), and what specific issue are you running into?