Esempio n. 1
0
 public static async Task <F?> SumAsync <M, F>
     (this XConnection conn, Expression <Func <M, bool> > compareFunc, Expression <Func <M, F?> > propertyFunc)
     where M : class, new()
     where F : struct
 {
     return(await conn.Queryer <M>().Where(compareFunc).SumAsync(propertyFunc));
 }
Esempio n. 2
0
        /*-------------------------------------------------------------*/

        /// <summary>
        /// Queryer 便捷-同步 IsExistAsync 方法
        /// </summary>
        public static bool IsExist <M>(this XConnection conn, Expression <Func <M, bool> > compareFunc)
            where M : class, new()
        {
            return(conn.Queryer <M>().Where(compareFunc).IsExist());
        }
Esempio n. 3
0
 /// <summary>
 /// 请参阅: <see langword=".IsExistAsync() 使用 https://www.cnblogs.com/Meng-NET/"/>
 /// </summary>
 public static async Task <bool> IsExistAsync <M>(this XConnection conn, Expression <Func <M, bool> > compareFunc)
     where M : class, new()
 {
     return(await conn.Queryer <M>().Where(compareFunc).IsExistAsync());
 }
Esempio n. 4
0
 public static async Task <int?> QueryOneAsync <M>(this XConnection conn, Expression <Func <M, bool> > compareFunc, Expression <Func <M, int?> > columnMapFunc)
     where M : class, new()
 {
     return(await conn.Queryer <M>().Where(compareFunc).QueryOneAsync(columnMapFunc));
 }
Esempio n. 5
0
 /// <summary>
 /// Queryer 便捷-同步 QueryOneAsync 方法
 /// </summary>
 public static T QueryOne <M, T>(this XConnection conn, Expression <Func <M, bool> > compareFunc, Expression <Func <M, T> > columnMapFunc)
     where M : class, new()
 {
     return(conn.Queryer <M>().Where(compareFunc).QueryOne(columnMapFunc));
 }
Esempio n. 6
0
 /// <summary>
 /// Queryer 便捷-同步 QueryOneAsync 方法
 /// </summary>
 public static VM QueryOne <M, VM>(this XConnection conn, Expression <Func <M, bool> > compareFunc)
     where M : class, new()
     where VM : class
 {
     return(conn.Queryer <M>().Where(compareFunc).QueryOne <VM>());
 }
Esempio n. 7
0
 /// <summary>
 /// 请参阅: <see langword=".QueryOneAsync() 使用 https://www.cnblogs.com/Meng-NET/"/>
 /// </summary>
 public static async Task <VM> QueryOneAsync <M, VM>(this XConnection conn, Expression <Func <M, bool> > compareFunc)
     where M : class, new()
     where VM : class
 {
     return(await conn.Queryer <M>().Where(compareFunc).QueryOneAsync <VM>());
 }
Esempio n. 8
0
 public static List <string> QueryList <M>(this XConnection conn, Expression <Func <M, bool> > compareFunc, Expression <Func <M, string> > columnMapFunc)
     where M : class, new()
 {
     return(conn.Queryer <M>().Where(compareFunc).QueryList(columnMapFunc));
 }
Esempio n. 9
0
 public static int?Sum <M>(this XConnection conn, Expression <Func <M, bool> > compareFunc, Expression <Func <M, int?> > propertyFunc)
     where M : class, new()
 {
     return(conn.Queryer <M>().Where(compareFunc).Sum(propertyFunc));
 }