Changeset 4434
- Timestamp:
- 09/19/10 05:25:41 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Services.OKB/3.3/AdminService.cs
r4426 r4434 59 59 public void DeleteAlgorithmClass(long algorithmClassId) { 60 60 using (OKBDataContext okb = new OKBDataContext()) { 61 okb.AlgorithmClasses.DeleteOnSubmit(okb.AlgorithmClasses.First(a => a.Id == algorithmClassId)); 62 okb.SubmitChanges(); 61 AlgorithmClass algorithmClass = okb.AlgorithmClasses.FirstOrDefault(a => a.Id == algorithmClassId); 62 if (algorithmClass != null) { 63 okb.AlgorithmClasses.DeleteOnSubmit(algorithmClass); 64 okb.SubmitChanges(); 65 } 63 66 } 64 67 } … … 91 94 public void DeleteAlgorithm(long algorithmId) { 92 95 using (OKBDataContext okb = new OKBDataContext()) { 93 okb.Algorithms.DeleteOnSubmit(okb.Algorithms.First(a => a.Id == algorithmId)); 94 okb.SubmitChanges(); 96 Algorithm algorithm = okb.Algorithms.FirstOrDefault(a => a.Id == algorithmId); 97 if (algorithm != null) { 98 okb.Algorithms.DeleteOnSubmit(algorithm); 99 okb.SubmitChanges(); 100 } 95 101 } 96 102 }
Note: See TracChangeset
for help on using the changeset viewer.