private async Task UpdateAsync(ManuFactoryDto input) { if (input.Id != null) { var manuFactory = await _manuFactoryRepository.FirstOrDefaultAsync((int)input.Id); ObjectMapper.Map(input, manuFactory); } }
public async Task CreateOrUpdateManuFactory(ManuFactoryDto input) { if (input.Id == null) { await CreateAsync(input); } else { await UpdateAsync(input); } }
private async Task CreateAsync(ManuFactoryDto input) { var manuFactory = ObjectMapper.Map <ManuFactory>(input); await _manuFactoryRepository.InsertAsync(manuFactory); }