public JsonResult DeleteSlider(int id) { Slider firstslider = sliderRepo.SelectById(id); if (firstslider == null) { return(Json(new { success = false, responseText = "Slider silinemedi!" }, JsonRequestBehavior.AllowGet)); } sliderRepo.Delete(firstslider); return(Json(new { success = true, responseText = "Slider Silme işlemi gerçekleşmiştir." }, JsonRequestBehavior.AllowGet)); }
public IHttpActionResult Delete(int id) { var user = SliderRepo.Get(id); if (user == null) { return(StatusCode(HttpStatusCode.NoContent)); } SliderRepo.Delete(id); return(StatusCode(HttpStatusCode.NoContent)); }