public async Task<IActionResult> OnGetAsync(int? id) { if (id.HasValue) { ServiceReferencePostComment.PostDTO itemPost = await pcc.GetPostByIdAsync(id.Value); ViewData["id"] = id.Value.ToString() + " : " + itemPost.Description; CommentDTO.PostPostId = id.Value; } return Page(); }
public async Task <IActionResult> OnPostAsync() { if (!ModelState.IsValid) { return(Page()); } ServiceReferencePostComment.PostDTO post = new ServiceReferencePostComment.PostDTO(); post.Domain = PostDTO.Domain; post.Description = PostDTO.Description; post.Date = PostDTO.Date; var result = await pcc.SubmitPostAsync(post); if (result is null) { return(RedirectToAction("Error")); } return(RedirectToPage("./Index")); }
public System.Threading.Tasks.Task <ServiceReferencePostComment.PostDTO> UpdatePostAsync(ServiceReferencePostComment.PostDTO newPost) { return(base.Channel.UpdatePostAsync(newPost)); }
public System.Threading.Tasks.Task <ServiceReferencePostComment.PostDTO> SubmitPostAsync(ServiceReferencePostComment.PostDTO post) { return(base.Channel.SubmitPostAsync(post)); }