Skip to content

Instantly share code, notes, and snippets.

@DeeJayTC
Created February 21, 2019 16:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DeeJayTC/4c28ecffa907483e95e76113f53d9bc4 to your computer and use it in GitHub Desktop.
Save DeeJayTC/4c28ecffa907483e95e76113f53d9bc4 to your computer and use it in GitHub Desktop.
//the underlying CardRenderService
public class CardRenderService
{
private RazorLightEngine Engine;
public CardRenderService()
{
Engine = new RazorLightEngineBuilder().UseMemoryCachingProvider().Build();
}
public async Task<string> RenderCard(string key, string input, object data)
{
return await Engine.CompileRenderAsync(key, input, data);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment