예제 #1
0
        static double ReadSubjects()
        {
            var subject = new Subject
            {
                Name = "Газодинамика"
            };
            var startTime  = DateTime.Now;
            var subjects   = SubjectLogic.Read(subject);
            var finishTime = DateTime.Now;

            foreach (var s in subjects)
            {
                Console.WriteLine(s.Name + " " + s.Hours);
            }
            Console.WriteLine("---Скрипт ReadSubjects выполнен");
            return((finishTime - startTime).TotalMilliseconds);
        }
예제 #2
0
        static double UpdateSubject()
        {
            var subjectToUpd = SubjectLogic
                               .Read(new Subject {
                Name = "Газодинамика"
            })
                               .FirstOrDefault();
            var newSubject = new Subject
            {
                Id    = subjectToUpd.Id,
                Name  = subjectToUpd.Name,
                Hours = 130
            };
            var startTime = DateTime.Now;

            SubjectLogic.Update(newSubject);
            var finishTime = DateTime.Now;

            Console.WriteLine("---Скрипт UpdateSubject выполнен");
            return((finishTime - startTime).TotalMilliseconds);
        }