Exemplo n.º 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));
        }
Exemplo n.º 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();
        }
Exemplo n.º 3
0
 public Channel(ChannelIconDto channelIconDto)
 {
     Name        = channelIconDto.Name;
     Description = channelIconDto.Description;
     InitializeVariables();
 }