示例#1
0
 public DeviceData GetDevice(int id)
 {
     if (!_deviceMap.TryGetValue(id, out var item))
     {
         _deviceMap.Add(id, null);
         _deviceMap[id] = item = DeviceData.Deserialize(_jsonDatabase.GetDevice(id), this);
     }
     if (item == null)
     {
         throw new DatabaseException(CircularDependencyText + "Device_" + id);
     }
     return(item);
 }