Exemplo n.º 1
0
        public void SaveAll(ExtractionType et)
        {
            var    outputFolder = $"{OutputParentFolder}\\{et.ToString()}\\";
            string extension;

            switch (et)
            {
            case ExtractionType.QueryPlans:
                extension = ".sqlplan";
                break;

            case ExtractionType.SqlText:
                extension = ".sql";
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(et), et, null);
            }

            foreach (var co in HandlesList)
            {
                var file = $"{outputFolder}{co.Key}{extension}";
                switch (et)
                {
                case ExtractionType.QueryPlans:
                    File.WriteAllText(file, co.Value.QueryPlan);
                    break;

                case ExtractionType.SqlText:
                    File.WriteAllText(file, co.Value.SqlText);
                    break;

                default:
                    throw new ArgumentOutOfRangeException(nameof(et), et, null);
                }
                co.Value.OutputFile = file;
            }
        }
Exemplo n.º 2
0
 public DocumentBuilder WithExtractionType(ExtractionType extractionType)
 {
     this.extractionTypes.Add(extractionType.ToString());
     return(this);
 }
Exemplo n.º 3
0
        public void SaveAll(ExtractionType et)
        {
            var outputFolder = $"{OutputParentFolder}\\{et.ToString()}\\";
            string extension;
            switch (et)
            {
                case ExtractionType.QueryPlans:
                    extension = ".sqlplan";
                    break;
                case ExtractionType.SqlText:
                    extension = ".sql";
                    break;
                default:
                    throw new ArgumentOutOfRangeException(nameof(et), et, null);
            }

            foreach (var co in HandlesList)
            {
                var file = $"{outputFolder}{co.Key}{extension}";
                switch (et)
                {
                    case ExtractionType.QueryPlans:
                        File.WriteAllText(file, co.Value.QueryPlan);
                        break;
                    case ExtractionType.SqlText:
                        File.WriteAllText(file, co.Value.SqlText);
                        break;
                    default:
                        throw new ArgumentOutOfRangeException(nameof(et), et, null);
                }
                co.Value.OutputFile = file;
            }
        }