示例#1
0
        public virtual async Task <BlogPostDto> CreateAsync(CreateBlogPostDto input)
        {
            var author = await UserLookupService.GetByIdAsync(CurrentUser.GetId());

            var blog = await BlogRepository.GetAsync(input.BlogId);

            var blogPost = await BlogPostManager.CreateAsync(
                author,
                blog,
                input.Title,
                input.Slug,
                input.ShortDescription,
                CurrentTenant.Id);

            await BlogPostRepository.InsertAsync(blogPost);

            return(ObjectMapper.Map <BlogPost, BlogPostDto>(blogPost));
        }
示例#2
0
 public virtual Task<BlogPostDto> CreateAsync(CreateBlogPostDto input)
 {
     return BlogPostAdminAppService.CreateAsync(input);
 }