Exemple #1
0
        public CompanyDTO RemoveCompany(int id)
        {
            CompanyDTO deletedCompany = GetCompany(id);

            if (deletedCompany != null)
            {
                companiesRepository.Remove(id);
            }
            return(deletedCompany);
        }
        public IActionResult Delete(int id)
        {
            var companyDetails = _companiesRepository.Get(id);

            if (companyDetails == null)
            {
                return(NotFound());
            }

            _companiesRepository.Remove(companyDetails);
            _companiesRepository.SaveChanges();

            return(NoContent());
        }