public static bool Delete(Genres genre) { using (FotografPaketiEntities db = new FotografPaketiEntities()) { try { db.Entry(genre).State = System.Data.Entity.EntityState.Deleted; db.SaveChanges(); return true; } catch (Exception ex) { return false; throw; } } }
public static bool Insert(Genres genre) { using (FotografPaketiEntities db = new FotografPaketiEntities()) { try { genre.DeleteStatus = false; db.Genres.Add(genre); db.SaveChanges(); return true; } catch (Exception ex) { return false; throw; } } }