コード例 #1
0
        public static void Show(Scope obj)
        {
            IHubContext context = GlobalHost.ConnectionManager.GetHubContext <ScopeHub>();

            //context.Clients.All.updateMessages();
            if (dxUsersConnections.ContainsKey(obj.UserId.ToString()))
            {
                List <string> availConnections = dxUsersConnections[obj.UserId.ToString()];
                foreach (var connection in availConnections)
                {
                    string jsonObject = JsonConvert.SerializeObject(obj);
                    context.Clients.Client(connection).updateMessages(jsonObject);
                }
                ScopeRepository.UpdateScopeStatus(obj);
            }
        }