Пример #1
0
        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());
        }
Пример #2
0
 public async void OnGet()
 {
     var postDto = await _postAppService.GetForEditAsync(new Guid(PostId));
     Post = ObjectMapper.Map<GetPostForEditOutput, EditPostViewModel>(postDto);
 }