public EmailSpooler(IEmailSpoolerDependencies dependencies) { CheckDependencies(dependencies); _context = dependencies.DbContext; _emailGenerator = dependencies.EmailGenerator; _config = dependencies.EmailSpoolerConfig; }
private static void CheckDependencies(IEmailSpoolerDependencies dependencies) { var missing = new List <string>(); if (dependencies.DbContext == null) { missing.Add("dbContext"); } if (dependencies.EmailGenerator == null) { missing.Add("emailGenerator"); } if (dependencies.EmailSpoolerConfig == null) { missing.Add("emailSpoolerConfig"); } if (missing.Any()) { throw new ArgumentNullException(string.Join(",", missing)); } }
protected virtual IEmailSpooler CreateSpoolerWith(IEmailSpoolerDependencies deps) { return(new EmailSpooler(deps)); }
protected override IEmailSpooler CreateSpoolerWith(IEmailSpoolerDependencies deps) { return(CreateSpooler(deps)); }