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