상속: Repository, ILawRepository
예제 #1
0
        public void LawRepository_LawCommentCount()
        {
            var rep = new LawRepository();

            foreach (var item in Enumerable.Range(1, 10))
            {
                var bar = rep.CommentCount(654);
            }

            var watch = Stopwatch.StartNew();
            var comments = rep.CommentCount(654);
            watch.Stop();
            Trace.Write(string.Format("Elapsed {0} milliseconds", watch.ElapsedMilliseconds));
        }
예제 #2
0
        private void RunTest(Func<LawRepository, IEnumerable<object>> method)
        {
            var rep = new LawRepository();

            foreach (var item in Enumerable.Range(1, 10))
            {
                var bar = method(rep).ToList();
            }

            var laws = method(rep);
            var watch = Stopwatch.StartNew();
            var foo = laws.ToList();
            watch.Stop();
            Trace.Write(string.Format("Elapsed {0} milliseconds", watch.ElapsedMilliseconds));
        }