public async Task CreateOrEdit(CreateOrEditPermitDto input) { if (input.Id == null) { await Create(input); } else { await Update(input); } }
protected virtual async Task Update(CreateOrEditPermitDto input) { var permit = await _permitRepository.FirstOrDefaultAsync((int)input.Id); ObjectMapper.Map(input, permit); }
protected virtual async Task Create(CreateOrEditPermitDto input) { var permit = ObjectMapper.Map <Permit>(input); await _permitRepository.InsertAsync(permit); }