Closed fhogberg closed 4 years ago
Unfortunately layout is only supported in CompileView
scenario. For reference please see CanLoadAViewWithALayout. Unfortunately Stream
API is not supported in CompileView
.
It is possible to add support by extending ViewEngineFileSystem
base class with something like this:
public virtual StringReader GetFileStream(string filename)
{
return new StringReader(GetFileContent(filename));
}
and update usage at HandlebarsCompiler.CompileView to use GetFileStream
instead of GetFileContent
.
Other implementation options could require breaking changes.
If this functionality is essential for you - you're welcome to create PR. If not I'd address this in next iteration.
Ok. Thanks for the info. If i get the time i try to make a PR for it.
Perhaps the PR looks strange but what i needed was a Compile that returned a Action<TextWriter,object> and worked with templates. To read templates from a reader was never a concern.
Tried going to the stream version of Compile() and the following does not work. Should it work or is this not supported?