Exemplo n.º 1
0
 public virtual async Task SetAsync(ChildQuery query, string key, OfflineEntry entry)
 {
     using (var child = query.Child(key))
     {
         if (entry.SyncOptions == SyncOptions.Put)
         {
             await child.PutAsync(entry.Data);
         }
         else
         {
             await child.PatchAsync(entry.Data);
         }
     }
 }
Exemplo n.º 2
0
        private async Task ResetAfterPull(Task <T> task, string key, OfflineEntry entry)
        {
            await task;

            this.SetAndRaise(key, new OfflineEntry(key, task.Result, entry.Priority, SyncOptions.None), FirebaseEventSource.OnlinePull);
        }
Exemplo n.º 3
0
 private void SetAndRaise(string key, OfflineEntry obj, FirebaseEventSource eventSource = FirebaseEventSource.Offline)
 {
     this.Database[key] = obj;
     this.subject.OnNext(new FirebaseEvent <T>(key, obj?.Deserialize <T>(), string.IsNullOrEmpty(obj?.Data) || obj?.Data == "null" ? FirebaseEventType.Delete : FirebaseEventType.InsertOrUpdate, eventSource));
 }