public virtual async Task <ActionResult> OnPostAsync() { var post = new UpdatePostDto { BlogId = Post.BlogId, Title = Post.Title, Url = Post.Url, CoverImage = Post.CoverImage, Content = Post.Content, Tags = Post.Tags, Description = Post.Description.IsNullOrEmpty() ? Post.Content.Truncate(PostConsts.MaxSeoFriendlyDescriptionLength) : Post.Description }; var editedPost = await _postAppService.UpdateAsync(Post.Id, post); var blog = await _blogAppService.GetAsync(editedPost.BlogId); return(RedirectToPage("/Blogs/Posts/Detail", new { blogShortName = blog.ShortName, postUrl = editedPost.Url })); }
public async Task <BlogDto> GetAsync(Guid id) { return(await _blogAppService.GetAsync(id)); }