Beispiel #1
0
        public ActionResult Delete(Guid id)
        {
            var deletedGPU = Service.GetGPUByID(id);

            Service.DeleteGPU(id);
            if (deletedGPU != null)
            {
                TempData["message"] = string.Format("{0} was deleted", deletedGPU.Name);
            }
            return(RedirectToAction("Index"));
        }
Beispiel #2
0
        //[ValidateAntiForgeryToken]
        public IActionResult Delete(int id)
        {
            try
            {
                var gpu = _gpuService.GetGPU(id);
                if (gpu == null)
                {
                    return(NotFound());
                }

                var result = _gpuService.DeleteGPU(id);
                return(Json(result));
            }
            catch
            {
                return(View());
            }
        }