예제 #1
0
        public virtual async Task <PageDto> UpdateAsync(Guid id, UpdatePageInputDto input)
        {
            var page = await PageRepository.GetAsync(id);

            await PageManager.SetSlugAsync(page, input.Slug);

            page.SetTitle(input.Title);
            page.SetContent(input.Content);

            await PageRepository.UpdateAsync(page);

            return(ObjectMapper.Map <Page, PageDto>(page));
        }
예제 #2
0
        public virtual async Task <PageDto> UpdateAsync(Guid id, UpdatePageInputDto input)
        {
            var page = await PageRepository.GetAsync(id);

            if (page.Slug != input.Slug)
            {
                await CheckPageSlugAsync(input.Slug);
            }

            page.SetTitle(input.Title);
            page.SetSlug(input.Slug);

            await PageRepository.UpdateAsync(page);

            return(ObjectMapper.Map <Page, PageDto>(page));
        }
예제 #3
0
        public virtual async Task <PageDto> UpdatePageAsync(Guid id, UpdatePageInputDto input)
        {
            var page = await PageRepository.GetAsync(id);

            if (page.Url != input.Url)
            {
                await CheckPageUrlAsync(input.Url);
            }

            page.Title       = input.Title;
            page.Url         = input.Url;
            page.Description = input.Description;

            await PageRepository.UpdateAsync(page);

            return(ObjectMapper.Map <Page, PageDto>(page));
        }
예제 #4
0
 public virtual Task <PageDto> UpdateAsync(Guid id, UpdatePageInputDto input)
 {
     return(PageAdminAppService.UpdateAsync(id, input));
 }