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)); }
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)); }
/// <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>()); }
/*-------------------------------------------------------------*/ /// <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()); }
/// <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()); }
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)); }
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)); }
/// <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>()); }
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)); }
/*-------------------------------------------------------------*/ 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)); }
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)); }