PageRenderTime 16ms CodeModel.GetById 13ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

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