Пример #1
0
        public async Task <bool> GetSingleColumnSlowAsync(Stopwatch watch, int repeatCount, int takeCount)
        {
            watch.Start();

            for (var i = 0; i < repeatCount; i++)
            {
                using (var db = new L2DBContext(TrackChanges))
                    await db.ExecuteAsync <int>(GetSingleColumnSql);
            }

            watch.Stop();

            return(true);
        }
Пример #2
0
        public async Task <bool> GetSingleColumnParamAsync(Stopwatch watch, int repeatCount, int takeCount)
        {
            watch.Start();

            using (var db = new L2DBContext(TrackChanges))
                for (var i = 0; i < repeatCount; i++)
                {
                    await db.ExecuteAsync <int>(GetParamSql,
                                                new DataParameter("@id", 1),
                                                new DataParameter("@p", 2));
                }

            watch.Stop();

            return(true);
        }