public FileRepositoryConfig Build() { this.entityPropertiesForFiles.OnMissing = entityType => new EntityPropertiesForFile(entityType); var filePathResolver = new FilePathResolver(this.entityPropertiesForFiles, this.rootPathFolder, this.fileExtension); var connectionResolver = new FileConnectionResolver(this.entityPropertiesForFiles, filePathResolver); this.disposeStrategy = this.disposeStrategy ?? new DisposeConnectionResolver(connectionResolver); this.insertStrategy = this.insertStrategy ?? new FileInsert(connectionResolver, this.outputConventions, this.delimitor, this.fieldQualifier); this.fileEntityFactoryStrategy = this.fileEntityFactoryStrategy ?? (string.IsNullOrEmpty(this.delimitor) ? (IFileEntityFactoryStrategy) new ConstructorContainsLine() : new ConstructByEvaluatingDelimitedFile(this.delimitor, this.fieldQualifier)); return new FileRepositoryConfig { ConnectionResolver = connectionResolver, Indexes = this.indexes, EntityFactoryStrategy = this.fileEntityFactoryStrategy, DisposeStrategy = this.disposeStrategy, InsertStrategy = this.insertStrategy, NextIdStrategy = this.nextIdStrategy, SetIdStrategy = this.setIdStrategy, PersistedDataPath = this.persistedDataPath }; }
public FileRepositoryConfigBuilder WithFileEntityFactoryStrategy(IFileEntityFactoryStrategy newValue) { this.fileEntityFactoryStrategy = newValue; return this; }