public void Delete() { int postId = CECRequest.GetQueryInt("id", 0); int userId = PlantEngContext.Current.UserId; BlogPostService.Delete(postId, userId); Response.Redirect("/accounts/blog/", true); }
public IActionResult Delete(BlogPostMD metaData) { var result = _service.Delete(metaData); if (!result.Status) { result.Data.ReferenceTypeOptions = _service.GetOptions(); ViewBag.ErrorMessage = result.Message; ViewBag.BlogId = metaData.BlogId; return(View(metaData)); } return(RedirectToAction("Index", "BlogPost", new { blogId = metaData.BlogId })); }