Esempio n. 1
0
        public static CommandBuffer Update <TSource>(this CommandBuffer buffer, TSource source, RelationHeader sourceHeader)
        {
            if (buffer == null)
            {
                throw new ArgumentNullException(nameof(buffer));
            }

            if (buffer.Store == null)
            {
                throw CommandException.NoSchemaStoreAttached();
            }

            IRelation relation = new Relation(buffer.Store.From(source), sourceHeader);

            buffer.Update(relation);

            return(buffer);
        }
Esempio n. 2
0
        public static CommandBuffer Update <TSource>(this CommandBuffer buffer, TSource source, IEnumerable <string> sourceHeader)
        {
            if (buffer == null)
            {
                throw new ArgumentNullException(nameof(buffer));
            }

            if (buffer.Store == null)
            {
                throw CommandException.NoSchemaStoreAttached();
            }

            ISchema schema = buffer.Store.GetSchema(typeof(TSource));

            buffer.Update(source, schema.Select(sourceHeader));

            return(buffer);
        }
Esempio n. 3
0
        public static CommandBuffer Update(this CommandBuffer buffer, IRelation relation)
        {
            if (buffer == null)
            {
                throw new ArgumentNullException(nameof(buffer));
            }

            if (relation == null)
            {
                throw new ArgumentNullException(nameof(buffer));
            }

            if (buffer.Store == null)
            {
                throw CommandException.NoSchemaStoreAttached();
            }

            using IDataReader dataReader = relation.GetDataReader();

            buffer.Update(dataReader);

            return(buffer);
        }