public bool Delete(int id) { try { _dbContext.Entry(new Location { id = id }).State = EntityState.Deleted;; _dbContext.SaveChanges(); } catch (System.Exception) { return(false); } return(true); }
public bool Delete(int id) { try { _studentDbContext.Entry(new Student { StudentId = id }).State = EntityState.Deleted;; _studentDbContext.SaveChanges(); } catch (System.Exception) { return(false); } return(true); }