private async Task UpdateAsync(ItemBarCodeDto input) { if (input.Id != null) { var itemBarCode = await _itemBarCodeRepository.FirstOrDefaultAsync((int)input.Id); ObjectMapper.Map(input, itemBarCode); } }
public async Task CreateOrUpdateItemBarCode(ItemBarCodeDto input) { if (input.Id == null) { await CreateAsync(input); } else { await UpdateAsync(input); } }
public async Task SaveItemBarCode(ItemBarCodeDto input) { if (input.Id.HasValue) { var item = await _itemBarCodeRepository.FirstOrDefaultAsync((int)input.Id); ObjectMapper.Map(input, item); } else { var itemBarCode = ObjectMapper.Map <ItemBarCode>(input); await _itemBarCodeRepository.InsertAsync(itemBarCode); } }
private async Task CreateAsync(ItemBarCodeDto input) { var itemBarCode = ObjectMapper.Map <ItemBarCode>(input); await _itemBarCodeRepository.InsertAsync(itemBarCode); }