Exemplo n.º 1
0
		/// <summary>
		/// Get a scalar value with the given sql string and underlying IDbConnection.
		/// </summary>
		/// <param name="query"></param>
		/// <returns></returns>
		public object GetScalar(Query query)
		{
			if (query == null)
			{
				throw new ArgumentNullException("query");
			}

			return GetScalar(query.GetCommand(conn));
		}
Exemplo n.º 2
0
		/// <summary>
		/// Executes the given sql string using the underlying IDbConnection.
		/// </summary>
		/// <param name="query"></param>
		/// <returns></returns>
		public int Execute(Query query)
		{
			if (query == null)
			{
				throw new ArgumentNullException("query");
			}

			return Execute(query.GetCommand(conn));
		}
Exemplo n.º 3
0
		/// <summary>
		/// Creates a data reader with the given sql string from underlying IDbConnection.
		/// </summary>
		/// <param name="query"></param>
		/// <returns></returns>
		public IDataReader GetDataReader(Query query)
		{
			return GetDataReader(query.GetCommand(conn));
		}
        /// <summary>
        /// Creates an IDataReader from the given IDbConnection using the properties of Query object.
        /// </summary>
        /// <param name="conn"></param>
        /// <param name="query"></param>
        /// <returns></returns>
        public static IDataReader GetDataReader(this IDbConnection conn, Query query)
        {
            IDatabase db = Db.GetConnection(conn);

            return db.GetDataReader(query);
        }
        /// <summary>
        /// Get a scalar value using the IDbConnection and the Query parameters.
        /// </summary>
        /// <param name="conn"></param>
        /// <param name="query"></param>
        /// <returns></returns>
        public static object GetScalar(this IDbConnection conn, Query query)
        {
            IDatabase db = Db.GetConnection(conn);

            return db.GetScalar(query);
        }
        /// <summary>
        /// Executes the Query object with the IDbConnection parameter.
        /// </summary>
        /// <param name="conn"></param>
        /// <param name="query"></param>
        /// <returns></returns>
        public static int Execute(this IDbConnection conn, Query query)
        {
            IDatabase db = Db.GetConnection(conn);

            return db.Execute(query);
        }