adoconnection / RazorEngineCore

.NET6 Razor Template Engine
MIT License
565 stars 84 forks source link

Added support for writing binary content to output #99

Open lsadehaan opened 2 years ago

lsadehaan commented 2 years ago

This pull is in relation to the issue here: https://github.com/adoconnection/RazorEngineCore/issues/98

For my use-case I need to be able to write blocks of binary data to output files and without this change it is virtually impossible to achieve.

This change also opens various other possibilities, such as writing to a Stream or PipeWriter instead and returing a PipeReader to get the content from, which would improve efficiency for generation of very large output files.

P.S. I ran all tests with the updated version (updated to use the default implementation with template parameter ) and they all passed.