public Task AddChannel(ChannelIconDto channelIcon) { _chatService.AddChannel(channelIcon, _channelRepo, _serverRepo); Groups.AddToGroupAsync(Context.ConnectionId, channelIcon.HubGroupId); return(Clients.Group(channelIcon.HubGroupId).ChannelAdded(channelIcon)); }
/// <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(); }
public Channel(ChannelIconDto channelIconDto) { Name = channelIconDto.Name; Description = channelIconDto.Description; InitializeVariables(); }