public EmailSender( IEnumerable <IEmailProviderType> emailProviderTypes, IOptions <EmailOptions> options, IStorageFactory storageFactory, ITemplateLoaderFactory templateLoaderFactory) { this.options = options.Value; var providerType = emailProviderTypes .FirstOrDefault(x => x.Name == this.options.Provider.Type); if (providerType == null) { throw new ArgumentNullException("ProviderType", $"The provider type {this.options.Provider.Type} does not exist. Maybe you are missing a reference or an Add method call in your Startup class."); } this.provider = providerType.BuildProvider(this.options.Provider); if (!string.IsNullOrWhiteSpace(this.options.TemplateStorage)) { var store = storageFactory.GetStore(this.options.TemplateStorage); if (store == null) { throw new ArgumentNullException("TemplateStorage", $"There is no file store configured with name {this.options.TemplateStorage}. Unable to initialize email templating."); } this.templateLoader = templateLoaderFactory.Create(store); } }
public GenericStoreProxy(IStorageFactory factory, IOptions <TOptions> options) { if (options == null) { throw new ArgumentNullException("options", "Unable to build generic Store. Did you forget to configure your options?"); } this.innerStore = factory.GetStore(options.Value.Name, options.Value); }
public FileController(IStorageFactory storageFactory, IPostService postService, IFileService fileService, IGroupService groupService) { this.fileStore = storageFactory.GetStore("LocalFileStorage"); this.postService = postService; this.fileService = fileService; this.groupService = groupService; }
public StoreBase(string storeName, IStorageFactory storageFactory) { this.store = storageFactory.GetStore(storeName); }
public SampleController(IStorageFactory storageFactory) { this.sharedAssets = storageFactory.GetStore("SharedAssets"); }
public FileService(IStorageFactory storageFactory) { this.fileStore = storageFactory.GetStore("LocalFileStorage"); this.webClient = new WebClient(); }