public async Task <bool> GetLoadedDeviceState(string deviceId) { bool result = false; var device = await storage.GetDeviceByIdAsync(deviceId); var deviceGrain = GrainFactory.GetGrain <IDeviceGrain>(Guid.Parse(device.DeviceId)); if (deviceGrain != null) { //var deviceState = await deviceGrain.GetCurrentState(); result = true; } return(result); }
public override async Task OnActivateAsync() { config = await configuration.GetDeviceByIdAsync(this.GetPrimaryKey().ToString()); statusHistory = GrainFactory.GetGrain <IDeviceStatusHistoryGrain>(this.GetPrimaryKey()); State = config.ToDeviceGrainState(); }
public async Task <IActionResult> GetById(string deviceId) { return(Ok(await storage.GetDeviceByIdAsync(deviceId))); }