示例#1
0
        /// <summary>
        /// Selects on FetchFirst
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="fetchFirst"></param>
        /// <param name="transaction"></param>
        /// <param name="ticket"></param>
        /// <returns></returns>
        public static async Task <IEnumerable <T> > SelectAsync <T>(this FetchFirst fetchFirst, IDbTransaction transaction = null, ITicket ticket = null)
        {
            string sql = Select <T>(fetchFirst, ticket, true);

            return(await fetchFirst.Connection.QueryAsync <T>(sql : sql, transaction : transaction).ConfigureAwait(false));
        }
示例#2
0
 /// <summary>
 /// Selects on FetchFirst
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="fetchFirst"></param>
 /// <param name="ticket"></param>
 /// <returns></returns>
 public static string SelectAsString <T>(this FetchFirst fetchFirst, ITicket ticket = null)
 {
     return(Select <T>(fetchFirst, ticket, false));
 }
示例#3
0
        /// <summary>
        /// Selects on FetchFirst
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="fetchFirst"></param>
        /// <param name="transaction"></param>
        /// <param name="ticket"></param>
        /// <returns></returns>
        public static IEnumerable <T> Select <T>(this FetchFirst fetchFirst, IDbTransaction transaction = null, ITicket ticket = null)
        {
            string sql = Select <T>(fetchFirst, ticket, true);

            return(fetchFirst.Connection.Query <T>(sql: sql, transaction: transaction));
        }