You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
inthashCode=TemplateName.GetHashCode();IRazorEngineCompiledTemplatecompiledTemplate=TemplateCache.GetOrAdd(hashCode, i =>{RazorEnginerazorEngine=newRazorEngine();stringviewPath=Path.Combine(Statics.EmailTemplatesPath,TemplateName+".cshtml");returnrazorEngine.Compile(File.ReadAllText(viewPath));});returncompiledTemplate.Run(model);
Template
You need to remove @model directive from template as the RazorEngineCore controls it.
If you use strongly typed model and would like to keep IntelliSense suggestions, put @inherits directive ontop of template