protected virtual async Task Create(CreateOrEditBeaconDto input) { var beacon = ObjectMapper.Map <Beacon>(input); await _beaconRepository.InsertAsync(beacon); }
public async Task CreateOrEdit(CreateOrEditBeaconDto input) { if (input.Id == null) { await Create(input); } else { await Update(input); } }
protected virtual async Task Update(CreateOrEditBeaconDto input) { var beacon = await _beaconRepository.FirstOrDefaultAsync((int)input.Id); ObjectMapper.Map(input, beacon); }