Closed kobruleht closed 3 years ago
you need to make TemplateCache to store object
private static ConcurrentDictionary<int, object> TemplateCache = new ConcurrentDictionary<int, object>();
https://github.com/adoconnection/RazorEngineCore/issues/28'
🎄
Tried to use Html extension support in ASP .NET MVC 6 Core using
but got exception
An unhandled exception occurred while processing the request. InvalidCastException: Unable to cast object of type 'RazorEngineCore.RazorEngineCompiledTemplate
1[RazorEngineCore.RazorEngineTemplateBase
1[System.Object]]' to type 'RazorEngineCore.IRazorEngineCompiledTemplate1[RazorEngineCore.RazorEngineCorePageModel
1[System.Object]]'.Using original tempales with
var compiledTemplate = (IRazorEngineCompiledTemplate<RazorEngineTemplateBase<TModel>>)TemplateCache.GetOrAdd(templateHashCode, i =>
works OKJ