public IActionResult DeleteJson(int?id) { if (id == null) { return(NotFound()); } var company = _jobctx.Jobs.FirstOrDefault(c => c.JobId == id); if (company == null) { return(NotFound()); } else { _jobctx.Remove(company); _jobctx.SaveChanges(); } return(Ok("Deleted")); }
public IActionResult Delete(int?id) { if (id == null) { return(NotFound()); } var company = _compctx.Companies.FirstOrDefault(c => c.CompanyId == id); if (company == null) { return(NotFound()); } else { _compctx.Remove(company); _compctx.SaveChanges(); } return(Ok("Deleted")); }