public async Task <StudentAttendanceResponse> AddStudentAttendance(IEnumerable <StudentAttendance> studentAttendances) { try { await _lectureRepository.AddStudentAttendance(studentAttendances); await _unitOfWork.CompleteAsync(); return(new StudentAttendanceResponse(studentAttendances)); } catch (Exception ex) { return(new StudentAttendanceResponse($"An error occurred when saving the student attendances: {ex.Message}")); } }