[#79] Entities: Remove EF proxies
This commit is contained in:
@@ -128,6 +128,8 @@ namespace Elwig.Documents {
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual async Task LoadData(AppDbContext ctx) { }
|
||||
|
||||
protected virtual void BeforeRenderBody(iText.Layout.Document doc, PdfDocument pdf) { }
|
||||
|
||||
protected virtual void RenderBody(iText.Layout.Document doc, PdfDocument pdf) { }
|
||||
@@ -136,7 +138,7 @@ namespace Elwig.Documents {
|
||||
return new KernedParagraph(App.Client.NameFull, 10);
|
||||
}
|
||||
|
||||
public async Task Generate(CancellationToken? cancelToken = null, IProgress<double>? progress = null) {
|
||||
public async Task Generate(AppDbContext ctx, CancellationToken? cancelToken = null, IProgress<double>? progress = null) {
|
||||
if (_pdfFile != null)
|
||||
return;
|
||||
progress?.Report(0.0);
|
||||
@@ -181,6 +183,7 @@ namespace Elwig.Documents {
|
||||
merger.Merge(src, 1, src.GetNumberOfPages());
|
||||
p += src.GetNumberOfPages();
|
||||
} else {
|
||||
await doc.LoadData(ctx);
|
||||
int pageNum = doc.Render(tmpPdf.FilePath);
|
||||
if (IsDoublePaged && doc is Letterhead) {
|
||||
using var reader = new PdfReader(tmpPdf.FilePath);
|
||||
@@ -233,6 +236,7 @@ namespace Elwig.Documents {
|
||||
throw new OperationCanceledException("Dokumentenerzeugung abgebrochen!");
|
||||
var pdf = new TempFile("pdf");
|
||||
try {
|
||||
await LoadData(ctx);
|
||||
TotalPages = Render(pdf.FilePath);
|
||||
} catch {
|
||||
pdf.Dispose();
|
||||
|
||||
Reference in New Issue
Block a user