public async void OnGet() { 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()); }
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 Task <PostWithDetailDto> GetAsync(Guid id) { return(_postAppService.GetAsync(id)); }
public async Task <Post> Get(int id) { return(await _postAppService.GetAsync(id)); }
public async void OnGet() { Post = await _postAppService.GetAsync(new Guid(PostId)); }