Example #1
0
        public override async Task OnDisconnectedAsync(Exception exception)
        {
            var currentContext = new CurrentContext();

            currentContext.Build(Context.User);
            foreach (var org in currentContext.Organizations)
            {
                await Groups.RemoveFromGroupAsync(Context.ConnectionId, $"Organization_{org.Id}");
            }
            _connectionCounter.Decrement();
            await base.OnDisconnectedAsync(exception);
        }
Example #2
0
        public override async Task OnDisconnectedAsync(Exception exception)
        {
            var currentContext = new CurrentContext(_providerUserRepository);
            await currentContext.BuildAsync(Context.User, _globalSettings);

            if (currentContext.Organizations != null)
            {
                foreach (var org in currentContext.Organizations)
                {
                    await Groups.RemoveFromGroupAsync(Context.ConnectionId, $"Organization_{org.Id}");
                }
            }
            _connectionCounter.Decrement();
            await base.OnDisconnectedAsync(exception);
        }