public IActionResult Delete(int id)
        {
            Agency abs = _AgencyRepository.GetAgencyById(id);

            if (abs == null)
            {
                return(NotFound());
            }
            _AgencyRepository.DeleteAgency(abs);
            return(RedirectToAction("index"));
        }
Ejemplo n.º 2
0
        public string DeleteAgency(int agencyid)
        {
            int deleteagency = Task.Run <int>(async() => await AgencyRepository.DeleteAgency(agencyid)).Result;

            return(deleteagency > 0 ? "Successfully Deleted agency record" : "Deletion failed");
        }