/Rhino.Etl.Tests/Integration/SplitName.cs

http://github.com/ayende/rhino-etl · C# · 20 lines · 19 code · 1 blank · 0 comment · 0 complexity · 6b164e2ded5deddf17ad7f40eccdbbca MD5 · raw file

  1. namespace Rhino.Etl.Tests.Integration
  2. {
  3. using System.Collections.Generic;
  4. using Core;
  5. using Rhino.Etl.Core.Operations;
  6. public class SplitName : AbstractOperation
  7. {
  8. public override IEnumerable<Row> Execute(IEnumerable<Row> rows)
  9. {
  10. foreach (Row row in rows)
  11. {
  12. string name = (string)row["name"];
  13. row["FirstName"] = name.Split()[0];
  14. row["LastName"] = name.Split()[1];
  15. yield return row;
  16. }
  17. }
  18. }
  19. }