Execute() public static méthode

public static Execute ( int count, string title, System.Action fun ) : void
count int
title string
fun System.Action
Résultat void
Exemple #1
0
        private static void AntData(int eachCount)
        {
            GC.Collect();                        //回收资源
            System.Threading.Thread.Sleep(2000); //休息2秒

            //正试比拼
            PerHelper.Execute(eachCount, "AntData", () =>
            {
                var aa = DB.Tables.Tests.FindByBk(1000);
            });
        }
Exemple #2
0
        private static void AntData(int eachCount)
        {
            GC.Collect();                        //回收资源
            System.Threading.Thread.Sleep(2000); //休息2秒

            //正试比拼
            PerHelper.Execute(eachCount, "AntData", () =>
            {
                DB.BulkCopy(GetList);
            });
        }
Exemple #3
0
        private static void SqlSugar(int eachCount)
        {
            GC.Collect();                        //回收资源
            System.Threading.Thread.Sleep(2000); //休息2秒

            PerHelper.Execute(eachCount, "SqlSugar", () =>
            {
                using (SqlSugarClient conn = new SqlSugarClient(PubConst.connectionString))
                {
                    var list = conn.Insert(GetItem);
                }
            });
        }
Exemple #4
0
        private static void SqlSugar(int eachCount)
        {
            GC.Collect();                        //回收资源
            System.Threading.Thread.Sleep(2000); //休息2秒

            PerHelper.Execute(eachCount, "SqlSugar", () =>
            {
                using (SqlSugarClient conn = new SqlSugarClient(PubConst.connectionString))
                {
                    var list = conn.Queryable <Models.PkDapper.Test>().ToList();
                }
            });
        }
Exemple #5
0
        private static void SqlSugar(int eachCount)
        {
            GC.Collect();                        //回收资源
            System.Threading.Thread.Sleep(2000); //休息2秒

            PerHelper.Execute(eachCount, "SqlSugar", () =>
            {
                using (SqlSugarClient conn = new SqlSugarClient(PubConst.connectionString))
                {
                    var list = conn.SqlQuery <Test>("select * from(select *,row_number() over(order by id) as r from test  ) t where t.r between @b and @e ", new { b = 1000, e = 1010 });
                }
            });
        }
Exemple #6
0
        private static void Dapper(int eachCount)
        {
            GC.Collect();                        //回收资源
            System.Threading.Thread.Sleep(2000); //休息2秒

            //正试比拼
            PerHelper.Execute(eachCount, "Dapper", () =>
            {
                using (SqlConnection conn = new SqlConnection(PubConst.connectionString))
                {
                    var list = conn.Insert(GetItem);
                }
            });
        }
Exemple #7
0
        private static void SqlSugar(int eachCount)
        {
            GC.Collect();                        //回收资源
            System.Threading.Thread.Sleep(2000); //休息2秒

            PerHelper.Execute(eachCount, "SqlSugar", () =>
            {
                using (SqlSugarClient conn = new SqlSugarClient(PubConst.connectionString))
                {
                    var ids  = GetDeleteList().Select(it => it.Id).ToArray();
                    var list = conn.Delete <Test, int>(ids);
                }
            });
        }