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