public override IEnumerable <IRow> Operate(IEnumerable <IRow> rows) { foreach (var outer in rows) { var values = (string[])outer[_input]; if (values.Length == 0) { yield return(outer); } else { foreach (var value in values) { var inner = _rowFactory.Clone(outer, _fields); inner[Context.Field] = value; // this has to be done whenever adding rows if (!Context.Process.ReadOnly) { inner = _setSystemFields.Operate(inner); inner[_hashCode] = HashcodeTransform.GetHashCode(_fieldsToHash.Select(f => inner[f])); } yield return(inner); } } } }
private void AddInnerRow(ref IRow innerRow, ref IRow outerRow, ref List <IRow> innerRows) { var r = _rowFactory.Clone(innerRow, _fields); foreach (var field in _outerFields) { r[field] = outerRow[field]; } innerRows.Add(r); innerRow = _rowFactory.Create(); foreach (var field in _fields) { innerRow[field] = field.Default == Constants.DefaultSetting ? _typeDefaults[field.Type] : field.Convert(field.Default); } }
private void AddInnerRow(ref IRow innerRow, ref IRow outerRow, ref List <IRow> innerRows) { var r = _rowFactory.Clone(innerRow, _fields); foreach (var field in _outerFields) { r[field] = outerRow[field]; } if (!Context.Process.ReadOnly) { r = _setSystemFields.Operate(r); r[_hashCode] = HashcodeTransform.GetHashCode(_fieldsToHash.Select(f => r[f])); } innerRows.Add(r); innerRow = _rowFactory.Create(); foreach (var field in _fields) { innerRow[field] = field.Default == Constants.DefaultSetting ? _typeDefaults[field.Type] : field.Convert(field.Default); } }