public async Task AddStudent(string courseName, Student student) { using (_logger.BeginScope("{CourseName}, {StudentId}", courseName, student.Id)) { ThrowBadRequestIfStudentInvalid(student); var stopWatch = Stopwatch.StartNew(); await _studentStore.AddStudent(courseName, student); _telemetryClient.TrackMetric("StudentStore.AddStudent.Time", stopWatch.ElapsedMilliseconds); _telemetryClient.TrackEvent("StudentAdded"); } }