Converting old RazorEngine to version 3

Jan 12 at 10:37 AM
Hi,

I'm having a code which I'm not able to convert to the new release of RazorEngine.
private string ParseTemplate(string template, string name)
        {
            try
            {
                if (string.IsNullOrWhiteSpace(template))
                    return string.Empty;

                if (!CachedFileAccess.IsCompiled(name))
                {
                    RazorEngine.Razor.SetTemplateBase(typeof(HtmlTemplateBase));
                    RazorEngine.Razor.Compile(template, name);
                    CachedFileAccess.SetCompiled(name);
                }
                return RazorEngine.Razor.Run(name);
            }
            catch (RazorEngine.Templating.TemplateCompilationException ex)
            {
                StringBuilder sb = new StringBuilder();
                foreach (var e in ex.Errors)
                    sb.AppendFormat("{0}\n", e.ToString().Replace(e.FileName, string.Empty));
                throw new JSFileParserException(string.Format("Failure to parse template {0}. See Errors:\n{1}", _filename, sb.ToString()));
            }
        }
Can somebody help me with this?