コード例 #1
0
        public IActionResult Delete(int id)
        {
            var temp = carData.Delete(id);

            if (temp == null)
            {
                return(BadRequest());
            }
            carData.Commit();
            return(NoContent());
        }
コード例 #2
0
        public IActionResult OnPost(int carId)
        {
            var temp = carData.Delete(carId);

            if (temp == null)
            {
                return(RedirectToPage("./NotFound"));
            }

            carData.Commit();
            TempData["TempMessage"] = "The car was deleted.";
            return(RedirectToPage("./CarModels"));
        }
コード例 #3
0
        public async Task <ActionResult> Delete(int id, FormCollection form)
        {
            await db.Delete(id);

            return(RedirectToAction("Index"));
        }