cacheResult renderTemplate code from quickstart does not compile in beta-2
See original GitHub issueDescribe the bug beta-1, the readme code to render a template worked
var cacheResult = engine.TemplateCache.RetrieveTemplate("templateKey");
if(cacheResult.Success)
{
string result = await engine.RenderTemplateAsync(cacheResult.Template.TemplatePageFactory(), model);
}
in beta-2, this code no longer works as engine
doesn’t contain a property TemplateCache
To Reproduce try to build this code using beta-2
Expected behavior Code should build
Information (please complete the following information):
- OS: Windows 10x64
- Platform: .NET Core 2.2
- RazorLight version: 2.0-beta2
- Visual Studio version: Visual Studio Community 16.3.10
Additional context I was able to adjust the quickstart code to compile and run by changing the broken line to:
var cacheResult = engine.Options.CachingProvider.RetrieveTemplate("templateKey");
But not sure if that still achieves the same goal of template re-use.
Issue Analytics
- State:
- Created 4 years ago
- Comments:13 (2 by maintainers)
Top Results From Across the Web
No results found
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ll push beta3 this week with this fix, update some documentation, and include the s.nupkg for symbols so people can more easily debug.
Yup, I agree