示例#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
文件: Edit.cshtml.cs 项目: ZhaoRd/abp
 public async void OnGet()
 {
     Post = await _postAppService.GetAsync(new Guid(PostId));
 }