Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
adoconnection authored Nov 17, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 6c218a3 commit 22d59bb
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -38,6 +38,8 @@ Install-Package RazorEngineCore
* [Switch from RazorEngine cshtml templates](https://github.com/adoconnection/RazorEngineCore/wiki/Switch-from-RazorEngine-cshtml-templates)
* [Azure Functions FileNotFoundException workaround](https://github.com/adoconnection/RazorEngineCore/wiki/Azure-Functions-FileNotFoundException-workaround)
* [@Html implementation example](https://github.com/adoconnection/RazorEngineCore/wiki/@Html-implementation-example)
* [Debugging](https://github.com/adoconnection/RazorEngineCore/wiki/Debugging)


## Extensions
* [wdcossey/RazorEngineCore.Extensions](https://github.com/wdcossey/RazorEngineCore.Extensions)
@@ -89,6 +91,23 @@ string result = template.Run(instance =>
Console.WriteLine(result);
```

#### Debugging
Compile template with ```IncludeDebuggingInfo()``` option and call ```EnableDebugging()``` before running template
If template was compiled with ```IncludeDebuggingInfo()``` option, saveing and loading will keep original template source code and pdb.
```cs
IRazorEngineCompiledTemplate template2 = razorEngine.Compile(templateText, builder =>
{
builder.IncludeDebuggingInfo();
});

template2.EnableDebugging(); // optional path to output directory
string result = template2.Run(new
{
Title = "Welcome"
});
```

#### Save / Load compiled templates
Most expensive task is to compile template, you should not compile template every time you need to run it
```cs

0 comments on commit 22d59bb

Please sign in to comment.