Ejemplo n.º 1
0
        public IEnumerable<Row> GetTypedDataSet(string name) {
            var rows = new List<Row>();
            var dataSet = _input.Process.DataSets.FirstOrDefault(ds => ds.Name == name);

            if (dataSet == null)
                return rows;

            var lookup = _input.Entity.Fields.ToDictionary(k => k.Name, v => v);
            foreach (var row in dataSet.Rows) {
                var pipelineRow = new Row(_input.RowCapacity, _input.Entity.IsMaster);
                foreach (var pair in row) {
                    if (!lookup.ContainsKey(pair.Key))
                        continue;
                    var field = lookup[pair.Key];
                    pipelineRow[field] = field.Convert(pair.Value);
                }
                rows.Add(pipelineRow);
            }
            return rows;
        }
Ejemplo n.º 2
0
 public bool Match(Field[] fields, Row other) {
     return fields.Length > 1 ?
         fields.Select(f => this[f]).SequenceEqual(fields.Select(f => other[f])) :
         this[fields[0]].Equals(other[fields[0]]);
 }