Beispiel #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.Selecter <M>().Where(compareFunc).SumAsync(propertyFunc));
 }
Beispiel #2
0
 public static List <int> SelectList <M>(this XConnection conn, Expression <Func <M, bool> > compareFunc, Expression <Func <M, int> > columnMapFunc)
     where M : class, new()
 {
     return(conn.Selecter <M>().Where(compareFunc).SelectList(columnMapFunc));
 }
Beispiel #3
0
 /// <summary>
 /// 请参阅: <see langword=".SelectListAsync() 使用 https://www.cnblogs.com/Meng-NET/"/>
 /// </summary>
 public static List <VM> SelectList <M, VM>(this XConnection conn, Expression <Func <M, bool> > compareFunc)
     where M : class, new()
     where VM : class
 {
     return(conn.Selecter <M>().Where(compareFunc).SelectList <VM>());
 }
Beispiel #4
0
        /*-------------------------------------------------------------*/

        /// <summary>
        /// Selecter 便捷 CountAsync 方法
        /// </summary>
        public static int Count <M>(this XConnection conn, Expression <Func <M, bool> > compareFunc)
            where M : class, new()
        {
            return(conn.Selecter <M>().Where(compareFunc).Count());
        }
Beispiel #5
0
 /// <summary>
 /// Selecter 便捷 CountAsync 方法
 /// </summary>
 public static async Task <int> CountAsync <M>(this XConnection conn, Expression <Func <M, bool> > compareFunc)
     where M : class, new()
 {
     return(await conn.Selecter <M>().Where(compareFunc).CountAsync());
 }
Beispiel #6
0
 public static float?SelectOne <M>(this XConnection conn, Expression <Func <M, bool> > compareFunc, Expression <Func <M, float?> > columnMapFunc)
     where M : class, new()
 {
     return(conn.Selecter <M>().Where(compareFunc).SelectOne(columnMapFunc));
 }
Beispiel #7
0
 public static async Task <long> SelectOneAsync <M>(this XConnection conn, Expression <Func <M, bool> > compareFunc, Expression <Func <M, long> > columnMapFunc)
     where M : class, new()
 {
     return(await conn.Selecter <M>().Where(compareFunc).SelectOneAsync(columnMapFunc));
 }
Beispiel #8
0
 /// <summary>
 /// 请参阅: <see langword=".SelectOneAsync() 使用 https://www.cnblogs.com/Meng-NET/"/>
 /// </summary>
 public static async Task <VM> SelectOneAsync <M, VM>(this XConnection conn, Expression <Func <M, bool> > compareFunc)
     where M : class, new()
     where VM : class
 {
     return(await conn.Selecter <M>().Where(compareFunc).SelectOneAsync <VM>());
 }
Beispiel #9
0
 public static async Task <List <TimeSpan?> > SelectListAsync <M>(this XConnection conn, Expression <Func <M, bool> > compareFunc, Expression <Func <M, TimeSpan?> > columnMapFunc)
     where M : class, new()
 {
     return(await conn.Selecter <M>().Where(compareFunc).SelectListAsync(columnMapFunc));
 }
Beispiel #10
0
        /*-------------------------------------------------------------*/

        public static F Sum <M, F>(this XConnection conn, Expression <Func <M, bool> > compareFunc, Expression <Func <M, F> > propertyFunc)
            where M : class, new()
            where F : struct
        {
            return(conn.Selecter <M>().Where(compareFunc).Sum(propertyFunc));
        }
Beispiel #11
0
 public static decimal?Sum <M>(this XConnection conn, Expression <Func <M, bool> > compareFunc, Expression <Func <M, decimal?> > propertyFunc)
     where M : class, new()
 {
     return(conn.Selecter <M>().Where(compareFunc).Sum(propertyFunc));
 }