Skip to content

Commit 7b7e51d

Browse files
committed
Do not use deprecated RazorEngine method
1 parent 67c3546 commit 7b7e51d

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

IntegrationEngine.ConsoleHost/IntegrationJobs/SampleSqlReport/SampleSqlReportJob.cs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using IntegrationEngine.Core.Jobs;
22
using IntegrationEngine.Core.Mail;
33
using RazorEngine;
4+
using RazorEngine.Templating;
45
using System;
56
using System.Net.Mail;
67

@@ -20,13 +21,9 @@ public override void Run()
2021

2122
// Pass into Razor engine
2223
string template = "Created on <strong>@Model.Created</strong> with <strong>@Model.Data.Count</strong> records.";
23-
Razor.Compile<SampleReport>(template, "template-01");
24-
var html = Razor.Run("template-01", report);
25-
//Console.WriteLine(result.ToString());
26-
27-
// Write result to Elasticsearch
24+
var html = Engine.Razor.RunCompile(template, "template-01", typeof(SampleReport), report);
25+
2826
// Send Mail
29-
// How to get recipients?
3027
var mailMessage = new MailMessage();
3128
mailMessage.To.Add("ethanhann@gmail.com");
3229
mailMessage.Subject = "Sample SQL Report";

0 commit comments

Comments
 (0)