public static IField Lookup(this IField source, string attributeName)
        {
            IRelation relation = source.Select(attributeName);

            using IRelationReader reader = relation.GetReader();

            if (reader.Read())
            {
                return(reader[0]);
            }

            return(null);
        }
Esempio n. 2
0
        public static IEnumerable <ColumnBinding> AsBindings(this IRelation targets)
        {
            if (targets == null)
            {
                throw new ArgumentNullException(nameof(targets));
            }

            using IRelationReader reader = targets.GetReader();

            List <ColumnBinding> bindings = new List <ColumnBinding>();

            while (reader.Read())
            {
                bindings.AddRange(reader.AsBindings());
            }

            return(bindings);
        }
Esempio n. 3
0
        public IList <IParameter> Add(IRelation relation)
        {
            if (relation == null)
            {
                throw new ArgumentNullException(nameof(relation));
            }

            using IRelationReader reader = relation.GetReader();

            List <IParameter> parameters = new List <IParameter>();

            while (reader.Read())
            {
                parameters.AddRange(this.Add(reader));
            }

            return(parameters);
        }