//Silme fonksiyonu public void Delete(GeneralBooks generalBooks) { using (InstituteDbEntities context = new InstituteDbEntities()) { var entity = context.Entry(generalBooks); entity.State = EntityState.Deleted; context.SaveChanges(); } }
//Ekleme fonksiyonu public void Add(GeneralBooks generalBooks) { using (InstituteDbEntities context = new InstituteDbEntities()) { var entity = context.Entry(generalBooks); entity.State = EntityState.Added; context.SaveChanges(); //context.GeneralBooks.Add(generalBooks); //context.SaveChanges(); } }