/Rhino.Etl.Tests/Aggregation/RowCount.cs
http://github.com/ayende/rhino-etl · C# · 22 lines · 15 code · 2 blank · 5 comment · 2 complexity · 464baa8e91aba690acb58d176f8a03fd MD5 · raw file
- namespace Rhino.Etl.Tests.Aggregation
- {
- using Core;
- using Rhino.Etl.Core.Operations;
- public class RowCount : AbstractAggregationOperation
- {
- /// <summary>
- /// Accumulate the current row to the current aggregation
- /// </summary>
- /// <param name="row">The row.</param>
- /// <param name="aggregate">The aggregate.</param>
- protected override void Accumulate(Row row, Row aggregate)
- {
- if (aggregate["count"] == null)
- aggregate["count"] = 0;
- int count = (int)aggregate["count"];
- aggregate["count"] = count + 1;
- }
- }
- }