private IEnumerable <ResultDefinition> partitionRecord(string record) { IEnumerable <ResultDefinition> validationResults = new List <ResultDefinition>(); var outerPipeline = new Pipeline <ResultDefinition>(); outerPipeline.Register(new LengthChecker()); var rowDefinition = new ResultDefinition { MaxRecordLength = schema.TotalWidth, RowNumber = rowNumber, Record = record, }; var result = outerPipeline.Execute(rowDefinition); if (result != null && result.Any()) { return(result); } var innerPipeline = new Pipeline <ResultDefinition>(); innerPipeline.Register(new TypeChecker()); innerPipeline.Register(new AlignmentChecker()); innerPipeline.Register(new AllowedValuesChecker()); WindowCollection windows = schema.Windows; ColumnCollection definitions = schema.ColumnDefinitions; string[] values = new string[windows.Count]; int offset = 0; for (int index = 0; index != values.Length; ++index) { Window window = windows[index]; IColumnDefinition definition = definitions[index]; string value = record.Substring(offset, window.Width); values[index] = value; offset += window.Width; var dataDefinition = new ResultDefinition { RawValue = value, ColumnDefinition = definition, Window = window, MaxRecordLength = schema.TotalWidth, RowNumber = rowNumber, Record = record }; var innerResult = innerPipeline.Execute(dataDefinition); if (innerResult != null && innerResult.Any()) { validationResults = validationResults.Concat(innerResult); } } return(validationResults); }