public async Task AddDivingTime(DivingTime time) { var allDiverHours = await _divingTimeRepository.GetListAsync(time.DiverId); var times = new List <DivingTime>(); if (allDiverHours != null && allDiverHours.Any()) { times.AddRange(allDiverHours.Select(t => _mapper.Map <DivingTime>(t))); } times.Add(time); await SetWorkingHours(time.DiverId, times); }
public async Task <IActionResult> AddDivingTime(DivingTime time) { await _diverService.AddDivingTime(time); return(Ok()); }