public async Task <ApiRequestResult> AddAsync(ProductAttributeCategoryDto dto) { var command = dto.EntityMap <ProductAttributeCategoryDto, ProductAttributeCategory>(); await _productAttributeCategoryRepository.AddAsync(command); return(ApiRequestResult.Success("添加成功")); }
public async Task <ApiRequestResult> UpdateAsync(ProductAttributeCategoryDto dto) { var entity = await _productAttributeCategoryRepository.GetAsync(dto.Id.Value); var newEntity = dto.EntityMap(entity); await _productAttributeCategoryRepository.UpdateAsync(newEntity); return(ApiRequestResult.Success("修改成功")); }