preparing to feed abstract
test should run ok [modulo config]
This commit is contained in:
@ -1,25 +1,8 @@
|
||||
using System;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Extensions.OptionsModel;
|
||||
|
||||
using System.Globalization;
|
||||
using System.Reflection;
|
||||
// using Microsoft.AspNet.Authorization;
|
||||
using Microsoft.AspNet.Builder;
|
||||
// using Microsoft.AspNet.Diagnostics;
|
||||
using Microsoft.AspNet.Hosting;
|
||||
using Microsoft.AspNet.Identity;
|
||||
using Microsoft.AspNet.Identity.EntityFramework;
|
||||
using Microsoft.AspNet.Localization;
|
||||
using Microsoft.AspNet.Mvc;
|
||||
using Microsoft.AspNet.Mvc.Filters;
|
||||
using Microsoft.AspNet.Mvc.Razor;
|
||||
using Microsoft.Net.Http.Headers;
|
||||
using Microsoft.AspNet.Razor;
|
||||
using Microsoft.Extensions.DependencyInjection.Abstractions;
|
||||
using Microsoft.Extensions.PlatformAbstractions;
|
||||
using cli.Services;
|
||||
|
||||
namespace cli
|
||||
|
@ -1,29 +1,23 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.CodeDom;
|
||||
using System.CodeDom.Compiler;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using Microsoft.CodeAnalysis;
|
||||
using Microsoft.CodeAnalysis.CSharp;
|
||||
using Microsoft.CodeAnalysis.Emit;
|
||||
using Microsoft.AspNet.Razor;
|
||||
using Microsoft.AspNet.Razor.Generator;
|
||||
using Microsoft.Extensions.Localization;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.CSharp;
|
||||
using Microsoft.AspNet.Identity.EntityFramework;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
using Yavsc.Models;
|
||||
using Yavsc.Models.Identity;
|
||||
using Yavsc.Templates;
|
||||
using Yavsc.Abstract.Templates;
|
||||
using Yavsc.Services;
|
||||
|
||||
using Yavsc.Abstract.Manage;
|
||||
|
||||
namespace cli.Services
|
||||
{
|
||||
@ -172,13 +166,17 @@ namespace cli.Services
|
||||
generatedtemplate.User = user;
|
||||
generatedtemplate.ExecuteAsync();
|
||||
logger.LogInformation(generatedtemplate.GeneratedText);
|
||||
var mailSentInfo = this.mailSender.SendEmailAsync
|
||||
(user.UserName, user.Email, $"monthly email", generatedtemplate.GeneratedText).Result;
|
||||
if (!mailSentInfo.Sent)
|
||||
EmailSentViewModel mailSentInfo = this.mailSender.SendEmailAsync
|
||||
(user.UserName, user.Email, $"monthly email", generatedtemplate.GeneratedText).Result;
|
||||
if (mailSentInfo==null)
|
||||
logger.LogError("No info on sending");
|
||||
else if (!mailSentInfo.Sent)
|
||||
logger.LogError($"{mailSentInfo.ErrorMessage}");
|
||||
else
|
||||
logger.LogInformation($"mailId:{mailSentInfo.MessageId} \nto:{user.UserName}");
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -57,7 +57,7 @@ namespace cli
|
||||
var smtpSettingsconf = Configuration.GetSection("Smtp");
|
||||
services.Configure<SmtpSettings>(smtpSettingsconf);
|
||||
services.AddInstance(typeof(ILoggerFactory), new LoggerFactory());
|
||||
services.AddTransient(typeof(IEmailSender), typeof(MessageSender));
|
||||
services.AddTransient(typeof(IEmailSender), typeof(MailSender));
|
||||
services.AddTransient(typeof(RazorEngineHost), typeof(YaRazorEngineHost));
|
||||
services.AddEntityFramework().AddNpgsql().AddDbContext<ApplicationDbContext>();
|
||||
services.AddTransient((s) => new RazorTemplateEngine(s.GetService<RazorEngineHost>()));
|
||||
|
@ -44,15 +44,15 @@
|
||||
"Microsoft.Framework.ConfigurationModel.Json": "1.0.0-beta4",
|
||||
"Newtonsoft.Json": "9.0.1",
|
||||
"Yavsc": {
|
||||
"version": "1.0.5-rc21-beta7",
|
||||
"version": "1.0.5-rc21-beta8",
|
||||
"target": "package"
|
||||
},
|
||||
"Yavsc.Abstract": {
|
||||
"version": "1.0.5-rc21-beta7",
|
||||
"version": "1.0.5-rc21-beta8",
|
||||
"target": "package"
|
||||
},
|
||||
"Yavsc.Server": {
|
||||
"version": "1.0.5-rc21-beta7",
|
||||
"version": "1.0.5-rc21-beta8",
|
||||
"target": "package"
|
||||
},
|
||||
"Yavsc.Lib.Portable": "1.0.2"
|
||||
|
Reference in New Issue
Block a user