Exemplo n.º 1
0
        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"));
        }
Exemplo n.º 2
0
        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"));
        }