public virtual async Task <LayoutDto> UpdateAsync(Guid id, LayoutUpdateDto input)
        {
            var layout = await LayoutRepository.GetAsync(id);

            if (!string.Equals(layout.Name, input.Name, StringComparison.InvariantCultureIgnoreCase))
            {
                layout.Name = input.Name;
            }
            if (!string.Equals(layout.DisplayName, input.DisplayName, StringComparison.InvariantCultureIgnoreCase))
            {
                layout.DisplayName = input.DisplayName;
            }
            if (!string.Equals(layout.Description, input.Description, StringComparison.InvariantCultureIgnoreCase))
            {
                layout.Description = input.Description;
            }
            if (!string.Equals(layout.Path, input.Path, StringComparison.InvariantCultureIgnoreCase))
            {
                layout.Path = input.Path;
            }
            if (!string.Equals(layout.Redirect, input.Redirect, StringComparison.InvariantCultureIgnoreCase))
            {
                layout.Redirect = input.Redirect;
            }
            layout = await LayoutRepository.UpdateAsync(layout);

            await CurrentUnitOfWork.SaveChangesAsync();

            return(ObjectMapper.Map <Layout, LayoutDto>(layout));
        }
예제 #2
0
 public virtual async Task <LayoutDto> UpdateAsync(Guid id, LayoutUpdateDto input)
 {
     return(await LayoutAppService.UpdateAsync(id, input));
 }