Exemplo n.º 1
0
        public async Task <ReportChannelDto> AddOrUpdateAsync(ReportChannelDto channelDto)
        {
            var id = channelDto.ChannelId;

            if (string.IsNullOrEmpty(id))
            {
                id = await _channelManager.AddChannelAsync(channelDto.Type, channelDto.ChatId, channelDto.Interval, channelDto.Metainfo);
            }
            else
            {
                await _channelManager.UpdateChannelAsync(id, channelDto.Type, channelDto.ChatId, channelDto.Interval, channelDto.Metainfo);
            }
            return(new ReportChannelDto(id, channelDto.Type, channelDto.ChatId, channelDto.Interval, channelDto.Metainfo));
        }