Exemplo n.º 1
0
 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();
 }
Exemplo n.º 2
0
        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"));
        }
Exemplo n.º 3
0
 public System.Threading.Tasks.Task <ServiceReferencePostComment.PostDTO> UpdatePostAsync(ServiceReferencePostComment.PostDTO newPost)
 {
     return(base.Channel.UpdatePostAsync(newPost));
 }
Exemplo n.º 4
0
 public System.Threading.Tasks.Task <ServiceReferencePostComment.PostDTO> SubmitPostAsync(ServiceReferencePostComment.PostDTO post)
 {
     return(base.Channel.SubmitPostAsync(post));
 }