예제 #1
0
        public async Task <IActionResult> Delete(int id)
        {
            try
            {
                await _modelsRepository.Delete(id);

                return(NoContent());
            }
            catch (InvalidModelException)
            {
                return(NotFound());
            }
        }
예제 #2
0
        public async Task <IActionResult> Delete(int id)
        {
            SahibindenBitirmeProjesi.Entity.Entities.Concrete.Models model = await _modelsRepository.GetById(id);

            if (model != null)
            {
                await _modelsRepository.Delete(model);

                TempData["Success"] = "Model başarıyla silindi..!";
                return(RedirectToAction("List"));
            }
            else
            {
                TempData["Error"] = "Model silindi..!";
                return(RedirectToAction("List"));
            }
        }