public static void delete(int id) { using (publishEntities context = new publishEntities()) { publish obj = context.publishes.First(x => x.Id == id); context.publishes.Remove(obj); context.SaveChanges(); } }
public static void EditUpdate(int id, String place, String date1, String publisher) { using (publishEntities context = new publishEntities()) { publish obj = context.publishes.First(x => x.Id == id); obj.publication_place = place; obj.publication_date = date1; obj.publisher = publisher; context.SaveChanges(); } }