示例#1
0
文件: Hub.cs 项目: BobbyCannon/HostR
 public void UnregisterNode(NodeInfo info)
 {
     var foundNode = _dataService.ServiceNodes.FirstOrDefault(x => x.UniqueId == info.UniqueId);
     if (foundNode != null)
     {
         _dataService.ServiceNodes.Remove(foundNode);
         _dataService.SaveChanges();
     }
 }
示例#2
0
文件: Hub.cs 项目: BobbyCannon/HostR
        public void RegisterNode(NodeInfo info)
        {
            var foundNode = _dataService.ServiceNodes.FirstOrDefault(x => x.UniqueId == info.UniqueId);
            if (foundNode == null)
            {
                foundNode = new Data.Entities.NodeInfo();
                foundNode.UniqueId = info.UniqueId;
            }

            foundNode.Name = info.Name;

            _dataService.ServiceNodes.AddOrUpdate(foundNode);
            _dataService.SaveChanges();
        }