Пример #1
0
        public virtual object ExecuteScalar(SqlQuery query)
        {
            if (null == query)
                throw new ArgumentNullException(nameof(query));

            OperationResult<Object> result = this.Service.ExecuteScalar(query.Serialize());
            DbAccessProxy.TransferParameters(query.Parameters, result.CreateParameterList());

            return result.Value;
        }
Пример #2
0
        public virtual IDataReader CreateDataReader(SqlQuery query, CommandBehavior behavior)
        {
            if (null == query)
                throw new ArgumentNullException(nameof(query));

           OperationResult<DataTable> result =  this.Service.CreateDataReader(query.Serialize(),behavior);
           DbAccessProxy.TransferParameters(query.Parameters, result.CreateParameterList());

           return result.Value.CreateDataReader();
        }