Example #1
0
        /// <summary>
        /// Queues the specified query.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="query">The query.</param>
        public void Queue <T>(IQueryable <T> query)
        {
            QueryCommand  cmd         = _linqProvider.GetCommand(query.Expression);
            List <object> paramValues = new List <object>();

            foreach (var p in cmd.Parameters)
            {
                paramValues.Add(p.ParameterValue);
            }
            ISqlQuery q = new CodingHorror(_provider, cmd.CommandSql, paramValues.ToArray());

            _queries.Add(q);
        }
Example #2
0
        /// <summary>
        /// Queues a query for use in a transaction.
        /// </summary>
        /// <param name="sql">The SQL.</param>
        /// <param name="parameters">The parameters.</param>
        public void QueueForTransaction(string sql, params object[] parameters)
        {
            var qry = new CodingHorror(sql, parameters);

            _fixedCommands.Add(qry.GetCommand());
        }