示例#1
0
文件: Hub.cs 项目: BobbyCannon/HostR
 public void UnregisterHub(HubInfo info)
 {
     var foundHub = _dataService.ServiceHubs.FirstOrDefault(x => x.UniqueId == info.UniqueId);
     if (foundHub != null)
     {
         _dataService.ServiceHubs.Remove(foundHub);
         _dataService.SaveChanges();
     }
 }
示例#2
0
        public void UnregisterHub(HubInfo info)
        {
            var foundHub = _dataService.ServiceHubs.FirstOrDefault(x => x.UniqueId == info.UniqueId);

            if (foundHub != null)
            {
                _dataService.ServiceHubs.Remove(foundHub);
                _dataService.SaveChanges();
            }
        }
示例#3
0
文件: Hub.cs 项目: BobbyCannon/HostR
        public void RegisterHub(HubInfo info)
        {
            var foundHub = _dataService.ServiceHubs.FirstOrDefault(x => x.UniqueId == info.UniqueId);
            if (foundHub == null)
            {
                foundHub = new Data.Entities.HubInfo();
                foundHub.UniqueId = info.UniqueId;
            }

            foundHub.Name = info.Name;

            _dataService.ServiceHubs.AddOrUpdate(foundHub);
            _dataService.SaveChanges();
        }
示例#4
0
        public void RegisterHub(HubInfo info)
        {
            var foundHub = _dataService.ServiceHubs.FirstOrDefault(x => x.UniqueId == info.UniqueId);

            if (foundHub == null)
            {
                foundHub          = new Data.Entities.HubInfo();
                foundHub.UniqueId = info.UniqueId;
            }

            foundHub.Name = info.Name;

            _dataService.ServiceHubs.AddOrUpdate(foundHub);
            _dataService.SaveChanges();
        }