public DataBaseService(string name, string rootPath, long fileSize, SupportedSources source, IFileWorkerFactory fileWorkerFactory, ITableServiceFactory tableServiceFactory, IDbWriterFactory dbWriterFactory) { _tableServiceFactory = tableServiceFactory; _dbWriterFactory = dbWriterFactory; var regex = new Regex(".*"); //valid if (regex.IsMatch(rootPath)) { DataBase = new DataBase { Name = name, Settings = new Settings { RootPath = rootPath, FileSize = fileSize, DefaultSource = source } }; _fileWorker = fileWorkerFactory.GetFileWorker(DataBase); _fileWorker.UpdateDataBaseFile(); } else { throw new ArgumentException($"Incorrect path: {rootPath}"); } }
public FileHelper(Settings.Settings setting, IDbWriterFactory dbWriterFactory, IDataBaseServiceFactory dataBaseServiceFactory) { _setting = setting; _dbWriterFactory = dbWriterFactory; _dataBaseServiceFactory = dataBaseServiceFactory; }
public DataBaseServiceFactory(IFileWorkerFactory fileWorkerFactory, ITableServiceFactory tableServiceFactory, IDbWriterFactory dbWriterFactory) { _fileWorkerFactory = fileWorkerFactory; _tableServiceFactory = tableServiceFactory; _dbWriterFactory = dbWriterFactory; }
public FileWorker(DataBase dataBase, IDbWriterFactory dbWriterFactory, ISourceFactory sourceFactory) { _sourceFactory = sourceFactory; DataBase = dataBase; _dbWriter = dbWriterFactory.GetDbWriter(dataBase.Settings.DefaultSource); }
public DataBaseService(string path, IFileWorkerFactory fileWorkerFactory, ITableServiceFactory tableServiceFactory, IDbWriterFactory dbWriterFactory) { _tableServiceFactory = tableServiceFactory; _dbWriterFactory = dbWriterFactory; SupportedSources source = ResolvePath(path); _fileWorker = fileWorkerFactory.GetFileWorker(new DataBase { Settings = new Settings { DefaultSource = source } }); DataBase = _fileWorker.GetDataBaseFromFile(path); _fileWorker.DataBase = DataBase; }
public FileWorkerFactory(IDbWriterFactory dbWriterFactory, ISourceFactory sourceFactory) { _dbWriterFactory = dbWriterFactory; _sourceFactory = sourceFactory; }