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
IRazorEngineCompiledTemplatecompiledTemplate=TemplateCache.GetOrAdd(TemplateName, name =>{RazorEnginerazorEngine=newRazorEngine();stringviewPath=Path.Combine(Statics.EmailTemplatesPath,name+".cshtml");returnrazorEngine.Compile(File.ReadAllText(viewPath));});returncompiledTemplate.Run(model);
Template
You need to remove the @model directive from the template, as RazorEngineCore controls the model.
If you use a strongly typed model and would like to keep IntelliSense suggestions, put the @inherits directive on top of the template: