Version 1.0.5-rc22
This commit is contained in:
parent
2989a0b8f1
commit
aec12b3177
13 changed files with 171 additions and 44 deletions
|
|
@ -1,5 +1,6 @@
|
|||
using Microsoft.AspNet.Hosting;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Extensions;
|
||||
using Yavsc.Lib;
|
||||
using Yavsc.Services;
|
||||
using Yavsc;
|
||||
|
|
@ -17,14 +18,31 @@ namespace test
|
|||
.UseServer("test")
|
||||
.UseStartup<test.Startup>()
|
||||
.Build();
|
||||
|
||||
|
||||
var app = hostengnine.Start();
|
||||
var sender = app.Services.GetService(typeof(IEmailSender)) as IEmailSender;
|
||||
var mailer = app.Services.GetService(typeof(EMailer)) as EMailer;
|
||||
var loggerFactory = app.Services.GetService(typeof(ILoggerFactory)) as ILoggerFactory;
|
||||
ILogger logger = loggerFactory.CreateLogger<Program>() ;
|
||||
mailer.SendMonthlyEmail(1,"UserOrientedTemplate");
|
||||
logger.LogInformation("Finished");
|
||||
|
||||
CommandArgument opName = new CommandArgument()
|
||||
{
|
||||
Name = "command",
|
||||
Description = "command to invoke ('monthlyTasks')",
|
||||
MultipleValues = false
|
||||
};
|
||||
|
||||
if (opName.Value == "monthlyTasks") {
|
||||
CommandOption opMailId = new CommandOption("m", OptionTypes.SingleValue )
|
||||
{
|
||||
LongName = "mail-id",
|
||||
Description = "UserOrientedTemplate template id to use ('1')",
|
||||
};
|
||||
|
||||
var sender = app.Services.GetService(typeof(IEmailSender)) as IEmailSender;
|
||||
var mailer = app.Services.GetService(typeof(EMailer)) as EMailer;
|
||||
var loggerFactory = app.Services.GetService(typeof(ILoggerFactory)) as ILoggerFactory;
|
||||
ILogger logger = loggerFactory.CreateLogger<Program>() ;
|
||||
|
||||
mailer.SendMonthlyEmail(opMailId.Value,"UserOrientedTemplate");
|
||||
logger.LogInformation("Finished");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue