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