Ejemplo n.º 1
0
 public void UnregisterNode(NodeInfo info)
 {
     var foundNode = _dataService.ServiceNodes.FirstOrDefault(x => x.UniqueId == info.UniqueId);
     if (foundNode != null)
     {
         _dataService.ServiceNodes.Remove(foundNode);
         _dataService.SaveChanges();
     }
 }
Ejemplo n.º 2
0
        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();
        }