public async Task CreateOrEdit(CreateOrEditIncidentTypeDto input) { if (input.Id == null) { await Create(input); } else { await Update(input); } }
protected virtual async Task Create(CreateOrEditIncidentTypeDto input) { var incidentType = ObjectMapper.Map <IncidentType>(input); if (AbpSession.TenantId != null) { incidentType.TenantId = (int?)AbpSession.TenantId; } await _incidentTypeRepository.InsertAsync(incidentType); }
protected virtual async Task Update(CreateOrEditIncidentTypeDto input) { var incidentType = await _incidentTypeRepository.FirstOrDefaultAsync((int)input.Id); ObjectMapper.Map(input, incidentType); }