public static Device CreateDevice(DeviceTemplate template)
 {
     if (template == null)
         throw new ArgumentNullException("template");
     return new Device
     {
         ID = Guid.NewGuid().ToString(),
         Template = template,
     };
 }
 public void AddDevice(DeviceTemplate template)
 {
     var device = Device.CreateDevice(template);
     Devices = Devices.Union(new Device[]{ device }).ToArray();
 }