static SeedTableBase GetSeedTable(IExcelData excelData, string sheetName, CommonOptions options, SheetNameWithSubdivide subdivide) { var seedTable = excelData.GetSeedTable(sheetName, subdivide.ColumnNamesRow ?? options.columnNamesRow, subdivide.DataStartRow ?? options.dataStartRow, options.ignoreColumns, subdivide.KeyColumnName, options.versionColumn); if (seedTable.Errors.Count != 0) { var skipExceptions = seedTable.Errors.Where(error => error is NoIdColumnException); if (skipExceptions.Count() != 0) { foreach (var error in skipExceptions) { WriteInfo($" skip: {error.Message}"); } } else { foreach (var error in seedTable.Errors) { WriteInfo($" ERROR: {error.Message}"); } throw new CannotContinueException(); } } return(seedTable); }
static SeedTableBase GetSeedTable(IExcelData excelData, string sheetName) { var seedTable = excelData.GetSeedTable(sheetName, 2, 3, null, "ID", null); if (seedTable.Errors.Count != 0) { var skipExceptions = seedTable.Errors.Where(error => error is NoIdColumnException); if (skipExceptions.Count() != 0) { foreach (var error in skipExceptions) { Console.WriteLine($" skip: {error.Message}"); } } else { foreach (var error in seedTable.Errors) { Console.WriteLine($" ERROR: {error.Message}"); } throw new CannotContinueException(); } } return(seedTable); }