protected virtual async Task Create(CreateOrEditWarningTypeDto input) { var warningType = ObjectMapper.Map <WarningType>(input); await _warningTypeRepository.InsertAsync(warningType); }
public async Task CreateOrEdit(CreateOrEditWarningTypeDto input) { if (input.Id == null) { await Create(input); } else { await Update(input); } }
protected virtual async Task Update(CreateOrEditWarningTypeDto input) { var warningType = await _warningTypeRepository.FirstOrDefaultAsync((int)input.Id); ObjectMapper.Map(input, warningType); }