Example #1
0
 public SaveAction(ILogger <SaveAction> logger, IOptions <PersistenceOptions> persistenceOptions, SeleniumWrapper seleniumWrapper, PersistenceManager persistenceManager) // DI : constructor must be public
 {
     _logger = logger ?? throw new ArgumentNullException(nameof(logger));
     _logger.LogTrace("new SaveAction()");
     _persistenceOptions = persistenceOptions?.Value ?? throw new ArgumentNullException(nameof(persistenceOptions));
     _seleniumWrapper    = seleniumWrapper ?? throw new ArgumentNullException(nameof(seleniumWrapper));
     _persistenceManager = persistenceManager ?? throw new ArgumentNullException(nameof(persistenceManager));
 }
        public PersistenceManager(ILogger <PersistenceManager> logger, IOptions <PersistenceOptions> persistenceOptions, IOptions <LoggingOptions> loggingOptions) // DI : constructor must be public
        {
            _logger = logger ?? throw new ArgumentNullException(nameof(logger));
            _logger.LogTrace("new PersistenceManager()");
            _persistenceOptions = persistenceOptions?.Value ?? throw new ArgumentNullException(nameof(persistenceOptions));
            _loggingOptions     = loggingOptions?.Value ?? throw new ArgumentNullException(nameof(loggingOptions));

            // defaut in cas a crash occure before InitFileName() finish and a DumpBrowserContextOnCrash is required
            BaseFileName = Path.Combine(Program.ExecutablePath, "Temp");
        }