public MailSenderClient(IRazorViewEngine razorViewEngine,
                                ITempDataProvider tempDataProvider,
                                IServiceProvider serviceProvider,
                                SmtpConfiguration smtpConfiguration)
        {
            if (razorViewEngine == null)
            {
                throw new ArgumentNullException(nameof(razorViewEngine));
            }

            if (tempDataProvider == null)
            {
                throw new ArgumentNullException(nameof(tempDataProvider));
            }

            if (serviceProvider == null)
            {
                throw new ArgumentNullException(nameof(serviceProvider));
            }

            if (smtpConfiguration == null)
            {
                throw new ArgumentNullException(nameof(smtpConfiguration));
            }

            _viewPicker        = new StandardViewPicker(razorViewEngine, serviceProvider);
            _renderingProvider = new RazorRenderer(tempDataProvider, serviceProvider);
            _mailClient        = new MailClient(smtpConfiguration);
        }
Example #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ControlBase" /> class.
 /// </summary>
 /// <param name="htmlHelper">The helper.</param>
 /// <param name="name">The name.</param>
 protected ControlBase(ControlHelper controlHelper, string name, IRenderingProvider renderingProvider)
     : base(controlHelper.HtmlHelper)
 {
     this.ModelMetadata = ModelMetadataProviders.Current.GetMetadataForType(null, this.GetType());
     this.controlHelper = controlHelper;
     this.GenerateId(name);
     this.RenderingProvider = renderingProvider;
 }
 public RenderingItemProvider(IRenderingProvider renderingProvider, IDatabase contextDatabase, Item contextItem)
 {
     _renderingProvider = renderingProvider;
     _contextDatabase   = contextDatabase;
     _contextItem       = contextItem;
 }
 public MailSenderClient(IViewPicker viewPicker, IRenderingProvider renderingProvider, IMailClient mailClient)
 {
     _renderingProvider = renderingProvider ?? throw new ArgumentNullException(nameof(renderingProvider));
     _viewPicker        = viewPicker ?? throw new ArgumentNullException(nameof(viewPicker));
     _mailClient        = mailClient ?? throw new ArgumentNullException(nameof(mailClient));
 }
 public RenderingItemProvider(IRenderingProvider renderingProvider, IDatabase contextDatabase, Item contextItem)
 {
     _renderingProvider = renderingProvider;
     _contextDatabase = contextDatabase;
     _contextItem = contextItem;
 }