예제 #1
0
 private static void persistStudents(IEnumerable<StudentPackage> students, 
     IStudentDownloadRepository downloadRepo, IStudentErrorRepository errorRepo)
 {
     try
     {
         students.ForEach(s => saveStudent(s, downloadRepo, errorRepo));
     }
     catch (Exception ex)
     {
         Console.WriteLine("Error! " + ex.Message);
     }
 }
예제 #2
0
        private static void saveStudent(StudentPackage stPkg, IStudentDownloadRepository repo,
                                        IStudentErrorRepository errorRepo)
        {
            try
            {
                repo.Save(stPkg);
            }

            catch (Exception  ex)
                    {
                        errorRepo.Save(stPkg, ex);
                    }
        }