void webSocket_MessageReceived(object sender, MessageReceivedEventArgs e) { var obj = (JsonObject)SimpleJson.SimpleJson.DeserializeObject(e.Message); //var obj = new JsonObject(); //obj. if (obj == null) { return; } var tele = new Telemetry(); tele.Name = (string)obj ["Name"]; tele.SourceId = Int32.Parse(obj["SourceId"].ToString()); tele.Value = float.Parse(obj["Value"].ToString()); tele.Timestamp = DateTime.Parse((string)obj["TimeStamp"]); Database.Main.InsertTelemetryAsync(tele); Console.WriteLine(e.Message.ToString()); }
public Task<bool> InsertTelemetryAsync(Telemetry tele) { return Task.Factory.StartNew<bool>(() => { return this.InsertTelemetry(tele); }); }
public Task <bool> InsertTelemetryAsync(Telemetry tele) { return(Task.Factory.StartNew <bool>(() => { return this.InsertTelemetry(tele); })); }
public bool InsertTelemetry(Telemetry tele) { return this.Insert(tele, tele.GetType()) == 1; }
public bool InsertTelemetry(Telemetry tele) { return(this.Insert(tele, tele.GetType()) == 1); }