コード例 #1
0
        public override async Task OnConnectedAsync()
        {
            var currentContext = new CurrentContext();

            currentContext.Build(Context.User);
            foreach (var org in currentContext.Organizations)
            {
                await Groups.AddToGroupAsync(Context.ConnectionId, $"Organization_{org.Id}");
            }
            _connectionCounter.Increment();
            await base.OnConnectedAsync();
        }
コード例 #2
0
        public override async Task OnConnectedAsync()
        {
            var currentContext = new CurrentContext(_providerUserRepository);
            await currentContext.BuildAsync(Context.User, _globalSettings);

            if (currentContext.Organizations != null)
            {
                foreach (var org in currentContext.Organizations)
                {
                    await Groups.AddToGroupAsync(Context.ConnectionId, $"Organization_{org.Id}");
                }
            }
            _connectionCounter.Increment();
            await base.OnConnectedAsync();
        }