protected virtual async Task Create(CreateOrEditLocationMachineDto input) { var locationMachine = ObjectMapper.Map <LocationMachine>(input); await _locationMachineRepository.InsertAsync(locationMachine); }
public async Task CreateOrEdit(CreateOrEditLocationMachineDto input) { if (input.Id == null) { await Create(input); } else { await Update(input); } }
protected virtual async Task Update(CreateOrEditLocationMachineDto input) { var locationMachine = await _locationMachineRepository.FirstOrDefaultAsync((int)input.Id); ObjectMapper.Map(input, locationMachine); }