예제 #1
0
        public void AddOrUpdate(Models.MagicMirror magicMirror)
        {
            //find magicMirror in _cache
            var mirror = _cache.Where(m => m.BleAddress == magicMirror.BleAddress).FirstOrDefault();

            if (mirror != null)
            {
                mirror.Ip = magicMirror.Ip;
                mirror.SelectedNetwork = magicMirror.SelectedNetwork;
            }
            else
            {
                _cache.Add(magicMirror);
            }

            SaveChanges();
        }
예제 #2
0
 public void Remove(Models.MagicMirror magicMirror)
 {
     _cache.Remove(magicMirror);
     SaveChanges();
 }