public async Task Initialize() { var deviceList = await storage.GetDeviceListAsync(); var activeDevices = deviceList.ToList(); foreach (var device in activeDevices) { var deviceGrain = GrainFactory.GetGrain <IDeviceGrain>(Guid.Parse(device.DeviceId)); await RegisterGrain(deviceGrain); if (device.IsEnabled) { await deviceGrain.Start(); } } }
public async Task <IEnumerable <DeviceConfig> > Get() { return(await storage.GetDeviceListAsync()); }