public async Task <ActionResult> OnGetAsync() { if (!await _authorization.IsGrantedAsync(BloggingPermissions.Posts.Update)) { return(Redirect("/")); } var postDto = await _postAppService.GetAsync(new Guid(PostId)); Post = ObjectMapper.Map <PostWithDetailsDto, EditPostViewModel>(postDto); Post.Tags = String.Join(", ", postDto.Tags.Select(p => p.Name).ToArray()); return(Page()); }
public async void OnGet() { var postDto = await _postAppService.GetForEditAsync(new Guid(PostId)); Post = ObjectMapper.Map<GetPostForEditOutput, EditPostViewModel>(postDto); }