public IActionResult Get(int id) { try { bool IsEdit = false; var UserID = HttpContext.Items["UserID"]; bool blogIsNull = _blogService.BlogIsNull(id); if (blogIsNull) { return(Json(new { status = 404, blog = "", message = "Blog empty" })); } IsEdit = _blogService.IsEditBlogWithUserIDBlogID(UserID, id); var blog = _blogService.GetDetailBlogWithID(id, IsEdit); return(Json(new { status = 200, blog, message = "Get Blog" })); } catch (Exception e) { return(Json(new { status = 500, blog = "", message = "Server Interval " + e })); } }
public bool IsEditBlogWithUserIDBlogID(object userID, int blogID) { return(_blogservice.IsEditBlogWithUserIDBlogID(userID, blogID)); }