public async Task <IActionResult> OnGetAsync(int?id) { if (id.HasValue) { var itemPost = await pcc.GetPostByIdAsync(id.Value); ViewData["id"] = id.Value.ToString() + " : " + itemPost.Description; CommentDTO.PostPostId = id.Value; } return(Page()); }
public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } var post = await pcc.GetPostByIdAsync(id.Value); if (post != null) { PostDTO = PostCommentDTO.GetPostDTO(post); return(Page()); } return(NotFound()); }
public async Task OnGetAsync(Guid? id) { if (!id.HasValue) return; var item = await pcc.GetPostByIdAsync(id.Value); ViewData["Post"] = item.PostId.ToString() + " : " + item.Description.Trim(); foreach (var cc in item.Comments) { var cdto = new CommentDTO(); cdto.PostPostId = cc.PostPostId.ToString(); cdto.Text = cc.Text; cdto.CommentId = cc.CommentId.ToString(); Comments.Add(cdto); } }
public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } post = await pcc.GetPostByIdAsync(id.Value); post.PostId = id.Value; currentId = id.Value; if (post == null) { return(NotFound()); } return(Page()); }
public async Task OnGetAsync(int?id) { if (!id.HasValue) { return; } var item = await pcc.GetPostByIdAsync(id.Value); ViewData["Post"] = item.Id.ToString() + " : " + item.Description.Trim(); foreach (var cc in item.Comment) { Comment cdto = new Comment(); cdto.PostId = cc.PostId; cdto.Text = cc.Text; cdto.Id = cc.Id; Comments.Add(cdto); } }
public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } var post = await pcc.GetPostByIdAsync(id.Value); if (post != null) { PostDTO = new PostDTO(); PostDTO.PostId = post.PostId; PostDTO.Domain = post.Domain; PostDTO.Description = post.Description; return(Page()); } else { return(NotFound()); } }