public async Task InsertMultiple() { int x = 1; for (x = 1; x <= 10; x++) { _Queue_Info aa = new _Queue_Info { Servicing_Office = x }; await firebase.Child("Queue_Info/").PostAsync <_Queue_Info>(aa); } }
public async Task App_Insert_QueueInfoAsync(_Queue_Info qi, CancellationToken cts) { string ChildRowName = qi.Servicing_Office.ToString(); try { cts.ThrowIfCancellationRequested(); await Task.Run(() => firebase.Child("Queue_Info/").Child(ChildRowName).PutAsync <_Queue_Info>(qi)); } catch (FirebaseException e) { Console.WriteLine("Problem -> Method: Insert QueueInfo"); throw; } catch (OperationCanceledException e) { Console.WriteLine("Cancelled -> Method: Insert QueueInfo"); } }
public async void App_Update_QueueInfo(int where, _Queue_Info q_info) { string node = "Queue_Info/"; Console.WriteLine("App Update Child running"); string key = ""; var cc = await firebase.Child(node).OrderBy("Servicing_Office").StartAt(where).EndAt((where + 1)).LimitToFirst(1).OnceAsync <_Queue_Info>(); foreach (var b in cc) { key = b.Key; } Console.WriteLine("Key returned is " + key); try { await firebase.Child(node).Child(key).PatchAsync <_Queue_Info>(q_info); } catch (Exception e) { Console.Write("error ->" + e); } finally { Console.Write("Update finished."); } }
public async Task Delete(_Queue_Info q_info) { //>await firebase.Child(node).Child(q_info.Key).DeleteAsync(); }