Exemple #1
0
        /// <summary>
        /// 添加后台发布节点
        /// </summary>
        public async Task <int> InsertSiteAsync(Channel channel, Site site, int adminId)
        {
            await _channelRepository.InsertChannelAsync(null, channel);

            site.Id = channel.Id;

            await InsertAsync(site);

            var adminEntity = await _administratorRepository.GetByUserIdAsync(adminId);

            await _administratorRepository.UpdateSiteIdAsync(adminEntity, channel.Id);

            channel.SiteId = site.Id;
            await _channelRepository.UpdateAsync(channel);

            await _templateRepository.CreateDefaultTemplateAsync(site.Id);

            return(channel.Id);
        }