public IEnumerable <DistributedPartnerContract> Parse(string filename)
        {
            var data = _fileLoader.Fetch(filename);
            var rows = data.Split(Environment.NewLine);

            foreach (var row in rows.Skip(1))
            {
                var columns = row.Split("|");
                yield return(new DistributedPartnerContract
                {
                    Partner = columns.ElementAt(0),
                    Usage = columns.ElementAt(1)
                });
            }
        }
Пример #2
0
        public IEnumerable <MusicContract> Parse(string filename)
        {
            var data = _fileLoader.Fetch(filename);
            var rows = data.Split(Environment.NewLine);

            foreach (var row in rows.Skip(1))
            {
                var columns = row.Split("|");
                yield return(new MusicContract
                {
                    Artist = columns.ElementAt(0),
                    Title = columns.ElementAt(1),
                    Usages = columns.ElementAt(2).Split(", "),
                    StartDate = ConvertDate(columns.ElementAt(3)),
                    EndDate = ConvertDate(columns.ElementAt(4))
                });
            }
        }