protected virtual async Task Create(CreateOrEditShiftDto input) { var shift = ObjectMapper.Map <Shift>(input); await _shiftRepository.InsertAsync(shift); }
public async Task CreateOrEdit(CreateOrEditShiftDto input) { if (input.Id == null) { await Create(input); } else { await Update(input); } }
protected virtual async Task Update(CreateOrEditShiftDto input) { var shift = await _shiftRepository.FirstOrDefaultAsync((int)input.Id); ObjectMapper.Map(input, shift); }