adoconnection / RazorEngineCore

.NET6 Razor Template Engine
MIT License
576 stars 85 forks source link

Layout not working #62

Closed joshtate closed 3 years ago

joshtate commented 3 years ago

Following the example from the wiki regarding layouts, (which stemmed from this issue) it doesn't compile. This line:

MyCompiledTemplate compiledTemplate = razorEngine.Compile(template, parts);

results in this compilation error:

Argument 2: cannot convert from System.Collections.Generic.IDictionary<string, string>' to 'System.Action<RazorEngineCore.IRazorEngineCompilationOptionsBuilder>'

I've tried looking into the IRazorEngineCompilationOptionsBuilder for a feature to specify layouts, but I don't see anything. Has this feature been removed?

joshtate commented 3 years ago

Nevermind. Reading into the wiki further explains that you have to implement this yourself. Disregard.

adoconnection commented 3 years ago

did that code work for you?