Beispiel #1
0
        static void Main()
        {
            var context = new AdsEntities();

            //long time = TestSlowSelect(context);
            //Console.WriteLine(time);

            long time = TestSlowSelect(context);

            Console.WriteLine(time);

            Console.ReadLine();
        }
Beispiel #2
0
        public static long TestSlowSelect(AdsEntities context)
        {
            context.Database.SqlQuery <string>("CHECKPOINT");
            context.Database.SqlQuery <string>("DBCC DROPCLEANBUFFERS");
            var stopWatch = new Stopwatch();

            stopWatch.Start();
            var ads = context.Ads;

            foreach (var ad in ads)
            {
                Console.WriteLine(ad.Title);
            }

            long time = stopWatch.ElapsedMilliseconds;

            return(time);
        }