/Rhino.Etl.Tests/UsingDAL/ReadUsersFromFile.cs

http://github.com/ayende/rhino-etl · C# · 21 lines · 20 code · 1 blank · 0 comment · 0 complexity · 0b304e105f00c02b55ab5857e0b188b4 MD5 · raw file

  1. namespace Rhino.Etl.Tests.UsingDAL
  2. {
  3. using System.Collections.Generic;
  4. using Core;
  5. using Rhino.Etl.Core.Files;
  6. using Rhino.Etl.Core.Operations;
  7. public class ReadUsersFromFile : AbstractOperation
  8. {
  9. public override IEnumerable<Row> Execute(IEnumerable<Row> rows)
  10. {
  11. using(FileEngine file = FluentFile.For<UserRecord>().From("users.txt"))
  12. {
  13. foreach (object obj in file)
  14. {
  15. yield return Row.FromObject(obj);
  16. }
  17. }
  18. }
  19. }
  20. }