public async Task <HeartbeatResponseModel> UpdateDeviceHeartbeat([FromBody] DeviceHeartbeatModel model) { var command = HeartbeatReceived.FromDevice(_context.DeviceId, model); var deviceVersion = await _messagingSrv.SendAsync(command); return(new HeartbeatResponseModel { ConfigurationVersion = deviceVersion.ConfigurationVersion }); }
public static HeartbeatReceived FromDevice(Guid deviceId, DeviceHeartbeatModel deviceHeartbeat) { if (deviceHeartbeat == null) throw new ArgumentNullException(nameof(deviceHeartbeat), "Command can't be created from null model."); return new HeartbeatReceived { DeviceId = deviceId, Heartbeat = deviceHeartbeat }; }