コード例 #1
0
 public static async Task <List <byte[]> > SelectListAsync <M>(this XConnection conn, Expression <Func <M, bool> > compareFunc, Expression <Func <M, byte[]> > columnMapFunc)
     where M : class, new()
 {
     return(await conn.Selecter <M>().Where(compareFunc).SelectListAsync(columnMapFunc));
 }
コード例 #2
0
ファイル: Sum.cs プロジェクト: liumeng0403/MyDAL
 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));
 }
コード例 #3
0
ファイル: Sum.cs プロジェクト: liumeng0403/MyDAL
        /*-------------------------------------------------------------*/

        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));
        }
コード例 #4
0
ファイル: Delete.cs プロジェクト: liumeng0403/MyDAL
        /*-------------------------------------------------------------*/

        public static int Delete(this XConnection conn, string sql, List <XParam> dbParas = null)
        {
            CheckDelete(sql);
            return(conn.ExecuteNonQuery(sql, dbParas));
        }
コード例 #5
0
        /*
         *  剔除 sql server 支持, 拥抱开源 , 仅支持 mysql
         *  [EditorBrowsable(EditorBrowsableState.Never)]
         *  [Obsolete("Use Register(Component.For<T>().Lifestyle.Is(lifestyle)) instead.")]
         */

        #region Internal

        /* 内部方法 */

        private static async Task <int> ExecuteNonQueryAsync(this XConnection conn, string sql, List <XParam> dbParas = null)
        {
            var dc = DcForSQL(conn, sql, dbParas);

            return(await new ExecuteNonQuerySQLAsyncImpl(dc).ExecuteNonQueryAsync());
        }
コード例 #6
0
ファイル: Delete.cs プロジェクト: liumeng0403/MyDAL
        /*-------------------------------------------------------------*/

        /// <summary>
        /// Deleter 便捷 DeleteAsync 方法
        /// </summary>
        public static int Delete <M>(this XConnection conn, Expression <Func <M, bool> > compareFunc)
            where M : class, new()
        {
            return(conn.Deleter <M>().Where(compareFunc).Delete());
        }
コード例 #7
0
ファイル: Delete.cs プロジェクト: liumeng0403/MyDAL
        /*-------------------------------------------------------------*/

        public static async Task <int> DeleteAsync(this XConnection conn, string sql, List <XParam> dbParas = null)
        {
            CheckDelete(sql);
            return(await conn.ExecuteNonQueryAsync(sql, dbParas));
        }
コード例 #8
0
ファイル: Delete.cs プロジェクト: liumeng0403/MyDAL
 /// <summary>
 /// Deleter 便捷 DeleteAsync 方法
 /// </summary>
 public static async Task <int> DeleteAsync <M>(this XConnection conn, Expression <Func <M, bool> > compareFunc)
     where M : class, new()
 {
     return(await conn.Deleter <M>().Where(compareFunc).DeleteAsync());
 }
コード例 #9
0
ファイル: Insert.cs プロジェクト: liumeng0403/MyDAL
        /*-------------------------------------------------------------*/

        /// <summary>
        /// Inserter 便捷 Insert 方法
        /// </summary>
        public static int Insert <M>(this XConnection conn, M m)
            where M : class, new()
        {
            return(conn.Inserter <M>().Insert(m));
        }
コード例 #10
0
ファイル: Insert.cs プロジェクト: liumeng0403/MyDAL
 /// <summary>
 /// Inserter 便捷 InsertAsync 方法
 /// </summary>
 public static async Task <int> InsertAsync <M>(this XConnection conn, M m)
     where M : class, new()
 {
     return(await conn.Inserter <M>().InsertAsync(m));
 }