/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

  1. namespace Rhino.Etl.Tests.Aggregation
  2. {
  3. using Core;
  4. using Rhino.Etl.Core.Operations;
  5. public class RowCount : AbstractAggregationOperation
  6. {
  7. /// <summary>
  8. /// Accumulate the current row to the current aggregation
  9. /// </summary>
  10. /// <param name="row">The row.</param>
  11. /// <param name="aggregate">The aggregate.</param>
  12. protected override void Accumulate(Row row, Row aggregate)
  13. {
  14. if (aggregate["count"] == null)
  15. aggregate["count"] = 0;
  16. int count = (int)aggregate["count"];
  17. aggregate["count"] = count + 1;
  18. }
  19. }
  20. }