public async Task <ActionResult> DeleteCountry(int id)
        {
            var check = await _countries.Delete(id);

            if (!check)
            {
                return(NotFound());
            }
            return(Ok());
        }
Exemplo n.º 2
0
        public ActionResult DeleteConfirmed(int id)
        {
            var model = mapper.Map <Country, CountryViewModel>(countryLogic.GetById(id));

            try
            {
                if (countryLogic.Delete(id))
                {
                    return(RedirectToAction("Index"));
                }
                return(View(model));
            }
            catch
            {
                return(View(model));
            }
        }