private async Task Create(CreateOrEditProductCategoryDto input) { var productCategory = ObjectMapper.Map <ProductCategory>(input); await _productCategoryRepository.InsertAsync(productCategory); }
public async Task CreateOrEdit(CreateOrEditProductCategoryDto input) { if (input.Id == null) { await Create(input); } else { await Update(input); } }
protected virtual async Task Create(CreateOrEditProductCategoryDto input) { var productCategory = ObjectMapper.Map <ProductCategory>(input); if (AbpSession.TenantId != null) { productCategory.TenantId = (int?)AbpSession.TenantId; } await _productCategoryRepository.InsertAsync(productCategory); }
protected virtual async Task Update(CreateOrEditProductCategoryDto input) { var productCategory = await _productCategoryRepository.FirstOrDefaultAsync((int)input.Id); ObjectMapper.Map(input, productCategory); }