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); }
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); }