PageRenderTime 384ms CodeModel.GetById 170ms app.highlight 2ms RepoModel.GetById 210ms app.codeStats 0ms

/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
 1namespace 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
 8    public class ReadUsersFromFile : AbstractOperation
 9    {
10        public override IEnumerable<Row> Execute(IEnumerable<Row> rows)
11        {
12            using(FileEngine file = FluentFile.For<UserRecord>().From("users.txt"))
13            {
14                foreach (object obj in file)
15                {
16                    yield return Row.FromObject(obj);
17                }
18            }
19        }
20    }
21}