public OpmlController( ILogger <OpmlController> logger, CategoryService categoryService, BlogConfig blogConfig, BlogConfigurationService blogConfigurationService) : base(logger) { _categoryService = categoryService; _blogConfig = blogConfig; _blogConfig.GetConfiguration(blogConfigurationService); }
public SearchController( ILogger <OpmlController> logger, IOptions <AppSettings> settings, PostService postService, BlogConfig blogConfig, BlogConfigurationService blogConfigurationService) : base(logger, settings) { _postService = postService; _blogConfig = blogConfig; _blogConfig.GetConfiguration(blogConfigurationService); }
public CommentService( ILogger <CommentService> logger, IOptions <AppSettings> settings, BlogConfig blogConfig, BlogConfigurationService blogConfigurationService, IRepository <Comment> commentRepository, IRepository <CommentReply> commentReplyRepository) : base(logger: logger, settings: settings) { _blogConfig = blogConfig; _commentRepository = commentRepository; _commentReplyRepository = commentReplyRepository; _blogConfig.GetConfiguration(blogConfigurationService); }
public ImageController( ILogger <ImageController> logger, IOptions <AppSettings> settings, IMemoryCache memoryCache, IAsyncImageStorageProvider imageStorageProvider, ISessionBasedCaptcha captcha, BlogConfig blogConfig, BlogConfigurationService blogConfigurationService) : base(logger, settings, memoryCache: memoryCache) { _blogConfig = blogConfig; _blogConfig.GetConfiguration(blogConfigurationService); _imageStorageProvider = imageStorageProvider; _captcha = captcha; }
public SyndicationService( ILogger <SyndicationService> logger, IOptions <AppSettings> settings, BlogConfig blogConfig, BlogConfigurationService blogConfigurationService, IHttpContextAccessor httpContextAccessor, IRepository <Category> categoryRepository, IRepository <Post> postRepository) : base(logger: logger, settings: settings) { _blogConfig = blogConfig; _categoryRepository = categoryRepository; _postRepository = postRepository; _blogConfig.GetConfiguration(blogConfigurationService); var acc = httpContextAccessor; _baseUrl = $"{acc.HttpContext.Request.Scheme}://{acc.HttpContext.Request.Host}"; }
public EmailService( ILogger <EmailService> logger, IOptions <AppSettings> settings, IHostingEnvironment env, BlogConfig blogConfig, BlogConfigurationService blogConfigurationService, IRepository <Post> postRepository) : base(logger, settings) { _env = env; _blogConfig = blogConfig; _postRepository = postRepository; _blogConfig.GetConfiguration(blogConfigurationService); var configSource = $@"{AppDomain.CurrentDomain.GetData(Constants.AppBaseDirectory)}\mailConfiguration.xml"; if (!File.Exists(configSource)) { throw new FileNotFoundException("Configuration file for EmailHelper is not present.", configSource); } if (EmailHelper == null) { var emailSettings = new EmailSettings( _blogConfig.EmailConfiguration.SmtpServer, _blogConfig.EmailConfiguration.SmtpUserName, _blogConfig.EmailConfiguration.SmtpPassword, _blogConfig.EmailConfiguration.SmtpServerPort) { EnableSsl = _blogConfig.EmailConfiguration.EnableSsl, EmailDisplayName = _blogConfig.EmailConfiguration.EmailDisplayName, SenderName = _blogConfig.EmailConfiguration.EmailDisplayName }; EmailHelper = new EmailHelper(configSource, emailSettings); EmailHelper.EmailSent += (sender, eventArgs) => { if (sender is MailMessage msg) { Logger.LogInformation($"Email {msg.Subject} is sent, Success: {eventArgs.IsSuccess}"); } }; } }
public SettingsController( ILogger <SettingsController> logger, IOptionsSnapshot <AppSettings> settings, IApplicationLifetime appLifetime, EmailService emailService, FriendLinkService friendLinkService, BlogConfig blogConfig, BlogConfigurationService blogConfigurationService) : base(logger, settings) { _applicationLifetime = appLifetime; _blogConfig = blogConfig; _blogConfigurationService = blogConfigurationService; _blogConfig.GetConfiguration(blogConfigurationService); _emailService = emailService; _friendLinkService = friendLinkService; }
public CommentController( ILogger <CommentController> logger, IOptions <AppSettings> settings, IMemoryCache memoryCache, CommentService commentService, EmailService emailService, PostService postService, ISessionBasedCaptcha captcha, BlogConfig blogConfig, BlogConfigurationService blogConfigurationService, LinkGenerator linkGenerator) : base(logger, settings, memoryCache: memoryCache) { _blogConfig = blogConfig; _linkGenerator = linkGenerator; _blogConfig.GetConfiguration(blogConfigurationService); _commentService = commentService; _emailService = emailService; _postService = postService; _captcha = captcha; }