/Rhino.Etl.Tests/LoadTest/UpperCaseColumn.cs

http://github.com/ayende/rhino-etl · C# · 31 lines · 23 code · 3 blank · 5 comment · 0 complexity · 44a88c3fafd003e01211b9da8a6a5ff4 MD5 · raw file

  1. namespace Rhino.Etl.Tests.LoadTest
  2. {
  3. using System.Collections.Generic;
  4. using Core;
  5. using Rhino.Etl.Core.Operations;
  6. public class UpperCaseColumn : AbstractOperation
  7. {
  8. private readonly string column;
  9. public UpperCaseColumn(string column)
  10. {
  11. this.column = column;
  12. }
  13. /// <summary>
  14. /// Executes this operation
  15. /// </summary>
  16. /// <param name="rows">The rows.</param>
  17. /// <returns></returns>
  18. public override IEnumerable<Row> Execute(IEnumerable<Row> rows)
  19. {
  20. foreach (Row row in rows)
  21. {
  22. row[column] = ((string) row[column] ?? "").ToUpper();
  23. row["testMsg"] = "UpperCased";
  24. yield return row;
  25. }
  26. }
  27. }
  28. }