public virtual async Task <BlogPostDto> UpdateAsync(Guid id, UpdateBlogPostDto input) { var blogPost = await BlogPostRepository.GetAsync(id); blogPost.SetTitle(input.Title); blogPost.SetShortDescription(input.ShortDescription); if (blogPost.Slug != input.Slug) { await BlogPostManager.SetSlugUrlAsync(blogPost, input.Slug); } await BlogPostRepository.UpdateAsync(blogPost); return(ObjectMapper.Map <BlogPost, BlogPostDto>(blogPost)); }
public virtual async Task <BlogPostDto> UpdateAsync(Guid id, UpdateBlogPostDto input) { var blogPost = await BlogPostRepository.GetAsync(id); blogPost.SetTitle(input.Title); blogPost.SetShortDescription(input.ShortDescription); blogPost.SetContent(input.Content); blogPost.SetConcurrencyStampIfNotNull(input.ConcurrencyStamp); blogPost.CoverImageMediaId = input.CoverImageMediaId; if (blogPost.Slug != input.Slug) { await BlogPostManager.SetSlugUrlAsync(blogPost, input.Slug); } await BlogPostRepository.UpdateAsync(blogPost); return(ObjectMapper.Map <BlogPost, BlogPostDto>(blogPost)); }
public virtual Task<BlogPostDto> UpdateAsync(Guid id, UpdateBlogPostDto input) { return BlogPostAdminAppService.UpdateAsync(id, input); }