Razor Templates
This commit is contained in:
@ -20,16 +20,8 @@ namespace WGneu.Documents {
|
||||
}
|
||||
|
||||
public static async void Generate(WgContext c) {
|
||||
var engine = new RazorLightEngineBuilder()
|
||||
.UseFileSystemProject(@"C:\Users\tom\source\repos\wgneu-cs\WGneu\Documents")
|
||||
.UseMemoryCachingProvider()
|
||||
.Build();
|
||||
|
||||
var model = new TestTemplateModel(c);
|
||||
|
||||
string result = await engine.CompileRenderAsync("TestTemplate.cshtml", model);
|
||||
|
||||
await File.WriteAllTextAsync(ROOT + "razor_test.html", result);
|
||||
var letter = new BusinessLetter("Test Dokument", c.Members.First());
|
||||
var pdf_path = await letter.Save();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user