public static void UpdateItemsSubject(ItemsSubject itemsSubject) { using (RatzhKatzviEntities1 db = new RatzhKatzviEntities1()) { // db.Entry(itemsSubject).State = itemsSubject.Modified; db.SaveChanges(); } }
//Delete public static void DeleteById(ItemsSubject it) { if (it != null) { using (RatzhKatzviEntities1 db = new RatzhKatzviEntities1()) { db.Entry(it).State = EntityState.Deleted; //db.ItemsSubject.Remove(it); db.SaveChanges(); } } }