コード例 #1
0
        public override async Task <ScheduleDto> Update(UpdateScheduleInput input)
        {
            var currentChannel = await GetEntityByIdAsync(input.Id);

            if (!currentChannel.DoesNotChangeByInput(
                    input.UploadIntervalOption, input.IntervalValue, input.OnExactDayTime) &&
                currentChannel.Enable)
            {
                MapToEntity(input, currentChannel);
                _channelUploadScheduler.AddOrUpdate(currentChannel);
            }
            return(await base.Update(input));
        }
コード例 #2
0
        public async Task Enable(EnableChannelInput input)
        {
            CheckUpdatePermission();

            var channel = await GetEntityByIdAsync(input.Id);

            channel.Enable = input.Enable;

            if (channel.Enable)
            {
                _channelUploadScheduler.AddOrUpdate(channel);
            }
            else
            {
                _channelUploadScheduler.Disable(channel);
            }

            await CurrentUnitOfWork.SaveChangesAsync();
        }