PageRenderTime 132ms CodeModel.GetById 105ms app.highlight 2ms RepoModel.GetById 24ms app.codeStats 0ms

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