public static int VerwijderenCursus(Cursus cursus) { try { using (UdemyEntities udemyEntities = new UdemyEntities()) { udemyEntities.Entry(cursus).State = EntityState.Deleted; return(udemyEntities.SaveChanges()); } } catch (Exception ex) { FileOperations.Foutloggen(ex); return(0); } }
public static int ToevoegenCursus(Cursus cursus) { try { using (UdemyEntities udemyEntities = new UdemyEntities()) { udemyEntities.Cursus.Add(cursus); return(udemyEntities.SaveChanges()); } } catch (Exception ex) { FileOperations.Foutloggen(ex); return(0); } }