Пример #1
0
        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());
        }
Пример #2
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());
        }
 public Task <PostWithDetailDto> GetAsync(Guid id)
 {
     return(_postAppService.GetAsync(id));
 }
 public async Task <Post> Get(int id)
 {
     return(await _postAppService.GetAsync(id));
 }
Пример #5
0
 public async void OnGet()
 {
     Post = await _postAppService.GetAsync(new Guid(PostId));
 }