public IActionResult DeleteBlog(int id) { if (ModelState.IsValid) { var model = new BlogModel(); try { var delt = model.Delete(id); model.Response = new ResponseModel($"{delt} Deleted successfull", ResponseType.Success); return(RedirectToAction("index")); } catch (Exception ex) { model.Response = new ResponseModel("Insert Failed.", ResponseType.Failure); } } return(RedirectToAction("index")); }
public async Task Delete(int id) { await _model.Delete(id); }