Beispiel #1
0
        public Task AddChannel(ChannelIconDto channelIcon)
        {
            _chatService.AddChannel(channelIcon, _channelRepo, _serverRepo);

            Groups.AddToGroupAsync(Context.ConnectionId, channelIcon.HubGroupId);
            return(Clients.Group(channelIcon.HubGroupId).ChannelAdded(channelIcon));
        }
Beispiel #2
0
        /// <inheritdoc/>
        public void AddChannel(ChannelIconDto channelIcon,
                               IChatEntityRepositoryProxy <Channel, ChatDbContext> channelRepo,
                               IChatEntityRepositoryProxy <Server, ChatDbContext> serverRepo)
        {
            var server = serverRepo.Find(channelIcon.ServerId);

            _requestValidator.IsServerRequestValid(server, _user, PermissionTypes.CanManageChannels);

            var newChannel = new Channel(channelIcon);

            channelRepo.Add(newChannel);
            _unitOfWork.Submit();
        }
Beispiel #3
0
 public Channel(ChannelIconDto channelIconDto)
 {
     Name        = channelIconDto.Name;
     Description = channelIconDto.Description;
     InitializeVariables();
 }