public async Task CreateOrEdit(CreateOrEditVendorCategoryDto input) { if (input.Id == null) { await Create(input); } else { await Update(input); } }
protected virtual async Task Create(CreateOrEditVendorCategoryDto input) { var vendorCategory = ObjectMapper.Map <VendorCategory>(input); await _vendorCategoryRepository.InsertAsync(vendorCategory); }
protected virtual async Task Update(CreateOrEditVendorCategoryDto input) { var vendorCategory = await _vendorCategoryRepository.FirstOrDefaultAsync((int)input.Id); ObjectMapper.Map(input, vendorCategory); }