private async Task Create(CreateOrEditProductSubCategoryDto input) { var productSubCategory = ObjectMapper.Map <ProductSubCategory>(input); await _productSubCategoryRepository.InsertAsync(productSubCategory); }
public async Task CreateOrEdit(CreateOrEditProductSubCategoryDto input) { if (input.Id == null) { await Create(input); } else { await Update(input); } }
private async Task Update(CreateOrEditProductSubCategoryDto input) { var productSubCategory = await _productSubCategoryRepository.FirstOrDefaultAsync((int)input.Id); ObjectMapper.Map(input, productSubCategory); }