コード例 #1
0
        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);
        }
コード例 #2
0
        public async Task <IActionResult> AddDivingTime(DivingTime time)
        {
            await _diverService.AddDivingTime(time);

            return(Ok());
        }