public async Task AddSlotRange(SlotsCreateContract slotContract, CancellationToken cancellationToken)
        {
            var slot = SlotsMapping.SlotMapFromContractToModel(slotContract);

            if (slot.StartTime > slot.Duration)
            {
                _logger.LogInformation($"Slot with id {slot.Id} has duration more than start time");
                throw new ArgumentException();
            }

            var timeEnd = slot.Duration;


            if (_dbContext.Slots.Where(x => x.Date == slot.Date)
                .Where(x => x.StartTime <= slot.Duration).Where(x => x.CoachId == slot.CoachId).Any(x => x.StartTime >= slot.StartTime))
            {
                _logger.LogInformation($"Slots are already created in time range" +
                                       $" {slot.Date.Add(slot.StartTime)} - {slot.Date.Add(slot.Duration)}," +
                                       $" for coach with id {slot.CoachId}");

                throw new ArgumentException("Some slots created in this time range, for this coach");
            }

            var slots = new List <Slot>();

            while (slot.StartTime <= timeEnd)
            {
                var resultSlot = new Slot
                {
                    CoachId   = slot.CoachId,
                    Duration  = TimeSpan.FromHours(1),
                    Date      = slot.Date,
                    StartTime = slot.StartTime,
                };
                slots.Add(resultSlot);
                slot.StartTime += resultSlot.Duration;
            }

            try
            {
                await _dbContext.AddRangeAsync(slots, cancellationToken);

                await _dbContext.SaveChangesAsync(cancellationToken);
            }
            catch
            {
                _logger.LogInformation($"Slots are not added in time range" +
                                       $" {slot.Date.Add(slot.StartTime)} - {slot.Date.Add(slot.Duration)}," +
                                       $" for coach with id {slot.CoachId}");
                throw new ArgumentException();
            }
        }
        /// <summary>
        /// update coach
        /// </summary>
        /// <param name="slotContract"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        public async Task <bool> UpdateSlot(SlotsReturnContract slotContract, CancellationToken cancellationToken)
        {
            var slot = SlotsMapping.SlotMapFromContractToModel(slotContract);

            var updateSlot = await _dbContext.Slots.FirstOrDefaultAsync(x => x.Id == slotContract.Id, cancellationToken);

            if (updateSlot == null)
            {
                _logger.LogInformation($"No slot with {slot.Id} Id");
                return(false);
            }
            try
            {
                _dbContext.Update(slot);
                await _dbContext.SaveChangesAsync(cancellationToken);
            }
            catch
            {
                _logger.LogInformation($"Slot with id {slot.Id} is not updated");
                return(false);
            }
            return(true);
        }