Added new Models and Razor Template
This commit is contained in:
@ -1,18 +1,34 @@
|
||||
using System;
|
||||
using RazorLight;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.IO;
|
||||
using WGneu.Models;
|
||||
|
||||
namespace WGneu.Documents {
|
||||
class Template {
|
||||
|
||||
private static readonly string ROOT = @"C:\Users\Lorenz\Desktop\";
|
||||
private static readonly string ROOT = @"C:\Users\tom\Projects\wgneu\";
|
||||
|
||||
public static async void Test() {
|
||||
await Pdf.Convert(ROOT + "din-5008.html", ROOT + "test.pdf");
|
||||
Pdf.Display("Test-Dokument", ROOT + "test.pdf");
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user