コード例 #1
0
 /// <summary>
 /// 新增或更改分类
 /// </summary>
 public async Task CreateOrUpdateCategoryAsync(CreateOrUpdateCategoryInput input)
 {
     if (input.CategoryEditDto.Id.HasValue)
     {
         await UpdateCategoryAsync(input.CategoryEditDto);
     }
     else
     {
         await CreateCategoryAsync(input.CategoryEditDto);
     }
 }
コード例 #2
0
 public async Task CreateOrUpdate(CreateOrUpdateCategoryInput input)
 {
     if (input.Category.Id.HasValue)
     {
         await Update(input.Category);
     }
     else
     {
         await Create(input.Category);
     }
 }
コード例 #3
0
        public async Task CreateOrUpdateCategory(CreateOrUpdateCategoryInput input)
        {
            if (input.Id.HasValue && input.Id.Value > 0)
            {
                await UpdateCategoryAsync(input);
            }
            else
            {
                await CreateCategoryAsync(input);
            }

            await CurrentUnitOfWork.SaveChangesAsync();
        }
コード例 #4
0
 protected virtual async Task UpdateCategoryAsync(CreateOrUpdateCategoryInput input)
 {
     var catalogy = ObjectMapper.Map <Category>(input);
     await _catalogyManager.UpdateAsync(catalogy);
 }