/// <summary> /// 新增或更改分类 /// </summary> public async Task CreateOrUpdateCategoryAsync(CreateOrUpdateCategoryInput input) { if (input.CategoryEditDto.Id.HasValue) { await UpdateCategoryAsync(input.CategoryEditDto); } else { await CreateCategoryAsync(input.CategoryEditDto); } }
public async Task CreateOrUpdate(CreateOrUpdateCategoryInput input) { if (input.Category.Id.HasValue) { await Update(input.Category); } else { await Create(input.Category); } }
public async Task CreateOrUpdateCategory(CreateOrUpdateCategoryInput input) { if (input.Id.HasValue && input.Id.Value > 0) { await UpdateCategoryAsync(input); } else { await CreateCategoryAsync(input); } await CurrentUnitOfWork.SaveChangesAsync(); }
protected virtual async Task UpdateCategoryAsync(CreateOrUpdateCategoryInput input) { var catalogy = ObjectMapper.Map <Category>(input); await _catalogyManager.UpdateAsync(catalogy); }