Пример #1
0
        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);
        }
Пример #2
0
        public override async Task OnActivateAsync()
        {
            config = await configuration.GetDeviceByIdAsync(this.GetPrimaryKey().ToString());

            statusHistory = GrainFactory.GetGrain <IDeviceStatusHistoryGrain>(this.GetPrimaryKey());
            State         = config.ToDeviceGrainState();
        }
Пример #3
0
 public async Task <IActionResult> GetById(string deviceId)
 {
     return(Ok(await storage.GetDeviceByIdAsync(deviceId)));
 }