public async Task <ActionResult <Contact> > DeleteContactAsync(int id)
        {
            var contact = await _contactRepository.Get(id);

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

            var deleteReturn = _contactRepository.Delete(contact);

            if (deleteReturn != null)
            {
                return(CreatedAtAction("GetContact", new { id = contact.Id }, contact));
            }

            return(BadRequest());
        }
示例#2
0
        public async Task <ActionResult <Expertise> > DeleteExpertiseAsync(int id)
        {
            var expertise = await _expertiseRepository.Get(id);

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

            var deleteReturn = _expertiseRepository.Delete(expertise);

            if (deleteReturn != null)
            {
                return(CreatedAtAction("GetExpertise", new { id = expertise.Id }, expertise));
            }

            return(BadRequest());
        }
        public async Task <ActionResult <City> > DeleteCityAsync(int id)
        {
            var city = await _cityRepository.Get(id);

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

            var deleteReturn = _cityRepository.Delete(city);

            if (deleteReturn != null)
            {
                return(CreatedAtAction("GetCity", new { id = city.Id }, city));
            }

            return(BadRequest());
        }
        public async Task <ActionResult <Document> > DeleteDocumentAsync(int id)
        {
            var document = await _documentRepository.Get(id);

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

            var deleteReturn = _documentRepository.Delete(document);

            if (deleteReturn != null)
            {
                return(CreatedAtAction("GetDocument", new { id = document.Id }, document));
            }

            return(BadRequest());
        }
        public async Task <ActionResult <Schedule> > DeleteScheduleAsync(int id)
        {
            var schedule = await _scheduleRepository.Get(id);

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

            var deleteReturn = _scheduleRepository.Delete(schedule);

            if (deleteReturn != null)
            {
                return(CreatedAtAction("GetSchedule", new { id = schedule.Id }, schedule));
            }

            return(BadRequest());
        }
        public async Task <ActionResult <Role> > DeleteRoleAsync(int id)
        {
            var role = await _roleRepository.Get(id);

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

            var deleteReturn = _roleRepository.Delete(role);

            if (deleteReturn != null)
            {
                return(CreatedAtAction("GetRole", new { id = role.Id }, role));
            }

            return(BadRequest());
        }
        public async Task <ActionResult <Adress> > DeleteAdressAsync(int id)
        {
            var adress = await _adressRepository.Get(id);

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

            var deleteReturn = _adressRepository.Delete(adress);

            if (deleteReturn != null)
            {
                return(CreatedAtAction("GetAdress", new { id = adress.Id }, adress));
            }

            return(BadRequest());
        }
示例#8
0
        public async Task <ActionResult <DocsecRel> > DeleteDocsecRelAsync(int id)
        {
            var ocsecRel = await _ocsecRelRepository.Get(id);

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

            var deleteReturn = _ocsecRelRepository.Delete(ocsecRel);

            if (deleteReturn != null)
            {
                return(CreatedAtAction("GetDocsecRel", new { id = ocsecRel.Id }, ocsecRel));
            }

            return(BadRequest());
        }